So I've been working on this project for about a week and a half straight, it's pretty simple but my first DIY and so it's taken me a while... but I've also went through maybe 6 breadboards re soldering and doing the wiring from scratch every time because I couldn't get the thing to work and I thought maybe that was the problem. After about 30 hours wasted I've now concluded that it's not my wiring so I come here asking for help. It's a simple faderbox using 8 linear potentiometers, each connected to the A0-7, using this wiring minus the LED and resistors:
.
There are a few issues. First off I can't get it to output any sort of midi information into an app like MIDI Monitor. But I don't really mind that since I want it for the CCs and I have been able to get my DAW, Logic Pro X, to recognize the 0-127 information in its transport window. So the thing is pretty sporadic. It works maybe 15% of the times I plug it in, I suspected it was because of my own micro usb to usbB connector but I removed that and just connected the teensy using the built in port and the problem seems to remain. I believe I've come to the conclusion that the thing only works when it's the only thing plugged into my computer. And even then it seems like sometimes it just doesn't. As soon as I plug it into a powered USB 3 hub, it ceases to function. Logic still detects the teensy in the midi setup, but no CC information appears in the transport. If I unplug everything from my computer and plug the faderbox back in, I can get it to work, but even if I plug in the USB hub into a different USB port on the computer, Logic will rescan and the faderbox will cease to show any CC information in Logic. I obviously need the hub and everything else that is attached to it, keyboard, mouse, other controllers, etc. I just want this thing to be plug and play already.
This is incredibly frustrating, if anybody has any sort of help I would really appreciate it, I'm about 30 hours and $300.00 into this project now with little success. Thank you in advance.
Here is the code I've been using, a variation of something I originally found on Gearslutz, along with the wiring diagram:
.
There are a few issues. First off I can't get it to output any sort of midi information into an app like MIDI Monitor. But I don't really mind that since I want it for the CCs and I have been able to get my DAW, Logic Pro X, to recognize the 0-127 information in its transport window. So the thing is pretty sporadic. It works maybe 15% of the times I plug it in, I suspected it was because of my own micro usb to usbB connector but I removed that and just connected the teensy using the built in port and the problem seems to remain. I believe I've come to the conclusion that the thing only works when it's the only thing plugged into my computer. And even then it seems like sometimes it just doesn't. As soon as I plug it into a powered USB 3 hub, it ceases to function. Logic still detects the teensy in the midi setup, but no CC information appears in the transport. If I unplug everything from my computer and plug the faderbox back in, I can get it to work, but even if I plug in the USB hub into a different USB port on the computer, Logic will rescan and the faderbox will cease to show any CC information in Logic. I obviously need the hub and everything else that is attached to it, keyboard, mouse, other controllers, etc. I just want this thing to be plug and play already.
This is incredibly frustrating, if anybody has any sort of help I would really appreciate it, I'm about 30 hours and $300.00 into this project now with little success. Thank you in advance.
Here is the code I've been using, a variation of something I originally found on Gearslutz, along with the wiring diagram:
Code:
#include <Bounce.h>
///////////////////////////////////////////////////////////////////////////
// define how many pots are active up to number of available analog inputs
#define analogInputs 8
//////////////////////////////////////////////////////////////////////////
// define arrays for input values and lagged input values
int inputAnalog[analogInputs];
int iAlag[analogInputs];
// define array of cc values
int ccValue[analogInputs];
// include the ResponsiveAnalogRead library
#include <ResponsiveAnalogRead.h>
///////////////////////////////////////////////////////////////////////////
// define pins and cc codes
const int A_PINS = 8;
const int ANALOG_PINS[A_PINS] = {A0, A1, A2, A3, A4, A5, A6, A7};
const int CCID[A_PINS] = {11, 1, 21, 7, 2, 12, 13, 16};
///////////////////////////////////////////////////////////////////////////
// a data array and a lagged copy to tell when MIDI changes are required
byte data[A_PINS];
byte dataLag[A_PINS];
// ititialize the ReponsiveAnalogRead objects
ResponsiveAnalogRead analog[]{
///////////////////////////////////////////////////////////////////////////
{ANALOG_PINS[0],true},
{ANALOG_PINS[1],true},
{ANALOG_PINS[2],true},
{ANALOG_PINS[3],true},
{ANALOG_PINS[4],true},
{ANALOG_PINS[5],true},
{ANALOG_PINS[6],true},
{ANALOG_PINS[7],true},
///////////////////////////////////////////////////////////////////////////
};
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop(){
// update the ResponsiveAnalogRead object every loop
for (int i=0;i<A_PINS;i++){
analog[i].update();
// if the repsonsive value has change, print out 'changed'
if(analog[i].hasChanged()) {
data[i] = analog[i].getValue()>>3;
if (data[i] != dataLag[i]){
dataLag[i] = data[i];
usbMIDI.sendControlChange(CCID[i], data[i], 1);
}
}
}
}
Last edited: