Beginning CV/gate sequencing with the Arduino

Csqarduino_-_even_more_wires

I’ve been threatening to do this for ages, and since I gave up fixing my other CSQ-100 (after having got a blast of 240v up my arm), I’ve been having a go at creating a CV/gate sequencer with one of my Arduino boards.

The idea is to replicate what I most like about of the ancient Roland CSQ-100 sequencer – in that you can attach a CV/gate keyboard, play notes into it, and then it plays them out again when sent a trigger from an external source. It’s pretty much the same idea as the internal SH-101 and Pro-One sequencers. The CSQ-100 also does real-time recording, but I’ve never had much success with that. This is the one that works, plugged into an SH-5.

Csq-100

In my implementation, the synth (a slightly noisy MS20, in this case) CV and gate outs plug into analogue ins on the Arduino. When the Arduino boots up, it’s in record mode. Every time a key is pressed on the keyboard, the gate in goes low – the MS20 using a short trigger – and it takes a sample of the CV and stores it in an array. I’m averaging the voltage sampled over a few milliseconds, just in case. I’m also throwing away the first couple of results, because in the way I’ve got it set up, the analogue-to-digital converter seems to take a few goes to settle. This bit took a lot of swearing.

I can keep plugging away on the keyboard until it reaches my arbitrary limit of 32 steps.

When a switch is switched, it goes into play mode, and waits for a trigger, in this case from a TR-606 drum machine. The high tom trigger out from the 606 is wired to analogue in 0 configured as a digital in. When a trigger is received, an interrupt is generated, and on the next loop(), the Arduino sends a note voltage to the MS20 via a MCP4922 dual 12-bit DAC – I had some of these around after trying Mrbook’s MIDI Gakken SX-150 – and also a gate via a digital out.

So skip-to-the-end, here’s the MS20 (with a bit of noisy spring reverb and BBD delay) being sequenced by the Arduino – tuning is probably way off…

You can hear the filter being modulated in a regular way too – I added a pot on one of the analogue ins and used that to store another CV along with note CV.

While I was at it, I also wired in a pot for note length, and a switch for legato – here’s a demo of the legato feature:

Hoohah. The great thing is that it’s so much fun to play with – I can stab in a bunch of keys at vaguely random and something interesting usually pops out, it’s a happy-accident generating machine. (Except when I put a video camera on it, of course). Even if it’s not quite right, I can use the triggers on the 606 to rearrange the rhythm of the pattern. The nice thing about it too is that it naturally works with 1v/oct and hz/v control voltages because it’s not translating the voltage into a note value, as the CSQ-100 does, but this has the downsides of not allowing for transposing the pattern from an external keyboard and there being more information to store.

Since all then, it’s got rather worse/better:

Iphoto

I’ve haphazardly added more wires to it in an attempt to make it look really very technical – including an LED display for that definite you-won’t-get-me-through-Customs look, and single LEDs for play and record mode and the first beat of a bar. It also does pattern rotate, something I loved from the x0xb0x SokkOS. With a bit of fiddling I set up a toggle for the edit mode, flipping between insert, append and overwrite – the latter of which is great fun when it’s running, being able to play in notes and have them appear straightaway in a fixed length sequence.

Also I’ve bunged in a simple one pattern storage facility. I’m using the Atmega328 version of the Arduino, which means a massive 1k of built-in EEPROM storage. The slightly inefficient way I’m storing data only gives me the possibility of only storing 5 x 32-step patterns across power down. I could use an external EEPROM but I’m virtually out of pins – possibly with a bit of re-arranging I might just be able to. External EEPROM or not, this is still one pattern better than the -100s bigger brother, the CSQ-600. (Speaking of which, there’s a CSQ-600 on Ebay currently at – yelp – £230..)

I’ve not sorted the pattern change process yet, which is an interesting user interface problem in itself – I like the pattern chain facility on the x0xb0x, but it means lots more buttons. Which means even more wires.

Here’s a video demo of the thing in action.

I record four notes into it at the beginning, then kick it off. In the first bit I switch the pattern into reverse, and use the pattern rotate to alter the start point. Then I start recording notes into it as it plays – it stutters slightly – and use a switch to record a note with legato, which sounds pretty close to a slide, although it shouldn’t be. Also I’m recording control voltages for the filter by twiddling that silver knob as I record – should hear the effect of the VCF being modulated at about 2:15. And the bloody makeshift facepanel really wants to fall on the floor. At 2m22 it goes all farty ‘cos I load a saved pattern with a much lower filter setting.

There are a couple of problems – the gate output is only 5v, so I doubt it’ll trigger ancient Roland gear like the SH-5 and System 100 which need at least 10v, although I’ve had it triggering an SH-09 happily. I guess I could build a simple x2 amplifier circuit to boost it for those synths if it doesn’t work.

Because the CV range is only 0-5v, I’m rather limited when it comes to Hz/V synths, where the v oltage required for each further octave doubles. I get just over 2 octaves with my MS20 before it tops out at 5v. I could try halving the voltage before the ADC input and then doubling after the DAC output, but I think I’ll just be magnifying inaccuracies in my cheap DAC, which after I read Paul Schreiber’s DAC FAQ, now think probably isn’t worth it. I’ve not checked the tuning, I expect it’ll be out – a lookup table of voltages for notes could help here.

