I have a large number of wav files sampled from a Piano that comprises 2 octave's worth of the standard 12 pitches AND 6 different velocity settings for each pitch
This means I have 2*12*6 = 144 different wav files
I want to use a capacitive touch / pressure sensitive keyboard I built to play them with 8-note polyphony from a Teensy which could also then add effects such as reverb. Ideally the latency is very low which makes me think I should load all wav files from an SD card into RAM at startup and then play from there using the Audio System Design Tool's "playMem" function once the keyboard is pressed.
The problem is that the samples are 8 seconds long and thus about 1.4MB which means that I would need ~202MB (144*1.4) of memory to hold it all. Since the Teensy 4.1 can only be expanded to include two 8MB PSRAM chips, that total extra 16MB will not be anywhere near enough space unfortunately.
Another option might be to add a 256MB Flash chip to the Teensy 4.1 which should have enough space and then use the "playFlash" function to play the sound files. My main questions are:
1) Is playing from memory with "playMem" actually significantly faster than from flash with "playFlash"? Does anyone know the % speed up?
2) Is there anything wrong about my above assumptions? Can I expand PSRAM beyond 16MB total or expand Flash beyond 256MB total?
3) The fall back plan would be to just play from an SD card with either "playSDWav" or "playSDRaw" which would solve all space problems since they would only be loaded into memory until I press on the keyboard but I am worried about both the added latency and polyphony constraints which I read were an issue with playing from an SD card. Still, I've read the SD card code has been improved over time. Has anyone recently found these constraints to be both real and problematic?
Thanks for any advice!
This means I have 2*12*6 = 144 different wav files
I want to use a capacitive touch / pressure sensitive keyboard I built to play them with 8-note polyphony from a Teensy which could also then add effects such as reverb. Ideally the latency is very low which makes me think I should load all wav files from an SD card into RAM at startup and then play from there using the Audio System Design Tool's "playMem" function once the keyboard is pressed.
The problem is that the samples are 8 seconds long and thus about 1.4MB which means that I would need ~202MB (144*1.4) of memory to hold it all. Since the Teensy 4.1 can only be expanded to include two 8MB PSRAM chips, that total extra 16MB will not be anywhere near enough space unfortunately.
Another option might be to add a 256MB Flash chip to the Teensy 4.1 which should have enough space and then use the "playFlash" function to play the sound files. My main questions are:
1) Is playing from memory with "playMem" actually significantly faster than from flash with "playFlash"? Does anyone know the % speed up?
2) Is there anything wrong about my above assumptions? Can I expand PSRAM beyond 16MB total or expand Flash beyond 256MB total?
3) The fall back plan would be to just play from an SD card with either "playSDWav" or "playSDRaw" which would solve all space problems since they would only be loaded into memory until I press on the keyboard but I am worried about both the added latency and polyphony constraints which I read were an issue with playing from an SD card. Still, I've read the SD card code has been improved over time. Has anyone recently found these constraints to be both real and problematic?
Thanks for any advice!