alda
alda copied to clipboard
Sampler instrument
Idea: an instrument that can load a sample (an audio file on disk) and use it to play notes, chords, etc. by manipulating the speed and pitch of the sample.
Example code sketch:
sampler "voice-sample":
# load a wav file sample and note that its pitch is A4
(load-sample "voice-humming.wav" :A4)
# play the sampler instrument like any other Alda instrument
c8 d e f g a b > c | c1/e/g
I will work on this idea but wouldn't it be cooler if we added auto detection for the note played in the audio file? I believe some signal processing and FFT will do the trick.
I think that would be a nice feature to have, although it would also be useful to be able to specify, e.g. when loading a complex sample that has multiple audible pitches. Maybe it should auto-detect the pitch by default, and the pitch could be an optional argument.