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 of iterable of scalars

the durations of each tremolo.

tremolo_freqsiterable of iterable of scalars

The frequencies of each tremolo.

max_db_devsiterable of iterable of scalars

The maximum loudness variation of each tremolo.

alphaiterable of iterable of scalars

Indexes for distortion of each tremolo [1].

waveform_tablesiterable of iterable of array_likes

Tables for lookup for each tremolo.

number_of_samplesiterable of iterable of scalars

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_rateinteger

The sample rate

Returns:
sndarray

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.

See also

loud

An envelope for a loudness transition.

louds

An envelope with an arbitrary number of transitions.

fade

Fade in and out.

adsr

An ADSR envelope.

tremolo

An oscillation of loudness.

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