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

Thread: SF2 / MIDI-Player for Audio Library or simple Stretching of WAV-Files ?

  1. #1
    Junior Member
    Join Date
    Jan 2018
    Posts
    5

    SF2 / MIDI-Player for Audio Library or simple Stretching of WAV-Files ?

    Hi all,
    I had played around with the ESP32 last year and had found this library from Earle Philhower III and used it as a Sample-Player in my project.
    https://github.com/earlephilhower/ESP8266Audio
    I moved only a bit of the code from ESP8266 to my ESP32 and was surprised to get it working.
    In my project, I used the wavplayer to play and loop a WAV-File from Progmem in variable speed.

    Weeks ago I bought my first Teensy and thought that the Audio-Library is able to play WAV-Files in variable speed .. but it cannot.

    A workaround could be to modify the player for Soundfonts which is existing in the Audio-Library.
    It seems to be a bit of work to transform an SF2 into the right format.

    Earle Philhower was able to use the SF2-File directly which works well on the ESP8266.
    Could this library, which he optimized for the ESP8266 work with the teensy 3.x too??
    https://github.com/earlephilhower/ES...btinysoundfont
    Earle hat also created a MIDI-File-Player together with the SF2-Library. ... could be interesting to play back stored (short or longer) MIDI-Tracks.

    Who is able to transform this for the Teensy?

    As an Alternative, I had created my library for the ESP32 to stretch or compress an existing WAV-File by repeating Samples or dropping Samples
    ... the code does not support the expected Filter or Reverb! ... only the Pitch works acceptable for Rythem- or Percussion-Loops.
    https://github.com/ErichHeinemann/hm...eratorSAMPLE.h
    https://github.com/ErichHeinemann/hm...atorSAMPLE.cpp

    What would be the best option to get cool pitchable Samples in the Audio-Library for the Teensy? Direct SF2-Play or Simple Stretching like I did on the ESP32?

    Regards
    Erich

  2. #2
    AudioEffectGranular can pitch shift and change playback speed. Just route an AudioPlaySdWav (or whatever sound source) through it.

    Take a look here for the example: https://github.com/PaulStoffregen/Au...r/Granular.ino

Posting Permissions

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