CSQ-100-style Arduino sequencer, part 2
I’ve been working on my silly cardboard-faced Arduino CV/gate sequencer thing. My previous post (Beginning CV/gate sequencing with the Arduino) outlined the idea, here’s my criteria:
- it should work like the Roland CSQ-100 (or SH-101) step sequencer
- sequence hz/v or 1v/oct synths
- allow the user to change patterns and record/edit sequences while it plays (like the TR-606)
- should be tighter than your sister
Here’s a video of where I’ve got to, with lots of annotations to explain what on earth these unlabelled buttons do.
It’s now based on an Arduino Mega, mostly because I was always on the edge of running out of pins. I got fed up with having to wire up shift registers for the buttons. And then I got fed up with having to wire buttons, so having been obsessed with the idea of the Roland MC-4, I added a numeric keypad. (Eventually it’ll be able to email as well, right?). It’s handy having the seemingly endless 128KB of program memory, I was bumping up against the Atmega168 memory limit of 16KB on a previous project.
I wanted lots of LED displays, mostly because I was trying to ape the MC-4’s measure, step, and data display – so the previous version had three of them (demo video here). But carelessly I killed one of them, and then realised they were expensive for the amount of information they display. Instead I got hold of a suitably retro Samsung 20T202DA2JA vacuum fluorescent display (datasheet), which is lovely. Here’s my first childish first fiddle with it:
I’m using Ladyada’s SPI_VFD library to talk to it, which works really well.
This time, rather than just storing voltages (read in by the onboard 10-bit ADC), I’m using a lookup table to store a key number based on the input voltage from the synth keyboard. This saves a bit of EEPROM space, but it also means I can allow for transposing the sequence from the connected keyboard, which is a replication of the KCV Add feature on the CSQ-100.
On playback, the program uses another lookup table to convert the note number to a number between 0 and 2048, corresponding to 0 and 5v. I’ve fiddled around with these numbers to get them as close to the note frequencies as possible. I’d use a different lookup table for v/oct and hz/v synths – this has a nice side effect in that I could have a hz/v keyboard controlling a 1v/oct synth. Also I could use further custom lookup tables for synths that are scaled differently, so it could be handy for controlling my cv/gate modded SH-1000 that runs closer to 1.3v/oct.
Because it can only output a maximum of 5v (using a very cheap Microchip MCP4922 dual DAC, following along with Mr Book’s post Controlling a Gakken SX-150 synth with Arduino), this means I’m getting just over 2 octaves on the MS20, but should be over 4 on anything 1v/oct. Before I added the slide circuit, I was getting better than +/- 2 cents across the range on the MS, which is acceptable to me.
Currently each (max 32 step) pattern uses a byte each for note number, gate length, aux control voltage, and switches, which are currently rest, tied note, and slide. I’ve had another trigger output (called MPX on the MC-4) working as well, which worked well for switching in LFO modulation for certain notes on the MS20.
Each pattern uses 129 bytes of storage space – 128 bytes for the pattern itself and one for the length. On my previous attempt I was storing patterns in the Arduino internal flash, but on this version I’ve moved to an external 512 kilobit (64 kilobyte) 24LC512 EEPROM, following Cutedigi’s tutorial. Writing a 128 byte page is slow, taking at least 5ms, so to avoid interrupting the playback, saving and loading is scheduled for directly after a note trigger. This currently has the side effect that it has to be playing to save something, which isn’t so good. As far as possible I also update the screen directly after a note trigger, although it may not such an issue with the SPI VFD display as with the slower Sparkfun LED displays. Here’s one that I’m currently using for the step display, glowing ultrabrightly:
Because it’s so much fun to play with, it’s easy enough just to sit there twiddling with it and not actually getting it finished. It seems to spit out little melodies that I wouldn’t naturally come up with sitting at the keyboard.
In particular, the transpose function is a lot of fun. When it can’t transpose the note any higher because of the limitation on the maximum voltage output by the DAC, the software forces it to wrap round underneath; so rather than a F4 which it can’t reach, it (should) play an F0, which makes for some unexpected but pleasantly varied lines.
Here’s a quick demo of the transpose function from the MS20 perspective; I’d already recorded a short sequence:
I’m finding designing the physical user interface design fascinating, and difficult. I always wanted synths and sequencers with a knob or button per function, but now I come to designing my own instrument, I can easily see why the 80s thing was to sling in a screen and an alpha dial. And like I say, it’s a pain to wire up the buttons. There’s also a temptation just to keep adding features ad infinitum. Currently I’m giving in to it, although I’ll need to make decisions if I’m ever going to get it boxed up.
I’ve been looking at the Mutable Instruments Shruthi-1 for inspiration for a box, particularly Hannes Pasqualini’s Shruti-1, which looks really good. Slowly getting there… will get it done eventually.