music.tremolos¶
- music.tremolos(durations=((3, 4, 5), (2, 3, 7, 4)), tremolo_freqs=((2, 6, 20), (5, 6.2, 21, 5)), max_db_devs=((10, 20, 1), (5, 7, 9, 2)), alpha=((1, 1, 1), (1, 1, 1, 9)), waveform_tables=((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([-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([-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,)))), number_of_samples=0, sonic_vector=0, sample_rate=44100)[source]¶
An envelope with multiple tremolos.
- Parameters:
- durationsiterable
ofiterableofscalars the durations of each tremolo.
- tremolo_freqsiterable
ofiterableofscalars The frequencies of each tremolo.
- max_db_devsiterable
ofiterableofscalars The maximum loudness variation of each tremolo.
- alphaiterable
ofiterableofscalars Indexes for distortion of each tremolo [1].
- waveform_tablesiterable
ofiterableofarray_likes Tables for lookup for each tremolo.
- number_of_samplesiterable
ofiterableofscalars The number of samples or each tremolo.
- sonic_vectorarray_like
The sound to which apply the tremolos. If supplied, the tremolo lines are applied to the sound and missing samples are completed by zeros (if sonic_vector is smaller then the lengthiest tremolo) or ones (is sonic_vector is larger).
- sample_rate
integer The sample rate
- durationsiterable
- Returns:
- s
ndarray A numpy array where each value is a value of the envelope for the PCM samples. If sonic_vector is supplied, e is the sonic vector with the envelope applied to it.
- s
See also
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
>>> W(V(d=8)*L_()) # writes a WAV file with a loudness transitions