Ribbon controller DIY (VHS...)

You did say you’re getting gate outputs, right? If you’re getting gate outputs when you touch the ribbon then that means you’re getting signals into the Arduino. Just not making it out.

There are some diagnostic print statements in the code if you enable them. You know how to look at messages on the serial monitor? You can change the 0 to a 1 in any or all of these lines

#define PRINT_TEXT (0)
#define PRINT_BEND_TEXT (0)
#define PRINT_CAL_TEXT (0)
#define PRINT_RAW_RIBBON_VALUE (0)
#define PRINT_CV_TEXT (0)

to see some messages. PRINT_RAW_RIBBON_VALUE will make it print what it reads from the ribbon. You need this information anyway to set some of the values in the code to match your ribbon for proper calibration. PRINT_CAL_TEXT also prints the ribbon value and the note number it calculates from that. PRINT_TEXT also prints the ribbon value and some other stuff but only if it sees a change in the note. PRINT_BEND_TEXT is only useful for a MIDI version. PRINT_CV_TEXT tells you what it’s about to write to the DAC just before it does — that might be very useful for you, to confirm whether the software is indeed writing good stuff, or indeed anything at all, to the DAC. Again, if you’re getting gate outputs, that means it’s making it to that bit of code, so you definitely ought to get these messages if enabled.

Don’t forget to turn prints back off once things are working, or it’ll slow the software down too much for normal use.

2 Likes

thx all

it was without touching the ribbon, just 5V on the D5 wire, now i have zero beacause i inverted ON & OFF on the code, but the ribbon make nothing on the gate out.

my ribbon with A5 act between 2,…V & 4.80V if i test with the multimeter

no and i don’t know what is it, I begin to tell myself that my initial idea with a ribbon and a 9V battery would have been easier …

Well, it depends on your platform and which IDE you use, but for instance Tools menu, Serial monitor choice. It’ll bring up a window in which messages the script sends via Serial.print() occur. You probably need to change

Serial.begin(115200*2);  //for Arduino Micro only

to

Serial.begin(9600);

Then I’d start by changing the 0 next to PRINT_RAW_RIBBON_VALUE to 1. Then it should start printing the value it’s reading from the ribbon. If that looks OK I’d enable PRINT_CV_TEXT which should print values it’s sending to the DAC. If it doesn’t, maybe simplify your life by using the first sketch @sebastian included above as a really simple way to check if it’s reading the ribbon. That also requires opening the Serial Monitor window.

You’ll get there!

1 Like

Thank you for these explanations, now it seems clearer to me.

almost :slight_smile:

I try to test the ribbon with the @sebastian code and the serial monitor.

i must have to touch the ribbon for the test ?
i have this without touching it :

Sans titre

Yes, you should touch the ribbon and the resulting voltage the arduino “sees” and prints out should be change when you slide your finger over the ribbon. They should be ~0 with the finger on one end of the ribbon and ~5 on the other end. It should be roughly the same as what you get when you measure voltage with a multimeter at the ribbon pin. The arduino sketch is basically a multimeter that only measures between 0 and 5V on the pin. :slight_smile:

1 Like

it’s don’t work, i test also with a pot instead of the ribbon and nothing too.

You connected the pot like this and it does not work? That’s strange!

with the ribbon i don’t make this, i connect A5 on “wipper”(velostat) and the oser connection from my ribbon (copper) to GND, no +5V

i have only 2 connections on my ribbon because the Audette code use a internal pull up resistor
so i can’t test it with this code ?

The pull-up is on the “wiper”…
So you need to connect the other end of the ribbon to 5V.

? on the Audette code we can read this (2 connections A5 and GND)

Physical Setup, Ribbon:
Top of Soft Pot: (No Connection)
Wiper of Soft Pot: A5
Bottom of Soft Pot: Gnd

But what is the total resistance of the softpot, and of the velostat one ?

