blakeAlbion
Well-known member
I have a Teensy with some extra RAM soldered on. I can play a modest amount of uncompressed WAV samples I load from SD.
This is a multitimbral sampler and I want to be able to switch samples quickly: I want to have Voice One load a sample, play it, and then if I switch to another "kit" I want it load another sample at runtime.
I can define blocks of memory to load my samples from SD.
EXTMEM char MEM_BLOCK_1[MAX_EXTMEM];
EXTMEM char MEM_BLOCK_2[MAX_EXTMEM];
EXTMEM char MEM_BLOCK_3[MAX_EXTMEM]; etc
But, this is not efficient because some samples are short, and some are long. I tend to waste memory by giving each "sample voice" in my multitimbral sample and equal amount of fixed memory.
I think I'm missing something. It looks like some folks use Flash memory to hold samples, and thereby eliminate the need for a "Teensy Memory Manager" that can malloc and free EXTMEM without fragmentation. But I'm not quite seeing the connection.
So I have two questions.
1) Can I quickly load, and then swap a sample from flash memory? Can I do it a thousand times without a hitch?
2) Just curious, are there "memory management libraries" you can use in a Teensy without embracing a complete RTOS paradigm?
( I would expect I could pass a big block of EXTMEM into a library and it would handle allocation/deallocation. )
I know these are multiple divergent questions, but I would appreciate any ideas.
Thanks,
Ben
This is a multitimbral sampler and I want to be able to switch samples quickly: I want to have Voice One load a sample, play it, and then if I switch to another "kit" I want it load another sample at runtime.
I can define blocks of memory to load my samples from SD.
EXTMEM char MEM_BLOCK_1[MAX_EXTMEM];
EXTMEM char MEM_BLOCK_2[MAX_EXTMEM];
EXTMEM char MEM_BLOCK_3[MAX_EXTMEM]; etc
But, this is not efficient because some samples are short, and some are long. I tend to waste memory by giving each "sample voice" in my multitimbral sample and equal amount of fixed memory.
I think I'm missing something. It looks like some folks use Flash memory to hold samples, and thereby eliminate the need for a "Teensy Memory Manager" that can malloc and free EXTMEM without fragmentation. But I'm not quite seeing the connection.
So I have two questions.
1) Can I quickly load, and then swap a sample from flash memory? Can I do it a thousand times without a hitch?
2) Just curious, are there "memory management libraries" you can use in a Teensy without embracing a complete RTOS paradigm?
( I would expect I could pass a big block of EXTMEM into a library and it would handle allocation/deallocation. )
I know these are multiple divergent questions, but I would appreciate any ideas.
Thanks,
Ben