Coagula MIDI Ribbon Controller 2.0

Coagula MIDI Ribbon Controller 2.0

A few months ago I published a post on how to make a MIDI Ribbon Controller with Arduino. In the meantime I had a few ideas to improve both hardware and software and also felt the need to change many parameters without having to reprogram every time Arduino. Finally I placed the controller in a case, thanks to Laura who built it. So this is version 2.0 of my MIDI Ribbon Controller, which finally becomes a much more practical tool.

UPDATE: For those interested in MIDI ribbon controllers take a look to the  new MIDI Ribbon controller with USB and audio by Eowave. It includes a small theremin type synth,  a CV/Gate controller, a control area for the effects and it's gorgeous. The price is affordable (199 € +vat). So for many the Eowave controller may be a better option.


NOTE: I am not an electronics expert so if you decide to implement this project I am not responsible for any damage to computers, houses, people and animals that may arise . I do not exclude that there are some errors in this article, eventually I will try to correct.

This is the parts list for our Coagula MIDI Ribbon Controller:


This is the schematic:

In the diagram I useed the image of a ptentiometer for the position sensor because I have not found that of the Spectrsymbol SoftPot.

The two sensors are attached to each other, putting the force sensor beneath and the  position sensor above. The pressure sensor is  a few inches longer and you can safely cut off the excess. The force sensor has only two terminals and no polarity so there is no risk of failing, but for the position sensor be very careful: with wrong connections may burn! It happened to me, unfortunately!

Note that you cannot solder the sensor directly but you need to use a connector. I used an half socket for integrated circuit.

I added a  Hitachi HD44780 compatible LCD display and 4 buttons to operate a menu through which you can choose between two different control modes, set different MIDI parameters, and recalibrate the pressure sensor when needed.

These are the functions of the 4 buttons:

  • pin8 = Up
  • pin9 = Down
  • pin10 = Esc
  • pin11 = Enter

 All setup values ​​are stored on the flash memory of Arduino.

Playing Mode 2 is the same as that used in the original version of the controller. Pressing the sensor the controller sends a Note On command and moving your finger sends Control Change command. The note off is sent only when you release the sensor.

In the Playing mode 1 by pressing the sensor sends a Note On command and moving your finger you play other notes, like when you scroll through the keys of a piano.

In both modes are also sent Control Change values  under the pressure applied on the sensor.

Through the menu you can set the number of control change associated with the position sensor (used only for the Playing mode 2), the control change associated with the force sensor, the lowest note and the highest that can be sent, the MIDI channel . You can also launch a   "MIDI Teach mode"  that is used to send some values for the control changes set for the sensors  , using the twobuttons  that are normally used to browse the menu. This  MIDI Teach mode is useful for use in conjunction with the "MIDI Learn" mode that you can find in a lot of music software and hardware modules, in fact, pressing the sensors, it would be impossible to send these control change individually and without also send MIDI Notes.

Finally, by the menu you can also launch the calibration of the force sensor, which anyway is done automatically the first time you start Arduino.

