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

Thread: Play samples at different pitches by MIDI

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Posts
    11

    Play samples at different pitches by MIDI

    Hi,

    Today I've mounted the audio board on the Teensy 3.2 that I have received.
    After having tried some skecth examples everything seems to be working fine.

    Now my project is to build a small MIDI sampler, let's say a MIDI instrument that plays/records samples.
    So from the example sketch I know I can play samples at their origin speed (or pitch), now I would like to go further and trigger samples by playing notes by MIDI on my master keyboard.
    And of course I would like to be able to play a sample on different notes (at different speeds). The AudioPlaySdWav object has a "play" method, is there a way to change the pitch ?
    Let's say by assigning a root note (for the origin speed), for example C3 and then change the pitch according to the MIDI note received.

    It would be great to be able to loop a sample too

    Noob question : what is controlling the optional pot ? I've soldered one but it doesn't adjust the volume level on the minijack output (level which is set in the sketch, that could explain)

    Thanks and regards
    David

  2. #2
    For pitched playback, check out the thread where they were discussing granular playback. It's not exactly an easy problem to solve.

    https://forum.pjrc.com/threads/29275...-Audio-Adaptor

    The pot is tied to A1. Your sketch can read it, and apply it to whatever parameter you wish. For a volume control on the Audio Adapter, do an analogRead(A1), then translate the result to a float and feed it to the sgtl5000.volume() method.

Posting Permissions

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