“”" On most AVR-based boards, the value is guaranteed to be between 20kΩ and 50kΩ. On the Arduino Due, it is between 50kΩ and 150kΩ. For the exact value , consult the datasheet of the microcontroller on your board""""

Let’s take 20k…
If the ribbon has 200k, we’ll get a value between 0 and (close to) 0.9x5V = 4.5V.
If the ribbon has 2K, we’ll get a value between 0 and maybe 0.5V…

Measure the total R of your ribbon.
And if it’s above 5K or so, just connect the other end to +5V, and disable the internal pull-ups.
(Put // in front of pinMode(ribbonPin, INPUT_PULLUP); )

1 Like

without power the ribbon resistor is : 33K to 370K (??? very big :dizzy_face:)

maybe this is the first problem

can i change some value in the code for that ? here ?

const float R_ribbon_max_kOhm = 17.45;

really sorry for my noob level with arduino :grimacing:

The internal pullup connects between the input pin and +5 V. That forms the top of the voltage divider, and the pot or ribbon from wiper to ground is the bottom part. So no, the other end of the pot or ribbon should not be connected. At least not for Audette’s code. For @sebastian’s there would need to be a line added in setup()

  pinMode(A5, INPUT_PULLUP);

If you disable the pullup and connect the other end of the ribbon to +5 V then you’ll get values from 0 at one end to 1023 at the other end when touching it and indefinite (floating) when you aren’t, and you don’t wan’t that. You want a different and definite value when you’re not touching the ribbon vs. when you’re touching it. With the pullup resistor you read ~1023 when not touching the ribbon and something decidedly lower when you are touching it even at the top end.

1 Like

well, i’ve just re-put the Audette code with all mods, and test it with a pot and … all work fine (gate off when zero V , CV & VCF out zero to near 5V …)
all the circuit and code work, it’s my maxi resistor diy ribbon that annoys me from the start !

can i hope to make it work with this circuit with some code values change ?

1 Like

NEVER APOLOGIZE for not being an expert! We’re all learning here.

Yes, if that’s the resistance you measure you can make that change.

Should be able to. In fact if anything the higher resistance you measure should make it work better, I’d think — higher resolution anyway. Change that line as you suggested and enable PRINT_RAW_RIBBON_VALUE and see what gets printed.

As seen in the code, it’s expecting ribbon ADC values from 20 to 378. Anything much above that it and it’ll think you’re not touching the ribbon. With 370k instead of 17.45k for the ribbon resistance the maximum value it’ll read is much higher. So I’d think it’d work if you touch the ribbon near the bottom end but not over most of the range. Maybe you just didn’t try it low enough? Anyway, with PRINT_RAW_RIBBON_VALUE you can find out the actual range of values you get and then put them in in place of

int ribbon_max_val = 378,ribbon_min_val = 20; //for my Arduino Pro Mini

… Hmm, actually the higher resistance may be a problem in that it doesn’t give you enough distinction between touching at the top and not touching, so with correct value for ribbon_max_val it’ll think you’re always touching it. If that’s the case you might need to instead use an external pullup with a larger value. But let’s cross that bridge when we get to it.

3 Likes

Hum, yeah, I didn’t think about this…

i’ve change the value

const float R_ribbon_max_kOhm = 17.45;

to

const float R_ribbon_max_kOhm = 371.0;

change this for test ribbon

//debugging info
#define PRINT_TEXT (0)
#define PRINT_BEND_TEXT (0)
#define PRINT_CAL_TEXT (0)
#define PRINT_RAW_RIBBON_VALUE (1)
#define PRINT_CV_TEXT (0)

and when i open the Serial Monitor i have this now

The strange characters mean that the baud rates of the serial monitor (see at the bottom right: 9600 baud) and the arduino do not match.
In the arduette code it’s in line 189:

Serial.begin(115200*2);

I am not sure why it’s *2… I always thought 115200 is the highest the arduino can manage, but obviously I am wrong again xD. So, try to set the Serial monitor on your computer to a higher value that matches the one in the code. :slight_smile: edit: in this case 230400

1 Like

Or change it in the code to 9600, which is what you already know works from @sebastian’s sketch.

2 Likes