Need more sound sample memory

Status
Not open for further replies.

Andy Belov

Well-known member
I want to load a few instrument samples (flute, piano, drums, etc.), but run out of memory quickly.
Is there a way to "move" memory from "Program" to the "other". Now its usage is 4% vs. 65%. To get to 65% from 94%, I had to limit my instruments to a very few.
And I don't want to add the memory chips because it will complicate my production very much.

Or should I use smaller (lower quality) samples? Do you have some I can borrow?

This is what I get now:
Program size: 292,352 bytes (used 4% of a 8,126,464 byte maximum) (13.02 secs)
Minimum Memory Usage: 339732 bytes (65% of a 524288 byte maximum)

Thanks.
 
Why do you need to load the entire sample into memory?

To store a sample in program memory the following should do I guess:
Code:
constexpr size_t SAMPLE_SIZE = 131072;

__attribute__((section(".text")))
const static int16_t sample[SAMPLE_SIZE] = {
    0, // ... sample data goes here ...
};
 
You can use PROGMEM to store variables in flash, EXTMEM if you have PSRAM installed. There is also another post on the forum regarding loading wavetables from an SD card to memory.

Code:
EXTMEM uint32_t foo[20352];

PROGMEM uint32_t foo2[20352];
 
Status
Not open for further replies.
Back
Top