Hello there!
I want to build a MIDI controller with potentiometers that sends out 14 bit MIDI messages.
I bought a Teensy 3.6 because of the supposedly high resolution and the usbMIDI function.
But first tests are very disappointing - I just connected 1 potentiometer on a breadboard and nothing else and the readings were catastrophic... it seemed to have something to do with the jumper cables, so i tried different ones, which surprisingly really worked better, but still I couldn't even get 10 bit stable resolution.
With the ResponsiveAnalogRead library with sleep mode enabled I could finally get it to read stable 10 bit values - but not more than that.
On an Arduino Nano I can get the same stability even with the bad cables.
So what can I do to get a stable reading anywhere near 13 bit?
Could it be that I have bad potentiometers? is there such a thing? I use 5kOhm - are other sizes preferrable?
I noticed an improvement when I touched the ground - could it be that the teensy is not properly grounded?
I have read about connecting capacitors to the inputs, but I don't have any. I will order a few 10pF capacitors, since that size was recommended somewhere. How is the size of the capacitor determined and how much does it help?
I want to build a midi controller with about 60 potentiometers, connected via 8 multiplexers (TC4051BP) on a breadboard (so I'm scared now that things will only get worse).
I would then probably connect a capacitor to each input of a multiplexer - if I would connect 1 to each of the 8 Analog inputs that read the multiplexers I would probably get strange readings since they switch really fast, right?
The code I use to send 14 bit MIDI is quite simple:
It works fine, although I don't understand why it's (k1 << 4) for the least significant bits, but it gives me the correct output of the last 3 bits in MIDI.
I want to build a MIDI controller with potentiometers that sends out 14 bit MIDI messages.
I bought a Teensy 3.6 because of the supposedly high resolution and the usbMIDI function.
But first tests are very disappointing - I just connected 1 potentiometer on a breadboard and nothing else and the readings were catastrophic... it seemed to have something to do with the jumper cables, so i tried different ones, which surprisingly really worked better, but still I couldn't even get 10 bit stable resolution.
With the ResponsiveAnalogRead library with sleep mode enabled I could finally get it to read stable 10 bit values - but not more than that.
On an Arduino Nano I can get the same stability even with the bad cables.
So what can I do to get a stable reading anywhere near 13 bit?
Could it be that I have bad potentiometers? is there such a thing? I use 5kOhm - are other sizes preferrable?
I noticed an improvement when I touched the ground - could it be that the teensy is not properly grounded?
I have read about connecting capacitors to the inputs, but I don't have any. I will order a few 10pF capacitors, since that size was recommended somewhere. How is the size of the capacitor determined and how much does it help?
I want to build a midi controller with about 60 potentiometers, connected via 8 multiplexers (TC4051BP) on a breadboard (so I'm scared now that things will only get worse).
I would then probably connect a capacitor to each input of a multiplexer - if I would connect 1 to each of the 8 Analog inputs that read the multiplexers I would probably get strange readings since they switch really fast, right?
The code I use to send 14 bit MIDI is quite simple:
Code:
#include <ResponsiveAnalogRead.h>
const int ANALOG_PIN = A0;
ResponsiveAnalogRead analog(ANALOG_PIN, true);
int channel = 6;
int k1cc1 = 0;
int k1cc2 = 60;
int k1 = 0;int k1old = 0;
void setup() {
analogReadResolution(10);
analog.enableEdgeSnap();
analog.setAnalogResolution(1024);
}
void loop() {
analog.update();
k1 = analog.getValue();
if (k1 != k1old){
usbMIDI.sendControlChange(k1cc1, (k1 >> 3), channel);
usbMIDI.sendControlChange(k1cc2, (k1 << 4), channel);
k1old = k1;
}
}
Last edited: