Hi,
I'm currently working on a DIY project for a hardware MIDI controller for the iOS Synth iVCS3 goal is something like that http://www.synth-project.de/ivcs3_controller.html but until now I am prototyping with just one trim pot on a Teensy 3.2 board. The pot is connected to A0, GND and 3,3V
To use high resolution MIDI CC I use this code (base on https://forum.pjrc.com/threads/25940-14-bit-MIDI-over-USB)
I connected a 10K Bourns pot (also tried another) but the values are not stable and 'flapping', e.g. if I control the oscillator frequency it sound like a random vibrator.
As know from a other project I already tried ceramic capacitor 100nF between signal and ground which is a bit better but not that good. Any hints how to get the signal stable?
BTW: I'm a Arduino newbee.
regards
I'm currently working on a DIY project for a hardware MIDI controller for the iOS Synth iVCS3 goal is something like that http://www.synth-project.de/ivcs3_controller.html but until now I am prototyping with just one trim pot on a Teensy 3.2 board. The pot is connected to A0, GND and 3,3V
To use high resolution MIDI CC I use this code (base on https://forum.pjrc.com/threads/25940-14-bit-MIDI-over-USB)
Code:
// Fixed values, for demonstration
uint32_t channel = 1; // channels are 1 to 16
uint32_t param = 123456; // your parameter number here, 0 to 16k
uint32_t val = 54321; // your value here, 0 to 16k
// in actual use this would come from some physical controller like an analog value
// or be computed by monitoring an encoder
void sendNRPNHR(uint32_t parameter, uint32_t value, uint32_t channel) {
// Send an arbitrary 14-bit value to an arbitrary 14-bit non-registered parameter
// Note that param MSB and LSB are shared between RPN and NRPN, so set both at once
// Also, null out the RPN (and NRPN) active parameter (best practice) after data is sent (as it persists)
usb_midi_write_packed(0xB00B | (((channel - 1) & 0x0F) << 8) | ((99 & 0x7F) << 16) | ((parameter & 0x7F) << 24));
// Control change 98 for NRPN, LSB of param
usb_midi_write_packed(0xB00B | (((channel - 1) & 0x0F) << 8) | ((98 & 0x7F) << 16) | (((parameter >>7) & 0x7F) << 24));
// Control change 38 for Data Entry LSB of param
usb_midi_write_packed(0xB00B | (((channel - 1) & 0x0F) << 8) | ((6 & 0x7F) << 16) | (((value >>7) & 0x7F) << 24));
// Control change 6 for Data Entry MSB of value
usb_midi_write_packed(0xB00B | (((channel - 1) & 0x0F) << 8) | ((38 & 0x7F) << 16) | ((value & 0x7F) << 24));
}
void setup() {
}
// store previously sent values, to detect changes
int previousA0 = -1;
elapsedMillis msec = 0;
void loop() {
// only check the analog inputs 50 times per second,
// to prevent a flood of MIDI messages
if (msec >= 80) {
msec = 0;
int n0 = analogRead(A0);
if (n0 != previousA0) {
int valA0 = map(n0, 0, 1023, 0, 16383);
sendNRPNHR(param, valA0, 1); // channel 1
previousA0 = n0;
}
}
}
I connected a 10K Bourns pot (also tried another) but the values are not stable and 'flapping', e.g. if I control the oscillator frequency it sound like a random vibrator.
As know from a other project I already tried ceramic capacitor 100nF between signal and ground which is a bit better but not that good. Any hints how to get the signal stable?
BTW: I'm a Arduino newbee.
regards