music.note_with_vibrato¶
- music.note_with_vibrato(freq=220, duration=2, vibrato_freq=4, max_pitch_dev=2, waveform_table=array([-1., -0.99975586, -0.99951172, ..., -0.99926758, -0.99951172, -0.99975586], shape=(16384,)), vibrato_waveform_table=array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), alpha=1, number_of_samples=0, sample_rate=44100)[source]¶
Synthesize a musical note with a vibrato.
Set fv=0 or nu=0 (or use N()) for a note without vibrato. A vibrato is an oscillatory pattern of pitch [1].
- Parameters:
- freqscalar
The frequency of the note in Hertz.
- durationscalar
The duration of the note in seconds.
- vibrato_freqscalar
The frequency of the vibrato oscillations in Hertz.
- max_pitch_deviationscalar
The maximum deviation of pitch in the vibrato in semitones.
- waveform_tablearray_like
The table with the waveform to synthesize the sound.
- vibrato_waveform_tablearray_like
The table with the waveform for the vibrato oscillatory pattern.
- alphascalar
An index to distort the vibrato [1]. If alpha != 1, the vibrato is not of linear pitch.
- number_of_samples
integer The number of samples in the sound. If supplied, d is ignored.
- sample_rate
integer The sample rate.
- Returns:
- result
ndarray A numpy array where each value is a PCM sample of the note.
- result
See also
synth_noteA basic musical note without vibrato.
TA tremolo, an oscillation of loudness.
fmA linear oscillation of the frequency (not linear pitch).
AMA linear oscillation of amplitude (not linear loudness).
V_A shorthand to render a note with vibrato using a reference frequency and a pitch interval.
Notes
In the MASS framework implementation, for a sound with a vibrato (or FM) to be synthesized using LUT, the vibrato pattern is considered when performing the lookup calculations.
The tremolo and AM patterns are implemented as separate amplitude envelopes.
Cite the following article whenever you use this function.
References
[1]Fabbri, Renato, et al. “Musical elements in the discrete-time representation of sound.” arXiv preprint arXiv:abs/1412.6853 (2017)
Examples
>>> write_wav_mono(note_with_vibrato()) # writes a WAV file of a note >>> s = H([note_with_vibrato(i, j) for i, j in zip([200, 500, 100], [2, 1, 2])]) >>> s2 = note_with_vibrato(440, 1.5, 6, 1)