music.mix_many¶
- music.mix_many(sonic_vectors, end=False, offset=0, sample_rate=44100)[source]¶
Mix sonic vectors of arbitrary lengths.
The operation consists in summing sample by sample [1]. This function helps when the sonic_vectors are not of the same size.
- Parameters:
- Returns:
- S
ndarray A numpy array where each value is a PCM sample of the resulting sound.
- S
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
>>> mixed = mix_many([note(220, 2), note(440, 1)]) >>> write_wav_mono(mixed) # writes a WAV of the two notes summed