Instrument w. Polyphonic Sample Playback

Status
Not open for further replies.

jbjb

Member
Hello! I am trying to make an instrument that has samples combined with a basic piano sound, so that when you hit the black keys on a midi keyboard, you hear a sample. Ideally, it could support as many samples playing simultaneously as possible, but at a minimum, I hope to get 6 'voices' out of it, hopefully more. I understand that sd cards can struggle when playing multiple samples at once so my thought is:

- use a teensy 4.1 with 128mb of flash memory to store the samples (36 samples in total)
- synthesize the piano sound using wavetable ; possibly adding extra psram to help with that(?)

I'm a touch confused reading the documentation about expanding memory on the 4.1 and audio shield, so does that make sense and seem possible?

Thank you!
 
Yes, your project seems possible :)
Presumably, you mean to store the samples on the card, and then unload them into memory at runtime. I guess it would be a case of comparing read speeds from the memory card, vs the data rate you'd need in order to get these 6 samples out - 6x 14 bit, 44kHz, = 3.7Mbit/s - which doesn't seem outrageous, but I appreciate your comments about reading multiple files at once. I'd probably think to give yourself some kind of buffer as is common for audio. The longer your buffer, the less likely you'll find that the SD card will have a moment causing drop out. The teensy 4.1 does have 8Mbyte, so you could easily go for a generous 500k byte buffer to give you a second's worth (which is huge IMO). This is just my quick maths, if you've crunched them properly and got different values then I might well be off.
Synthesizing I can't comment on as I've never done it, but I'm sure I've seen posts about people doing it!

Other than that, where are you with this project? Do you have something playing samples when you press a key? It's worth only worrying about the very next step, as in taking it, you'll probably learn something valuable about the step after.
 
Thanks for the encouragement Edward! Wise words to take it one step at a time, something I foolishly ignore too often :)

So far I've soldered up a teensy 4.1 with an extra 8mb of psram, set up my audio shield, and created a midi input circuit and got that going as well. All that has been tested and is working properly, and my next step is to create a basic sample playback system using the midi input, but I'm a bit stumped on how to push forward the synthesis side of things.

I've tried to get the wavetable examples (included in the audio library) running, but compiling them gives memory related errors, which seems strange as I assume the 4.1 is higher spec'd than the 3.6 the wavetable examples were made for... I probably should start a separate thread about that error.

I've watched the audio library tutorial but would love any suggestions for other projects or tutorials to read through about setting up polyphonic systems!
 
Status
Not open for further replies.
Back
Top