larger soundfonts on SD or flash memory

Status
Not open for further replies.

emmanuel63

Well-known member
Hello,

I have been playing with soundfonts and wavetable synthesis. I was wondering if it could be possible to store wavetable samples on SD card or flash memory ? It seems to be a very difficult path...

Emmanuel
 
Just make sure to use PROGMEM CONST for the wavetables and they will be stored in the flash. Not difficult, very easy ;)
 
Hello Frank,
Thanks for answering. I think I was not clear enough. I would like to use large wavetables and store them on external flash memory, or SD card. I am not sure this is possible. The idea is to use high quality wavetables with a lot of samples.
 
I think this is possible, too.
I have never used the wave-tables, but it should be possible to use the external flash. Worst case would be to modify some lines, I think.
The bigger problem - at the moment - might be to copy the tables to the flash. That will become easier when MTP is ready to use. MTP is work in progress, but it looks good so far. I don't think it will take a long time. Maybe when the next Teensyduino is released, which is in the beta-phase (or let's it better call "alpha" - there does not even seem to be a feature-freeze ;-). A few weeks, maybe.
But the QSPI Flash is a bit slower - not that much, the "main" flash still uses a very conserative CLK, if I'm right, too.
 
Last edited:
The wavetable code needs the wavetable data to be memory mapped. Only QSPI on Teensy 4.1 can do that.

With the software available today, the only viable path I see would be to add 1 or 2 PSRAM chips to Teensy 4.1. You would put the converted binary data (which would normally fill an array) into a file, which you'd read from the SD card or other media into an EXTMEM array.

The most PSRAM you can add is 16 Mbyte. So could hold 1 really large soundfont. Or if you encode them to all be under 2 Mbyte, you should load 8 of them into the memory at once. Of course the SD card can hold an incredible number. The new SdFat in 1.54-beta can do sequential reads around 15 to 20 Mbyte/sec on better SD cards. So there will still be some lag to pull in a different soundfont file to an EXTMEM buffer before you can play it, but hopefully not too bad.

In a future with software that does not yet exist today, you might solder a W25Q512JVEIQ flash chip to the bottom of Teensy 4.1. That would give you 64 Mbyte to store soundfont binary data. Getting the data written into the chip would be the tricky part. Also initializing the QSPI to be memory mapped needs to be done, though we do have some early test code which does it. Then you would have all 64 Mbyte of data already memory mapped and you could just use it with a small amount of code to create pointers to the right places.

Another possible software future might have the wavetable object be able to take a File input, rather than a pointer to memory. But that would require quite a lot of work to redesign the wavetable code. How well it could deal with the random read latency of SD cards and other media is a good question. That may or may not be solvable in an adequate manner, so this possible software future may not ever happen.

Today, you only viable path is probably PSRAM chips and code to bring in a small set of the sounds you need to use at any given time.
 
Hello Paul, Hello FRank,

Thank you for your answers. This is very helpful. So I will wait future releases.
I have been testing the new 1.54 beta. Wav samples reading from SD card works now really well. I was able to load large samples bank and play them without lags.
This is not as versatile as wavetable synthesis but this a working solution for sampler styles projects.
 
I have also wanted this,
In the mcu datasheet a Sdram interface is described,
It means we could at least have 32MB extra ram that is much faster than a psram.
And maybe 32mb is enought to buffer data from a sdcard?

In the IMXRT1170 datasheet there is also this functionality, so maybe for a future teensy?

I know, that it then looks more like a raspberry pi zero.
But that have "long" boot times and high power consumption.
 
With the Teensy form factor there is no chance for the needed additional pins. It is just too small :) I'd like to see the pins for cam/display, too, but...
Just lets hope the 1170 Teensy will be not so Teensy :)
 
Status
Not open for further replies.
Back
Top