music.note_with_doppler¶
- music.note_with_doppler(freq=220, duration=2, waveform_table=array([-1., -0.99975586, -0.99951172, ..., -0.99926758, -0.99951172, -0.99975586], shape=(16384,)), x=(-10, 10), y=(1, 1), stereo=True, zeta=0.215, air_temp=20, number_of_samples=0, sample_rate=44100)[source]¶
A simple note with a transition of localization and resulting Doppler effect.
- Parameters:
- freqscalar
The frequency of the note in Hertz.
- durationscalar
The duration of the note in seconds.
- waveform_tablearray_like
The table with the waveform to synthesize the sound.
- xiterable
ofscalars The starting and ending x positions.
- yiterable
ofscalars The starting and ending y positions.
- stereobool
If True, returns a (2, nsamples) array representing a stereo sound. Else it returns a simple array for a mono sound.
- zeta
float The distance between the listener’s ears in meters. It is used to compute interaural differences when generating stereo output.
- air_tempscalar
The air temperature in Celsius. (Used to calculate the acoustic velocity.)
- number_of_samples
integer The number of samples in the sound. If not 0, d is ignored.
- sample_rate
integer The sample rate.
- Returns:
- s
ndarray The PCM samples of the resulting sound.
- s
See also
D_a note with arbitrary vibratos, transitions of pitch and transitions of localization.
PV_a note with an arbitrary sequence of pitch transition and a meta-vibrato.
Notes
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_doppler()) >>> write_wav_mono(T()*note_with_doppler(stereo=False))