Thursday 7 May 2009

Sysex dump, external synch, autorepeat key

I've added support for saving and loading the contents of the two onboard memory chips through MIDI (sysex). This means that patterns, songs and performance maps can be stored on a PC. As I don't have a midi connector on the machine yet, I've been unable to test the code. One possible problem might be that the data is sent to the drum machine faster than it can be stored to the EEProms. I've added a 128 byte buffer, but the proms need a small pause between every 128 byte block. Unless writing to memory is significantly faster than the speed of the MIDI bus, this might be a challenge. One possible solution would be to add blank data between each real 128 byte block. This will be transmitted while the memory write is in pause mode, and can be discarded by the MCU.

I've also added, but not tested, external synch/control of playback. I've implemented the MIDI_START, MIDI_STOP, MIDI_CONTINUE and MIDI_CLOCK status messages. The MIDI_CLOCK runs at 24ppqn. Since the internal drum machine clock runs at 48ppqn, this proved quite easy to implement :-)

Song mode, performance mode and pattern mode all support external synch. While external synch is enabled, the play, pause and record buttons are disabled.

This was the last major feature to be implemented! What remains is to fix known bugs, add some convenience functions, clean up the UI and start testing the code thoroughly. A fair amount of refactoring has to be done before I'm ready to release the code into the wild. Also, I'm facing a major challenge - I'm 384 bytes short of ram, as I have to add flam to the clip board. The total amount of ram on the MCU is about 3900 bytes, which means that I have to free up 10%... If i can find 256 bytes elsewhere, I guess I could let the sysex buffer double as clipboard, though this means that any loading/saving of memory contents would wipe the clipboard data.

No comments: