music.note_with_glissando¶
- music.note_with_glissando(start_freq=220, end_freq=440, duration=2, alpha=1, waveform_table=array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), method='exp', number_of_samples=0, sample_rate=44100)[source]¶
A note with a pitch transition: a glissando.
- Parameters:
- start_freqscalar
The starting frequency.
- end_freqscalar
The final frequency.
- durationscalar
The duration of the sound in seconds.
- alphascalar
An index to begin the transition faster or slower. If alpha != 1, the transition is not of linear pitch.
- waveform_tablearray_like
The table with the waveform to synthesize the sound.
- number_of_samples
integer The number of samples of the sound. If supplied, d is not used.
- method
str “exp” for an exponential transition of frequency (linear pitch). “lin” for a linear transition of amplitude.
- sample_rate
integer The sample rate.
- Returns:
- s
ndarray A numpy array where each value is a PCM sample of the sound.
- s
See also
NA basic musical note without vibrato or pitch transition.
VA musical note with an oscillation of pitch.
TA tremolo, an oscillation of loudness.
LA transition of loudness.
FFade in or out.
Examples
>>> write_wav_mono(note_with_pitch()) # writes file with a glissando >>> s = H([note_with_pitch(i, j) for i, j in zip([220, 440, 4000], [440, 220, 220])]) >>> write_wav_mono(s) # writes a file with glissandi