librosa.shepard_risset_glissando#
- librosa.shepard_risset_glissando(frequency, *, n_octaves=1.0, sr=22050, length=None, duration=None, weighting='A')[source]#
Construct a Shepard-Risset glissando signal.
A Shepard-Risset glissando is a continuous tone sweep that creates the auditory illusion of a pitch endlessly ascending or descending.
- Parameters:
- frequencyfloat > 0 or str
Starting frequency of the base tone (in Hz) or note name in SPN format (e.g., ‘C4’).
- n_octavesfloat
Number of octaves to sweep over. Can be fractional or negative (for a descending glissando).
- srnumber > 0
Desired sampling rate of the output signal.
- lengthint > 0 or None
Desired number of samples in the output signal. When both
durationandlengthare defined,lengthtakes priority.- durationfloat > 0 or None
Desired duration in seconds. When both
durationandlengthare defined,lengthtakes priority.- weightingstr or None
Type of perceptual weighting to apply (e.g.,
'A','B','C','D','Z'). IfNone, no weighting is applied.
- Returns:
- glissando_signalnp.ndarray [shape=(length,), dtype=float64]
Synthesized Shepard-Risset glissando signal.
See also
Examples
Generate an ascending Shepard-Risset glissando sweeping over 2 octaves:
>>> y = librosa.shepard_risset_glissando(110.0, duration=3.0, n_octaves=2.0)
Or starting from note C4:
>>> y_c4 = librosa.shepard_risset_glissando("C4", duration=3.0, n_octaves=2.0)
Generate a descending Shepard-Risset glissando sweeping over 2 octaves:
>>> y_desc = librosa.shepard_risset_glissando(110.0, duration=3.0, n_octaves=-2.0)