Wednesday, April 6, 2016

DIY Ribbon Controller - CV

In sharing my work on a MIDI-enabled ribbon controller, a couple of the good folks at Muff Wiggler wanted more.  They wanted to see a CV-enabled ribbon.  So, as I'm always ready for more hacking, today I present for your enjoyment: my home-brew CV ribbon controller.


Switching from MIDI to CV:  This CV-enabled ribbon builds directly upon my MIDI ribbon.  It uses literally the same ribbon, which I built (like everyone) using a $20 soft-pot sensor.  Like my MIDI ribbon, This CV ribbon also uses an Arduino to sense ribbon and to generate the commands for the synth.  The main thing that is different with the CV ribbon is that I needed to add a digital-to-analog converter (DAC) to generate the CV signals that'll drive my old synths.

The only difference between the MIDI ribbon and the CV ribbon is how the Arduino outputs its commands.  The MIDI ribbon uses an Arduino "MIDI Shield" to send the MIDI messages whereas the CV Ribbon uses a DAC to generate the CV voltages.

Using a DAC:  A DAC is a device for generating arbitrary analog voltage signals.  You send it commands (such from an Arduino) and its output jumps to the voltage level that you desire.  They're very handy devices for synth hacking.  My experience is with the MCP4922, which is a 2-output, 12-bit DAC.  After refreshing my memory using its datasheet, I decided to wire the DAC to the Arduino as shown in the schematic.

The ribbon (left)  is wired to the Arduino (left-center).  The Arduino is wired to the DAC (right-center).  The DAC is wired to the CV outputs (right).  Easy.

Wiring the DAC:  From this schematic, I used a solderless breadboard to wire up my DAC.  I chose to use an Arduino Micro because it easily fits into the breadboard (unlike an Arduino Uno).  Wiriting software for the Micro is the same as for the Uno, so it's a trivial swap.  The wiring diagram below (go Fritzing!) shows my plan for wiring the DAC to the Arduino.  I added the headphone jacks to make it easy to get the signal in from the ribbon and to get the CV signals out to the synth.  For breadboarding, I like using this jack with this breakout from Sparkfun.

My wiring plan for the Arduino Micro and the MCP4922 DAC.  Power is supplied from USB connection to the Arduino.

Real-World Wiring:  Of course, once real wires are involved, it never looks as pretty as the plan.  The picture below shows my actual breadboard with its actual wires.  All the connections are the same, but the routing is different.  Also, I moved where I put the headphone jacks: the ribbon input is the one on the bottom right and the two output jacks are dangling off the back (one is black, the other beige).  Note my use of the blue rubber band to keep the output jacks somewhat contained.

The real-world wiring is never as nice as the plan.

Pitch and Trigger CV Signals:  For this hack, I'm generating three signals to control my synth: a pitch CV, a trigger (a.k.a. gate) signal, and a filter CV.  The pitch CV controls the pitch of the synth.  It's a signal that can take any value between zero volts (a low pitched signal) and 5V (a high pitched signal).  The trigger signal, by contrast, is simply low (0V) or high (5V).  It tells the synth whether the note is "on" or "off".  Since it is just a LOW/HIGH signal, it is generated by one of the Arduino's digital pins, not the DAC.

Filter CV:  The last signal that the system generates -- the filter CV -- controls the cutoff frequency of the filter.  Like the pitch CV, it can be any value between 0-5V, and so I use the 2nd channel of the DAC to generate it.  I added this capability to the system (like I did with the MIDI version) so that the filter opens up a bit as you play higher notes.  This is the same kind of interaction you'd get with the keyboard if you had the "keyboard tracking" turned up about half-way.  Adding this behavior made the ribbon feel more natural and more engaging.

In response to the ribbon, the Arduino+DAC generates three signals: pitch CV, trigger CV, and filter. CV 

Arduino Software:  With the hardware assembled, and with my CV signals decided, I wrote the software for the Arduino.  I reused my software for the MIDI ribbon and simply added the functions to drive the MCP4922 DAC.  My code is available on my GitHub here.  Having both the MIDI and CV functionality in one program makes it more complicated to read, but it gets the job done.

The Korg Mono/Poly has good flexibility for interfacing to external gear.  Here, my circuit is creating CV signals that I'm injecting to control the filter cutoff ("VCF fcM IN", on the left), to control the gating of the note ("TRIG IN"), and to control the pitch of the note ("CV IN").