Here you can download the complete code. You also need the library MIDILIBRARY which can be downloaded directly from Sourceforge, and for the  Alexander  Brevig  Menubackend library  download the  1.4 version and modify it slightly by adding, at line 195 of file MenuBackend.h immediately before the line that says "private" this method:
    void toRoot() {
        setCurrent( &getRoot() );
This method is able to return easily to the root of the menu. In the sketch you have to import the
Menubackend library , the Midilibrary and the LiquidCrystal library .

For more details on the management of the menu you can see my other post on how to manage menu with Arduino.

If you build this project or if you modify it I would be happy to see the results.

Here is a short demo of the "MIDI Ribbon Controller".

I used Ableton Live and Reaktor with the Grobian ensemble and the Daft preset. The parameter HTR has been associated with the Control Change fot the force sensor. I tried to get an effect similar to Trent Reznor Swarmatron.



Creative Commons License

Coagula MIDI Ribbon Controller 2.0 by Giuseppe Di Cillo - is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Permissions beyond the scope of this license may be available at


Can you cut the softpot width a bit narrower? The non-active piece of plastic they're mounted in, I mean.
I'm planning to make a guitar synth with many of them but they'd have to be spaced 1cm from each other.

You can try, but I think that the sensor would be more prone to break

Hi, Downloaded your code for version 2 of the midi ribbon controller and followed the instructions given and uploaded to my arduino uno. The menu did show on the lcd and I could navigate the items. For some reasons, the system hangs as the lcd line reads sending data. However, there was no date sent as there was no activity as indicated by the midi sent light on my midi interface. I uploaded the version 1 of the code and it works fine. I need help. Thanks

The code is really memory hungry, so pay attention to use the exact libraries versions that I used! Changing some line of code could result in the same problem.

Just another question.
I am thinking how to assemble it all now for a more permanent construction.
The Force sensor is a bit narrower than the position sensor. When you glue the position sensor on top of the force one, how do you prevent the top one to get "unglued" or to collect lost of dust?
Does the extra width of plastic of the wider top sensor reach the mounting surface ?
The plastic sheet does not feel that flexible and the thickness of the force sensor is not that thin.
Thanks for any comments

In my case, the extra width of plastic of the wider top sensor reach the mounting surface with no problem.

Built it with the Mega board and works very nicely. Thanks so much for sharing your project.
One thing, if you use a LCD, there should be (in the LCD unit) some resistor connected to between pin 1 (ground) and pin 3 (contrast) because if pin 3 is left unconnected like in the diagram above, the LCD (in my case it is a reflective one without back light) would not show any text (I thought I had broken it!). Ideally one small pot would provide contrast control do but for the sake of simplicity I used a fixed value resistor.

Thanks for sharing your ideas. I am considering building one too based on your design.
Just one question. Could you use the force detected by the 2nd ribbon (the one you currenly use for MIDI Control) to ouput the velocity of the MIDI On note? Thanks

I think that's possible but since this kind of controller is best suited to continuos sound I don't think that it would be very useful.

After setting, how do make the menu back to Statues page?
I want to use it in my project!!

Red button.

Hi, when I use the 10k pull-down resistor the softpot behaves exponentially, how can I solve this problem?
thanks :)

Sorry, but I have no answer to this. Maybe one day I'll find the time to work again on this project.

Thanks for posting all of this information. I'm looking at installing a 10 cm midi strip into my guitar.

First off, just wanted to say what an amazing ribbon controller you have put together...I can't wait to to finish putting mine together.

However, I am wondering where you found the buttons. I am wondering if you used 4-pin or 2-pin buttons. Also was wondering if you used veroboard or breadboard for putting everything together (I am brand new to electronics, so every little bit of info would help.). Thank you.

For the buttons I used these but every two pin buttons normally open is suitable. I used a little veroboard to mount the buttons and a proto-shield for the circuit.

Could I plug this into the MIDI in on my MIDI controller and start using it with ableton right away?

It depends by your controller.

Here is a short video of the controller based sculpture at the gallery
As you hear the notes are fired too fast. Is there a way to put a delay in somewhere in the code?

Great installation! I'm working on a new version of the code.

Have you had any chance to get on with the new code. I will be reworking my sculpture for a new show and would love to control the note firing timing.

No, I don't, sorry. But you can try to lower the 1 megaohm resistor with a 10kohm.

Finally built one like this, but there is something wrong with the position sensor, when I don't press it it sends data, when I press it on the side furthest from the connector the sending of data stops, what's up with that? The pin with the arrow goes to 5V right? according to the specs it does. Grateful for any help!

Check the connection of the 1Mohm resistor or try to change it with a 10kohm.

The memory usage still seems high, I can't add anything to the menus at the moment. I will try to free up more memory still.

Yes the memory it's very low. I think that would be a good idea to use an Arduino MEGA: more memory and lot of free pins to add potentiometers and opther sensors.

Thanks Giuseppe!

The 10kohm resistor and connecting the position sensor to a dedicated ground did the trick. The value of the analog input reading was constantly about 20-30 when not touching the sensor. I have made some modifications to the code by the way and added a couple of features.

- I made it possible to have the force sensor send channel aftertouch for all the modes (instead of a control change), it's possible to enable disable this in the menu. My Roland XP-30 uses aftertouch for a lot of patches.

- I added a mode 3 which works about the same as mode 2 only it sends pitch bend instead of a control change. I still need to add a sensitivity setting to the menu, but it works really well.

- Then I added a mode 4 which is a controller mode, this mode doesn't send any noteOn messages, only control change messages (the defined ccs). With this mode you can use the ribbon as a fader, the force sensor works here also.

- Then I made some memory optimizations; I changed a lot of the int variables to byte because the value of those variables are always less or equal to 127, the char-arrays are now as short as possible and no variables are dynamically allocated. (I had to do these changes because when I added a couple of variables the program started acting strangely so I figured the memory was all used, the changes helped.)

- In the loops I added a small 2ms delay. I did this because at least with my setup the midi messages couldn't be processed fast enough so they added up in the message queue or something. When I bounced the midi input in Sonar to my synth, there would be an increasing latency when inside the loop.

- Work in progress: I'm going to add four potentiometers to the available analog inputs to act as additional controllers. I already have this working with one pot.

I will make the code available shortly.

Hi Mark, It has been about 2 years you stated the midi ribbon project and since then made some changes and also with new addition. I attempted to add pitchbend to the code but fail on many attempts, as I am not familiar with code writing. I am interested in your mode 3 in which you added the pitchbend to the position sensor. I am wondering if you could share your code so that I am able to finish my project. Thanks a lot.



Saving memory sounds great, please share it! I am going the hiduino route ( and I will share that eventually.

Thanks so much for this project!


Yeah! That's great work! I would be happy to try it, and I think that a lot of users could benefit from these modifications. Please let the code be available soon :-)

Awesome! Thanks for sharing. If you have a clip please post it.

REALLY SUPER Great Projects I've all ready build Ribbon Controller 1 now I want to make the second one too. Big difference is off course the LCD but I noticed the wiper connection from the position sensors is a little different also the resistor connected is a lot bigger, my question is why?

With the new scheme there is no more need for calibration. The resistor connect the input pin to the ground so there is no "noise" when the finger is not pressing the sensor. It's big just to not discharge the signal to the ground.

Do I understand it right: when softpot (position sensor) is touched it sends minimum noteOn plus CC value? that will determine the actual note played. When I slide my finger just additional CC values will be sent. When I lift my finger All Notes Off will be sent.

There are two playing modes: you described mode 2. In the "Playing mode 1" pressing the position sensor sends a Note On command and moving your finger sends note off and new note on for new position, etc.
In both modes force sensor sends CC messages.

It is rather exiting.
One question though: do we need Force Sensor at all. It seems to have no effect what so ever even when totally removed. Also an observation: you need to have good contacts with SoftPot otherwise you get lots of stray notes.
This ribbon MIDI player will be part of an interactive art object. I am very happy that your project made it so easy for me to get the electronics part of the idea accomplish.
Thank you!
I will post some videos of finished piece when ready.

BTW you may want to correct the description. I am pretty sure that when modifying Menubracket.h at line 195 the following word is ”private” not ”protected”. That was a bit confusing for me. And I learned that all ”spaces” and ”tabs” seem to be important.

The force sensor is optional but it could add interesting effect. In the video I made an exagerated tremolo just to show the possibilities. To avoid "stray notes" I added few milliseconds delay in the code.
And....You're right! I fixed the "protected" error. Thank you very much.

I studied the code a bit and looked what messages were sent on my mac with MIDI Monitor. Could you explain the idea behind the MIDI messages.
SoftPot seems to send NoteOn when touched and CC after that until released then NoteOff.
What the Force Sensor sends? It seems to be Control Change at 21/0-127, where first bite is set by setup and second bite reacts to the sensor. My obstacle to use this is in the hardware I have. Namely old MIDI sound modules like Roland CM-32L and Korg AG10. These have no controls but were designed to use with host computer (ATARI). So I have no idea how to get anything out of Force Sensor with these.
If I could make force sensor to output Pitch Bend instead the hardware could read this no problem. But my code writing is very poor.

Yes. Position sensor sends the note on/off messages while the force sensor send CC messages that you can select in setup menu. The pitch bend mode is on schedule but actually I'm busy with a lot of other things.

I tried it from the start. I did it step by step carefully. This time your code compiles OK. So there was something I did not do right when adding
void toRoot() {
setCurrent( &getRoot() );

Now I will assemble the hardware again and see if I can get it to work. Thanks!

Good! :-)

As you can tell i am not very good at programming. I can copy/paste only and I understand very little aside of step by step instructions.
So here it is how I modified Menubracket.h
void use(char shortkey)

void use() {
if (cb_menuUse) {
MenuUseEvent mue = { *current };
void toRoot() {
setCurrent( &getRoot() );
void setCurrent( MenuItem *next ) {
if (next) {
if (cb_menuChange) {
MenuChangeEvent mce = { *current, *next };
current = next;
void foundShortkeyItem(MenuItem *mi) {
current = mi;
char canSearch(const char shortkey, MenuItem *m) {
if (m==0) { return 0; }
else {
if (m->getShortkey()==shortkey) {
return 1;
return -1;

I try this code, but get just many errors with ”toRoot”.
First I modified MenuBackend.h with
void toRoot() {
setCurrent( &getRoot() );
on line 195 before word ”private”, but get errors when trying to compile in
'class MenuBackend' has no member named 'toRoot'
Also I get the same when modifying before the word ”protected” on line 104

Could you please post the code snippet around your toRoot method?

Hey Great project! I wonder if you wouldn't mind posting a high res shot of your finished circuit board. Thanks! :)

Thanks! Soon I'll post the shield based on the official Arduino proto shield.

is it possible to make it work connected by USB, not MIDI? and to make it consume power from USB, not from additional adaptor.

I haven't tried. You need to reprogram the Arduino communication chip (atmega8u2). Those articles could be useful: (a new "MIDI" firmware for the chip) (how to update the atmega8u2 firmware)
I think that soon or later I'll try this.

I am taking this project down the HIDUINO road. I'll let you know how it works out...

The flashing of the 82u was easy and it turns up fine in the midi environment so I don't think it will be very difficult to "port" you code.

very new to arduino, or any programming for that matter :)
i get errors when compiling, i have all the libraries in correct folders.
this is the first error, the rest are similar:

MIDI\MIDI.cpp.o: In function `MIDI_Class': D:\arduino-0022\libraries\MIDI/MIDI.cpp:22: multiple definition of `MIDI_Class::MIDI_Class()'
MIDI.cpp.o:C:\Users\-\AppData\Local\Temp\build6691747836870116771.tmp/MIDI.cpp:34: first defined here

and I too have a 16x2 LCD... what am I looking to edit in the code?

any help is much appreciated!

Try creating a new project and copy again the code. I had a similar problem and this fixed, I don't know why. For the 16x2 lcd I hope that someone else that implemented could post a link here.

I modified the code for 16x2 LCD, but I haven't been able to test it (I haven't yet assembled my hardware). If anybody is willing to try it out, you can find it here:

Thanks Mick! Great work! If someone test the code please let us know.

I am interested about this to work because I like the smaller LCD for my project. Unfortunately I get nothing on the display.

Did you get the modified code for the smaller LCD to work?

I tried it with smaller LCD wired the same way as 24x4. Code compiles fine, but on the display I get no text. However LCD lights up fine.

After some advise I have to say that removing spaces have no effect obviously. But most definitely you need to control contrast with these 16x2 LCDs. When pin#3 is not connected to GND you get nothing on the display.

Nice to hear that my modified is working :), I was unable to test it when I modified the code.

One more important note.
You may need to have a pot wired for contrast with LCD16x2. Mine shows nothing when used without - like 0 contrast. Or connect pin #3(contrast) to GND to have max contrast.

You're right. The schematics is right but in the connection diagram the link between lcd pin 3 and GND is missing. I'll fix it soon. Thanks.

It nagged me that I was not able to get it to work. So tried with LiquidChristal examples and these did not work as well. After careful rewiring still the same.
Finally when I typed in pin numbers LiquidCrystal lcd(); I did it without spaces like this LiquidCrystal lcd(2,3,4,5,6,7); and now it does work. When I copy and paste the code it has spaces and thus will not work. Actually the same goes for all examples in ArduinoIO as well.
But the code for 24x4 LCD works with Copy/Paste.

I haven't tried yet.

I have a spare 2X16 display lying around, but really don't know any code yet, could you show me where to modify to use this display?

You need to edit the menuChanged method and you must check every part opf the code where is present an "lcd.print" statement. But I strongly suggest to buy a cheap 20x4 lcd display from Ebay.

Post new comment

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.