music.note_with_vibrato_seq_localization

music.note_with_vibrato_seq_localization(freqs=(220, 440, 330), durations=((2, 3), (2, 5, 3), (2, 5, 6, 1, 0.4), (4, 6, 1)), vibratos_freqs=((2, 6, 1), (0.5, 15, 2, 6, 3)), max_pitch_devs=((2, 1, 5), (4, 3, 7, 10, 3)), alpha=((1, 1), (1, 1, 1), (1, 1, 1, 1, 1), (1, 1, 1)), x=(-10, 10, 5, 3), y=(1, 1, 0.1, 0.1), method=('lin', 'exp', 'lin'), waveform_tables=((array([-1., -0.99975586, -0.99951172, ..., -0.99926758, -0.99951172, -0.99975586], shape=(16384,)), array([-1., -0.99975586, -0.99951172, ..., -0.99926758, -0.99951172, -0.99975586], shape=(16384,))), (array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), array([-1., -0.99975586, -0.99951172, ..., -0.99926758, -0.99951172, -0.99975586], shape=(16384,)), array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,))), (array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)), array([0., 0.0003835, 0.00076699, ..., -0.00115049, -0.00076699, -0.0003835], shape=(16384,)))), stereo=True, zeta=0.215, air_temp=20, number_of_samples=0, sample_rate=44100)[source]

A sound with arbitrary meta-vibratos, transitions of frequency and localization.

Parameters:
freqssequence of scalars

Positive frequencies at each end of the pitch transitions.

durationslist of lists of scalars

The durations of the pitch transitions and then of the vibratos and then of the position transitions, in seconds. Each segment uses int(sample_rate * duration) samples. A position transition must span at least one sample to define its velocity.

vibratos_freqslist of lists of scalars

The frequencies of each vibrato.

max_pitch_devslist of lists of scalars

The maximum deviation of pitch in the vibratos in semitones.

alphalist of lists of scalars

Indexes to distort the pitch deviations of the transitions and the vibratos. A zero vibrato index selects the undistorted oscillation.

xsequence of scalars

The x positions at each end of the transitions.

ysequence of scalars

The y positions at each end of the transitions.

methodlist of strings

An entry for each transition of location: ‘exp’ for exponential and ‘lin’ (default) for linear. An exponential transition moves each coordinate by a constant ratio, so a coordinate that changes may not start or end at zero or change sign; one that stays the same, zero included, is held.

waveform_tableslist of lists of array_likes

The tables with the waveforms to synthesize the sound and then for the oscillatory patterns of the vibratos. All the tables for f should have the same size.

stereobool

If True, returns a (2, nsamples) array representing a stereo sound. Else it returns a simple array for a mono sound.

zetascalar

The distance between the ears in meters.

air_tempscalar

The air temperature in Celsius. (Used to calculate the acoustic velocity.)

number_of_samplesscalar

If nonzero, truncate or zero-pad the complete render to this length, including the initial interaural delay.

sample_ratescalar

The sample rate.

Returns:
sndarray

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

Raises:
ValueError

If a pitch endpoint is not positive, a position transition spans fewer than one sample, or an exponential position transition has no ratio to move a coordinate by.

See also

note_with_glissando_vibrato

A note with a glissando and a vibrato.

note_with_doppler

A note with a simple linear transition of location.

note_with_two_vibratos_glissando

A note with a glissando and two vibratos.

note_with_two_vibratos

A note with 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.

Notes

Check the functions above for more information about how each feature of this function is implemented.

A one-sample pitch transition uses its starting frequency for a positive curve index; an index of zero jumps directly to the endpoint. After the pitch sequence ends its final frequency is held; completed vibratos contribute no further modulation. After movement ends the source stays at its final coordinates, with zero radial velocity.

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_stereo(note_with_vibrato_seq_localization())