One thing I was pleased with – once I’d taken out a few errant delay() statements, timing seems ok – here’s a picture of the TR-606 trigger pulse at the top (which is 20ms long) and a click from my SH-101 at the bottom, envelope set to fastest possible attack and minimum everything else.

20100914-e7ice3785b6uamsbjuxnu

…so I’ve cleverly missed out the scale on this, but it’s not bad. Having said that, for some reason the MS20 always wants to trigger 7ms late, which has been driving me round the bend, but I’m guessing it’s something to do with the state of the trigger out. Here’s a picture of the timing problem – MS20 is on top, 606 hat on the bottom.

20100914-dk1ygf91w6ddeaag5nf14

Given that the SH-101 triggers so well from positive gate voltages, it might be worth leaving the gate out as a positive voltage gate and convert to a short trigger by using an NPN transistor, as outlined over at Doepfer. Seems a bit of a shame though.

At some stage I need to nail it down before it takes over my room. I’d really like to add extra trigger outs per note like on the Roland MC-4, a button for randomising the order of the entered notes, loading and saving to multiple patterns, pattern chaining, and DIN sync in as well as the existing trigger in. I’ve been trying to breadboard a 303-style glide but not had too much success so far – shame ‘cos I love that slide.

It’s really a testament to the design and community behind the Arduino that an electronics newbie like me can pick it up, and over a few weeks, build something really useful. Once the Arduino sketch is in some sort of usable state I’ll bung it up on Github or something.

6 comments

  1. 12th April 2011Blair says:

    Your MS-20 is triggering late because it expects a negative-going gate/trigger (off is high, usually around 5-10V, on is usually 0V). I guess what is happening is once the trigger drops past a certain voltage your MS-20 decides that’s good enough 🙂 Do a search on "V-Trig to S-Trig converter" and you will find some info on how to get around it… note that Moog and Yamaha synths also used this standard.Were you aware the MS-20 uses Hz/V CV standard rather than V/Oct? It’s exponential rather than linear. With V/Oct, 1V generally = 1octave, with Hz/V, the voltage to reach each higher octave doubles (usually up to about 8V).

  2. 13th April 2011ua726 says:

    Thanks Blair. My code running on the Arduino has a internal switch for the polarity of the gate output, so with the MS20 I’m using high (5v) for off and 0v for on, which as it expects, so I’m still not clear why it should have been so late. I should do some testing with a Kenton Pro-Solo attached to the MS20 to see if it’s similarly affected.Dunno if it’s clear from the piece above, but the sequencer is pretty much a dumb CV recorder, so it doesn’t really care whether the input/output is Hz/V or 1v/oct. It’d be nice to make it aware of which notes were being input, could have all sorts of fun with that.

  3. 19th April 2011Blair says:

    <p>Hi</p> <p>&nbsp;</p> <p>I didn’t quite read all of your blog entry the first time so I missed the fact you were aware of the Hz/V</p> <p>issue, sorry!&nbsp; I have been playing around with Silent Way (its software to allow a DC-capable soundcard to control</p> <p>synths directly via CV-Gate) &amp; trying to get a bit more range out of my MS-20, and your project came up in a</p> <p>search result. To get the range I wanted I realised I would have to get up to almost 16V, which is down to the</p> <p>fact the voltage doubles every octave :(&nbsp; I’m still planning on building a V/Oct -&gt; Hz/V converter so I can interface</p> <p>my "normal" CV/Gear to it…</p> <p>&nbsp;</p> <p>Anyway, I just think the whole idea of a dedicated CV/Gate sequencer is pretty darn cool, much tighter timing</p> <p>than a MIDI converter, so good luck to you, hope it all comes together.&nbsp; If I had more time I would get into</p> <p>a bit of Arduino hacking myself!</p> <p>&nbsp;</p> <p>Cheers</p> <p>Blair</p>

  4. 19th April 2011ua726 says:

    Cheers BlairYep, time is the enemy 🙂 There’s that trick for inputting 1v/oct cv into the TOTAL jack on the MS20, dunno if you’ve seen that, about 2/3 of the way down this:http://www.korganalogue.net/korgms/mstt.htmlOtherwise have a look at the Kenton board for 1v/oct to hz/v conversion – it was originally designed to go in their Pro-2 MIDI-CV box, but it apparently it can be DIYed to go outside with the right power supply. Exchange rate might not be kind to you though, depending on where you are…http://www.kentonuk.com/products/items/projects/cvhz.shtmlI love the idea of making my own modern CV/gate sequencer, tailored to the sort of results I want to get. The Arduino is such a great way into all this. Such fun, I recommend. And I really like the physical aspect of it, it’s a good change from looking at the computer all day.

  5. 13th November 2013bank says:

    hi. could you help me with a simple circuit? i need to take my analogue synth control voltage and send it into an arduino duo’s adc input. typically i send 0-5v or 0-10v from my synth. but the arduino wants only 3.3v? do you have a schematic that will limit and protect my cv down? or any other ideas? thanks a lot!

  6. 14th November 2013ua726 says:

    I think at the time I only used a voltage divider to take 0-10v down to 0-5v, but now I’d also add a voltage clamp using a pair of diodes after that (search for voltage clamp on http://www.doepfer.de/DIY/a100_diy.htm for a diagram) and maybe a simple opamp voltage buffer after the diodes, and then into the adc input.

    Probably would be ok with just the voltage divider and the clamp.

Write a comment: