Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: change pitch and decay sample WAV

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    5

    change pitch and decay sample WAV

    Hello, i have a question.

    I have a teensy 3.2 and I would like to create a drum machine with SAMPLE (sampled by my roland 808)
    I'm understand how to control the pitch and decay

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,054
    Changing the pitch of a sample is complex since it comprises extrapolating, filtering and re-sampling which is most probably too much work and mathematics for a small embedded MCU like the Teensy 3.2. I'd rather think of generating up to 127 samples (one for each possible midi pitch within the pitch range you are interested in, but for drums, it doesn't probably make sense to go above midi note 84) and to put them on the SD card as 60.WAV, 61.WAV, and so on. Then, you can then trigger the playback of these samples with whatever you want. Or, still simpler, use the drum synth object from the audio library.

    In ever case, the decay can be easily handled by the envelope object of the audio library.

    More info and examples here: https://www.pjrc.com/teensy/td_libs_Audio.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •