Guys, I'm working on a 16 Step MIDI Drum-Machine to run on Arduino Uno/Mega/...

I want to use its EEPROM to hold the patterns, so the user can use a Song-Link that plays patterns in order. But the problem is the size of each pattern, and I don't know how to optimize. I was wondering maybe if I could "compress" each pattern before storing, and "uncompress" on reading?

Its just 14 Tracks + 1 Accent Track (last) - since this is a 16 bit number, each bit is a step On/Off.

I also need to decide how to store the patterns in the EEPROM and how to manage the Song-Mode. (shouldn't be too hard I got an Arduino Mega, which has plenty resources, but I want my first project to run on the Uno too.

You want the pattern to be 15 channels and every bit is one beat? So all bit0's are beat 0; all bits 1's are beat 1 all bits 2's are beat 2 and so on until 16. It is sort of a matrix, so let me think....

Rotate the matrix 90 degrees so every unsigned int is one beat (or was that the idea in the first place?)

This way you just read one int at the time and instead of copying them to an array you could fetch them runtime from EEPROM, one int at the time. Should be fast enough, but keep an eye on your timing...

Now, I have a buffer for the next pattern to load, so I don't load and play from the EEPROM, I just load and write once and its on the memory, as it takes only 32 bytes to store the whole pattern. 8-)

I ordered the extra SparkFun chips as they are chip, but it would be fun to be able to compress a 32 byte pattern into something smaller, but I doubt I would go much lower, so extra EEPROM is a must indeed.