Absolute Newbie - Midi Foot Controller with teensy 2.0

Status
Not open for further replies.

miasei

Member
Hello there, I'm an absolute newbie in programming with teensy/arduino. I would like to build a Midi foot controller with 8 buttons (momentary) and 8 LEDs to control the software Gig Performer for switching effects on/off (CC) (or maybe switching presets (PC)). I would like to use USB Midi to send and receive messages, which is possible with Gig Performer. The momentary button can be used as a latched switch there. I use a teensy 2.0.

Maybe someone built a midi foot controller and can offer a code for me.

I would like to learn the whole program thing, but it would be very helpful to have a starting point. Got me a starter kit with breadboard, so that I can test configurations and I have done a few setups. Thanks in advance and have a nice day.
 
There are many examples available.

Decide what you want it to do EXACTLY and spell it out in full detail.

Will the same message on ever press work or do you need it to toggle states?

Many button examples show note on/off messages on the press and release. Your software may be fine with using a note on, or you can send a CC instead and ignore the release but only if the software handles the toggle.
 
Thanks for the reply. I want to be able to send midi message via usb to the software Gig Performer by pushing a momentary button to turn on/off an effect like chorus. The led of the controller should turn on and off too. I tried a code which I figured out from the intro of PJR Website Teensyduino USB Midi. I can send midi message with this code, but the button for the led works only momentary.

Code:
//Midi Bounce
#include <Bounce.h> // Bounce library makes button change detection easy
const int channel = 1;

Bounce button1 = Bounce(PIN_B0, 5); // 5 = 5 ms debounce time
Bounce button2 = Bounce(PIN_B1, 5); // which is appropriate for good


void setup()
{
//Pushbuttons
pinMode(PIN_B0, INPUT_PULLUP);
pinMode(PIN_B1, INPUT_PULLUP);
//LEDs
pinMode(PIN_D6, OUTPUT);
pinMode(PIN_D7, OUTPUT);
}

void loop()
{
if (digitalRead(PIN_B0)) {
digitalWrite(PIN_D6, HIGH); // LED on;
} else {
digitalWrite(PIN_D6, LOW); // LED off;
}

if (digitalRead(PIN_B1)) {
digitalWrite(PIN_D7, HIGH); // LED on;
} else {
digitalWrite(PIN_D7, LOW); // LED off;
}



//Midi Loop
button1.update();
button2.update();

// Note On messages when each button is pressed
if (button1.fallingEdge()) {
usbMIDI.sendControlChange(85, 127, 1);
}
if (button2.fallingEdge()) {
usbMIDI.sendControlChange(86, 127, 1);
}

// MIDI Controllers should discard incoming MIDI messages.
while (usbMIDI.read()) {
}


}



I would like to be able to get midi messages from the software. I am using another Midi Foot Controller for Programm Changes (Presets). So I want to be able to switch presets and if the chorus there is on, the led should go on. Thanks for your help!!!
 
I could figure out a working code for Buttons that works as toogle switch and Midi send. Made a new thread, so thanks.
 
Status
Not open for further replies.
Back
Top