without touching the ribbon now i have this
i have between 704 and 1000 (1023 without touching the ribbon)
i must do that change ?
int ribbon_max_val = 1023,ribbon_min_val = 704; //for my Arduino Pro Mini
and onother question for the side of my ribbon, 1000 is more low in pitch than 704 ?
Iām surprised you have 33k at the bottom of the ribbon, I wonder where that comes from? Anyway what you see is pretty consistent with a ~15k pullup resistor. And the maximum you see, 1000, seems to overlap what you see when not touching the ribbon ā which jumps around a lot, it really should be more stable with the pullup resistor enabled Iād think. Anyway, I think I was right before in thinking you may need a larger (maybe 47k?) external pullup instead to go better with your larger resistance ribbon. But for now yes, put those values in and see what happens. Actually put 1000 for ribbon_max_val, not 1023.
Itās a higher voltage input which translates to a larger CV output which is a higher pitch.
i think itās maybe because i have a little part of velostat more long than the copper to attach it under my thin wood (and to connect his wire)
To add another pullup resistor like you suggest, I must connect 5V to a 47K resistor to the A5 ribbon wire, yes ?
Yes, and deactivate the internal pullup.
(Put // in front of pinMode(ribbonPin, INPUT_PULLUP); )
To add the Pullup resistor, itās better before or after the 33nf (connect the 47K to the jack side or the nano side), or it doesnāt matter ?
I did not wait for an answer, I tested
i add the 47K (and deleted the Pullup in the code) and now with the Serial Monitor, itās down at 431 (instead of 704). And 959 instead of 1000.
Should i put a bigger resistor ?
After entering the new values, redo a Serial Monitor, re adjust the values ā¦
Iāve just test with the multimeter and, itās better i have near 5V on gate ouput when i touch the ribbon and zero when i donāt touch it !!! a little victory
but the CV out : zero zero zero 000000⦠and on the 3 last centimeters of the ribbon , itās up untill 0.30V at max
Thatās great! Itās seeing the ribbon, itās writing to the DAC. Now itās just a matter of getting the numbers right so it all behaves well.
What actual voltage do you see on a multimeter from the ribbon? Should be close to 4.4 V when you touch near the top end. Just have to persuade the software thatās what it is.
yes i think too !
Thereās 4.43V who arrive from A5 (when no touching the R)
and when i touch it i have
1.90V mini et 3.93V maxi
ājustā ⦠euh ⦠just need some help for that too please.
How to increase the CV output (0.30V actualy)
I need to send more V in the DAC ?
here ?
#define MAX_DAC_VOLT (4.97)
#define MAX_DAC_COUNTS (4095)
Make sure you have these values defined
#define RIBBON_SPAN (1023)
int ribbon_max_val = 959,ribbon_min_val = 431;
const float R_ribbon_max_kOhm = 371.0;
#define MAX_DAC_COUNTS (4095)
#define VOLT_PER_OCTAVE (1.0)
#define MAX_DAC_VOLT (4.43)
That 4.43 is kind of low but weāll live with it for now.
Enable these:
#define PRINT_TEXT (1)
#define PRINT_CAL_TEXT (1)
and see what gets printed.
(This code is⦠messy. Messily formatted, and a lot of stuff is done in a very strange roundabout way. Part of it is because it originally was to work with MIDI out. Really all it has to do is read the ribbon, check if itās above a threshold or not, if it is scale it to the 0-4.095 range, and write it out, maybe with some running averaging to smooth it. Instead it goes all over the place to get there. Someday I intend to rebuild my interface and when I do Iāll probably throw this code out and write something new from scratch. Meanwhile we have to cope with this!)
Thanks to take some time for my problems.
All the values are good.
i 've launched the Print Text & Print Cal Text in the Serial Monitor and i can see a white page, nothing.
?
itās a good or a bad news ?
Itās an impossible news? Oh. I meant PRINT_CV_TEXT not PRINT_CAL_TEXT.
PRINT_CV_TEXT should print something⦠if the note changes. If it doesnāt think the note is changing it wonāt print anything. I guess thatās whatās going on.
OK, letās try this. Change these lines
if (note_change) {
digitalWrite(LED2_pin, LOW); //LOW is "on" for the sparkfun MIDI shield
if (PRINT_TEXT) {
Serial.print("ribbon value = ");
Serial.print(ribbon_value);
Serial.print(", R = ");
Serial.print(ribbon_R_kOhm);
Serial.print(" kOhm, Frac MAX = ");
Serial.print( ribbon_span_frac );
Serial.print(", Note On = ");
Serial.print(is_note_on);
Serial.print(", Note Float = ");
Serial.print(note_num_float);
Serial.print(", Note Num = ");
Serial.print(note_num);
Serial.print(", MIDI Note = ");
Serial.println(MIDI_note_num);
} //else {
to these
if (PRINT_TEXT) {
Serial.print("ribbon value = ");
Serial.print(ribbon_value);
Serial.print(", R = ");
Serial.print(ribbon_R_kOhm);
Serial.print(" kOhm, Frac MAX = ");
Serial.print( ribbon_span_frac );
Serial.print(", Note On = ");
Serial.print(is_note_on);
Serial.print(", Note Float = ");
Serial.print(note_num_float);
Serial.print(", Note Num = ");
Serial.print(note_num);
Serial.print(", MIDI Note = ");
Serial.println(MIDI_note_num);
delay(1000);
} //else {
if (note_change) {
digitalWrite(LED2_pin, LOW); //LOW is "on" for the sparkfun MIDI shield
(Save the old version somewhere, this should be a temporary change, youāll want to revert to the original version once its usefulness is done.)
This should make it print all the time. It waits 1 second after each print so you have a chance to see what itās printing. You can change the number in the delay() to make it wait more or less time. (1000 means 1000 milliseconds, i.e. 1 second.)
Also, probably separately though, turn on PRINT_CV_TEXT (instead of PRINT_CAL_TEXT). That will definitely print something if itās writing to the DAC, and since you see a change in the CV output it must be doing that.
I change the code and i have a lot of errors when i check it
EDIT : wait, i 've not put it in a new folder, itās ok , i continue with Print CV Text ā¦
Check carefully that you replaced exactly the lines I showed with exactly the new ones. There should be no errors. If you canāt find the problem post your code and a cut and paste of the errors you get.
That seems fine. It says itās going to send values like 2620 to the DAC, which should give about 3 V or so (very roughly). You donāt see that on the CV output? And yet you did see something like that when you had the pot connected?
No, i 've re checked now the CV out and i have a little āmoreā .
Before 0.30V and now 0.44V on the max , and itās begin to increase only on the last 5 centimeters of the ribbon, iāve made this with the new ātest codeā.
Well, thatās just wrong. Before you said
So at that point the DAC was working, and the DAC code in the software. Now the same code says itās sending more than half the full scale value to the DAC, you should be getting 3 V and youāre not. You havenāt changed anything in the code that could affect how it sends values like 2000 to the DAC. And presumably you havenāt changed the DAC hardware. So somethingās very strange.