alda icon indicating copy to clipboard operation
alda copied to clipboard

Sampler instrument

Open daveyarwood opened this issue 7 years ago • 2 comments

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

daveyarwood avatar Aug 11 '17 14:08 daveyarwood

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.

MinaBombo avatar Aug 11 '17 15:08 MinaBombo

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.

daveyarwood avatar Aug 12 '17 00:08 daveyarwood