I am a beginner and trying to program a Teensy 3.2 as a midi controller using a sketch by from Instructables;
I am new to this, but uploaded the sketch to my Arduino 3.2 and just wired one pot and one momentary spst in.
The circuit is designed for 12 switches and 5 pots.
For the controller I am building I just want 1 switch and 5 pots.
I uploaded the sketch to the Teensy 3.2, attached only one potentiometer and one momentary SPST switch, and then plugged it in to my DAW.
I get all of these random midi controller cc's (it looked like their the specific midi controller #s that are in the sketch) spewing constant messages into the DAW.
I was thinking maybe it's because I don't have all of the momentary-switches and pots wired into the circuit yet?
How would I test this and get it to work without wiring ALL of the switches and pots?
In the end, I just want 5 pots and one momentary switch.
How would I connect stuff for the end result to be able to make it work when I don't have every switch or pot in the whole circuit?
If you change the number of physical switches and pots, you should also change the number of switches and inputs that are polled in the code.
Alternatively, use a library like Control Surface, then you can simply use:
#include <Control_Surface.h>
// Instantiate the MIDI over USB interface to use.
USBMIDI_Interface midi;
// Instantiate a CCButton object
CCButton button {
5, // Push button between pin 5 and ground
{0x20, CHANNEL_1}, // controller number and channel
};
// Instantiate an array of CCPotentiometer objects
CCPotentiometer potentiometers[] {
{A0, // Analog pin connected to potentiometer 1
0x10}, // Controller number of the first potentiometer
{A1, // Analog pin connected to potentiometer 2
0x11}, // Controller number of the second potentiometer
{A2, 0x12}, // Etc.
{A3, 0x13},
{A4, 0x14},
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
That is terrific, but the Control Surface library I had not seen.
That is way better because I would actually like a few more than 5 faders, but only one or two switches, so this way if I can figure that out I could do that without getting into the "muxing" thing, etc.
I'm going to go look at the Control Surface library tomorrow and try to understand it.