Music and electronics.

I think the next piece, suggested by the Evil Mad Scientist himself (whose evil I seriously doubt. he seems quite nice, actually), is a serial listener that runs on a PC. He suggested writing it in Processing, and mailed me a program that works but isn't very flexible. It's a good proof-of-concept, though.

Ideally, it would detect serial ports and display a menu to let the user pick an active serial port. (Right now it's hard-coded.)

It should also let the user pick sounds for slots 1-8. Since they don't have to be copied to an SD card here, they don't need to be renamed. Especially since, if we're on a PC, we have all kinds of memory and CPU to play with and don't need to take the string-crunching shortcuts I took in the MeggySeqListener arduino sketch.

If I get enthusiastic, I could even have it copy the files to an SD card, or to a directory or something, and rename them correctly and stuff. But right off I think the easy playback (for people who have a Meggy and don't have a Wave Shield and so on) would be a big help.

Tonight I fixed it up so that you can hit play and change patterns and the pattern won't change to the one currently displayed until the first finishes playing.

This is important because by dissociating playback from editing, I can build in looping functionality.

The current plan is to let the user pick loops of 1, 2, 4, or 8 patterns. (Or pick 0 to not loop at all.) Then the user can pick a starting pattern (which will adjust itself based on the length of loop. A loop of 4 patterns could start at 1, 2, 3, 4, or 5, but not 6, 7, or 8, and so on).

When the user hits A to start playback, the currently-displayed pattern will play and then if it's part of the loop, playback will continue until the end of the loop is reached and then start over at the beginning of the loop. If the pattern is not part of the loop, that pattern will play and then it will jump to the start of the loop. So if I have a 4-pattern loop starting at 5 and I'm on 1 and hit play, it will play 1 and then 5, 6, 7, 8, and 5 again and so on.

These settings will be saved along with the patterns and tempo to eeprom.

When this part is done, I'll clean up the comments and debug junk and release the source! I suspect swing quantization will take enough time to sort out that I might as well let people play with what's here and not make them wait for me to figure out something complicated that I didn't quite design the thing around.

I have just finished and (more or less) tested pattern copying and clearing and saving to/loading from the EEPROM. It all works, and so does my fairly crude interface. (B+U goes to parameter screens, does not stop playback. B+D goes to load/save page, does stop playback.)

Next up, a couple of variations on looping, probably loops of 1, 2, 4, and 8 patterns, starting at arbitrary patterns (but a loop of 8 will start a 1, and a loop of 4 can't start at anything higher than 5 and so on). This gets tougher, since it will mean a) dissociating what's displayed with what's playing (or making it hard to edit) and b) trying to display more info on the top 8 auxLEDs than you can really easily display on simple LEDs. I'll probably have to resort to blinking, which is kind of inelegant. Unfortunately I'm using all 64 pixels for the pattern display so I can't mess with that part of the screen. The good part is that I made good decisions toward the beginning of writing this thing, so most of this won't be too difficult.

When that's done, I'll post the code for MeggySeq and the listener (that, at least, won't change much if at all) and write up some kind of How-To with pictures and details on the serial cable between the Meggy and the Arduino/Waveshield. Also, I'll list all the things that are wrong with how this thing works and see if somebody else feels like fixing them... 8) (Number one: What I call "BPM" isn't quite the same as the actual beats per minute that play.)

I'll also make sure my code is readable and that there are comments and things pointing out where, if you wanted to make it send MIDI output, you'd do so. I may write up that part myself. even.

I'm also at 8296 bytes used out of about 12k usable on the ATmega chip (after the arduino bootloader and stuff is installed). I may be able to ditch some of what I'm doing with progmem-- if nothing else, removing the #define DEBUG flag will get rid of a bunch of static strings.

I'm really happy with how this is turning out. More photos and detailed movies this weekend.