Putting it All Together:  With the software written, and with the CV signals injected into the correct locations on the back of the synth (see pic above), I was ready to get to the business of playing.  Of course, it didn't work the first time,but after some debugging (should the Trigger signal be set high or low on the Mono/Poly?), I got it to work pretty well.  Interestingly, I found myself playing the ribbon differently when attached to my Mono/Poly than when it was connected to my Prophet 6.  I think that it had something to do with the CV vs MIDI.  MIDI is designed for discrete pitch instruments (like keyboards).  I feel that the continuous pitch of a ribbon is just better suited to CV.

My old Mono/Poly, with the magnet-backed ribbon just above the keybed, and with my magnet-backed breadboard controller in the upper-left.

Next Steps:  Now that I have a DAC working, it opens all sorts of possibilities.  A DAC could be used to generate audio signals directly, not just CV signals.  By directly synthesizing its own audio, I could make the ribbon a stand-alone instrument.  Yes, using these electronics to create a wavetable ribbon synth could very, very interesting.

23 comments:

  1. Kickstarter? I'd go for a few of these....

    ReplyDelete
    Replies
    1. Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download Now

      >>>>> Download Full

      Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download LINK

      >>>>> Download Now

      Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download Full

      >>>>> Download LINK 82

      Delete
  2. Good evening, please can I have your email address? Mine is extremdinghy@gmail.com Thank you for your time.

    ReplyDelete
  3. i want to add ribbon controller with modulation + pitch for my yamaha psr e 423???? is it possible???? if possible how, please describe me the detail process am worst in electronics and i don't wanna ruin my keyboard

    ReplyDelete
  4. Hello, I am slightly confused by the ribbon connection and code.
    I bought a couple arduino Pro Micros to do this with.
    But your schematic uses only two pins of the 3 on the rippon, doesnt say which it does use, but the code referenes 3 connections on the ribbon?
    Also the Pro Micro doesnt have the A5 connection, so is it as simple as changing any reference to A5 in the code to A6? (How many relevant references is there? I think I saw you on FB synth DIY so we could take it over there where I can post up the stripboard Ive used as well ;)

    ReplyDelete
    Replies
    1. So this question is two years old and this blog is two years inactive but... having been confused by the same thing myself and having, I think, figured it out, I thought I'd post what I think is the answer. You normally could read a potentiometer by putting 5V across it and connecting the wiper to an analog input pin. This is a voltage divider with the two resistances being the two ends of the pot. Then you'd get a voltage hopefully linear in position from near 0 at one end to near +5 at the other end, which is good. However: with the Softpot, unlike a normal pot, when you remove contact the wiper disconnects and is floating. Then you'd get ill defined behavior at the input pin. The solution is to enable the input's internal pullup resistor and not connect +5V to the Softpot. Now you have a voltage divider where the two resistances are the pullup resistor and one end of the Softpot, and if the wiper is disconnected then the voltage at the input pin gets pulled up to +5V. Otherwise it ranges from near zero to something depending on the full resistance of the Softpot (10k) and the pullup resistor (typically 20k to 50k), maybe 1 to 2 volts. Which makes it easy to tell when the gate should be on or off but gives you a rather small voltage range which the Arduino needs to scale up to 0 to 5V. But at least it's well behaved when the wiper's disconnected. Anyway I think this is right!

      Delete
    2. Yeah, you got it. The softpot's "wiper" is floating when you are not touching the pot. So, yes, you the the pull-up. As a result, when you are NOT touching it, the indicated voltage is up at 5v, which is easily detected, and which tells you to turn off the note.

      Chip

      Delete
  5. Catching up with your adventures. Kudos on all the new work on the Polysix, it makes me want to get a Fatar, more Arduinos (I have a few which just arrived) and re-do all the work you did on mine. But first, I need to troubleshoot the KLM-367 board again (sigh).

    Let's go!

    Yash

    ReplyDelete
  6. Hey Chip; I'm a musician, but I know next to nothing about electrical engineering or programming. However, I don't really need a Midi capable controller; could I build a CV ribbon controller by simply soldering a soft-pot to a TRS connector? It feels too simple to me, but I've spent the last few hours trying to figure this out online and by dismantling a few expression pedals and the barrier of a lack of basic electrical knowledge is getting in the way.

    ReplyDelete
    Replies
    1. I'm in exactly the same boat and would love to know this (I have the impression the answer is "yes" but would love confirmation)

      Delete
    2. I think what you're asking for is an all-analog ribbon. You can certainly wire the ribbon to the TRS connector, but you need something to apply a voltage across the ribbon via the TRS connector (say +5V to one end of the ribbon and ground to the other end of the ribbon). When you do that, you will certainly get a voltage out of the ribbon that is related to where you've touched the ribbon. Maybe that's all that your looking for, which would be cool.

      While that setup is a lot simpler than mine (yours has no software), you also would get no gate signal to tell your CV synth that you're touching the synth. In your case, once you stopped touching the ribbon, the voltage being output by your device would be poorly defined and would wander about (unless you also attached a pull-up or pull-down resistor, which is what I'd recommend).

      The ribbon is also not as linear as you might like, meaning it's tough to play the exact pitch that you want. Using the Arduino lets you figure out a calibration so that the response is nice and linear with position.

      Don't let my arguments *for* including the Arduino sway you, though. If you're not into Arduino, then you should hack using whatever tools that you do know how to use. Just go for it! Smell the solder!

      Chip

      Delete
    3. Thanks for your response, Chip! My interest in the Softpot would be as a controller mounted on the face of a midi-enabled bass guitar. The pitch tracking is great for that, it's an old Peavey Midibase which I use to trigger a Moog Minitau, but reaching for the knobs of the minitaur is awkward while playing so I came up with the idea of directly manipulating CV via softpots mounted under my thumb. The CV on the Moog is self powered, is it not?

      Delete
    4. Heya Jon - I found something called the Synthrotek Riblet that might make experimentation easier for folks in our slightly more tech-challenged state :) : http://store.synthrotek.com/Riblet-DIY-Kit_p_721.html

      Delete
    5. Thanks Chip and Kerryg! I think I'll try Synthrotek's kits, and if I just can't get a linear enough response I'll get some help with the Arduino.

      Delete
  7. Hi Chip: I'm really new to this stuff. I have a few questions . . .

    1) There seems to be several variants of the MCP4922 (E/P, E/SL, etc.). Which version should I get.

    2) Do you have a suggested source on the capacitors?

    3) Do you have a suggested source on the Stackable headers for the Arduino Micro?

    4) In photo 4 there's a blue resistor that I don't see in the wiring diagram. What is it?

    My Best:

    Jim

    ReplyDelete
  8. It's a pity those soft-pots are somewhat pricey. Are there any DIY options to create reliable soft-pot ribbon?

    ReplyDelete
    Replies
    1. There's an article here talking about making a ribbon from anti-static bag material

      https://www.paia.com/ProdArticles/dual-ribbon-howto.htm

      and I've seen something somewhere about using videotape for the purpose as well. But I paid the $20 for a SoftPot and consider it money well spent... aside from my not having a stash of anti-static bags or videotapes to raid, I have a lot more confidence in the reliability and durability of the SoftPot.

      Delete
  9. Thanks for these blog posts! I just finished building one for my Mother-32. I made a few minor tweaks to the code and mounted the SoftPot a little differently but that's it. Works great!

    ReplyDelete
  10. Is it possible/practical to put MIDI and CV capability into a single ribbon? Can the Arduino handle it? If so, do you have any tips on how to do this?

    ReplyDelete
  11. On my arduino and scope I see noise on my analog input when I press the SoftPot. I have set it up like a voltage divider with the wiper into the A0

    I've tried INPUT_PULLUP and INPUT and I'm still getting noise on top of the signal. Any suggestions for solving this?

    ReplyDelete
    Replies
    1. Presuming that you have the bottom of the SoftPot to ground, the question is whether you have the top of the SoftPot to fixed voltage (like 3.3V or like 5V) or whether you have it floating. If you connected it to a fixed voltage, then you should have the wiper's pin set simply to INPUT. Or, if the top of the pot is floating, you would set the wiper's pin to INPUT_PULLUP.

      As for the noise, you will likely want to add some averaging via your Arduino sketch. For example, can set up a running average where you do something like:

      float myRunningAverage = 0.0; //a global variable
      float weighting_new = 0.5; //how strongly to use the new data [0.0->1.0]

      float myReadFunction(void) {
      float new_value = (float)analogread(A0);
      myRunningAverage = (weighting_new)*new_value + (1.0f-weighting_new)*myRunningAverage;

      return myRunningAverage;
      }

      This style of running average is also knows as a 1st-order lowpass IIR filter. To do less smoothing, make "weighting_new" be larger. To do more smoothing, make "weighting_new" be smaller.

      Chip

      Delete
  12. This comment has been removed by a blog administrator.

    ReplyDelete
  13. Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download Now

    >>>>> Download Full

    Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download LINK

    >>>>> Download Now

    Synth Hacker: Diy Ribbon Controller - Cv >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete