music.note_with_two_vibratos

music.note_with_two_vibratos(freq=220, duration=2, vibrato_freq=2, secondary_vibrato_freq=6, max_pitch_dev=2, secondary_max_pitch_dev=4, alphav1=1, alphav2=1, 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,)), secondary_vibrato_waveform_table=array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), number_of_samples=None, sample_rate=None, **renamed)[source]

A note with a vibrato that also has a secondary oscillatory pattern.

Parameters:
freqscalar

The frequency of the note.

durationscalar

The duration of the sound in seconds.

vibrato_freqscalar

The frequency of the vibrato.

secondary_vibrato_freqscalar

The frequency of the secondary pattern of the vibrato.

max_pitch_devscalar

The maximum deviation of pitch in the vibrato in semitones.

secondary_max_pitch_devscalar

The maximum deviation in semitones of pitch in the secondary pattern of the vibrato.

alphav1scalar

An index to distort the pitch deviation of the vibrato.

alphav2scalar

An index to distort the pitch deviation of the secondary pattern of the vibrato.

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.

secondary_vibrato_waveform_tablearray_like

The table with the waveform for the secondary pattern of the vibrato.

number_of_samplesscalar or None

The number of samples of the sound. If given, duration is not used, and zero is no samples.

sample_ratescalar or None

The sample rate. None, the default, is the rate music.get_sample_rate() returns.

**renamed

nu1, nu2 and sec_vibrato_waveform_table, what max_pitch_dev, secondary_max_pitch_dev and secondary_vibrato_waveform_table were called before they took the names note_with_two_vibratos_glissando() gives them. Still accepted, with a DeprecationWarning.

Returns:
sndarray

A numpy array where each value is a PCM sample of the sound.

Raises:
ValueError

If alphav1 is negative: it bends a vibrato through zero, where a negative power has no finite value, and the render came back holding infinity behind a warning.

If alphav2 is negative: it bends a vibrato through zero, where a negative power has no finite value, and the render came back holding infinity behind a warning.

Parameters:
  • freq (float)

  • duration (float)

  • vibrato_freq (float)

  • secondary_vibrato_freq (float)

  • max_pitch_dev (float)

  • secondary_max_pitch_dev (float)

  • alphav1 (float)

  • alphav2 (float)

  • waveform_table (ArrayLike)

  • vibrato_waveform_table (ArrayLike)

  • secondary_vibrato_waveform_table (ArrayLike)

  • number_of_samples (int | None)

  • sample_rate (int | None)

  • renamed (Any)

Return type:

NDArray[float64]

See also

note_with_glissando_vibrato

A note with a glissando and a vibrato.

note_with_two_vibratos_glissando

A note with a glissando and a vibrato with two oscillatory patterns.

note

A basic musical note without vibrato.

note_with_vibrato

A musical note with an oscillation of pitch.

tremolo

A tremolo, an oscillation of loudness.

fade

Fade in and out.

loud

A transition of loudness.

Examples

>>> write_wav_mono(note_with_two_vibratos())  # two simultaneous vibratos
>>> s = horizontal_stack(
...     *[adsr(sonic_vector=note_with_two_vibratos(
...         vibrato_freq=i, secondary_vibrato_freq=j))
...       for i, j in zip([2, 6, 4], [8, 10, 15])])
>>> write_wav_mono(s)  # writes a file with two vibratos