Hello, this is my first post here, so please forgive my extremely low knowledge about teensy and arduino.
Basically, I wanted to buy a Midi Fighter (which is a 16 button midi controller), but since I love electronics and DIY, I thought about making one with teensy and some arcade buttons. Because of my budget, I am going to get a Teensy LC.
I am going to 3D print the frame and I have some decent knowledge about hardware, so I am not concerned about it. The thing that I am concerned, though, is software. Using Teensyduino, I have created this code so far (though I do need to edit the Midi value, I put them in randomly because I didn't have time)
Notice how there are 18 buttons, instead of 16. What I wanted to do was to use those extra 2 buttons as a bank shifter, as I am going to use this in Ableton. In Ableton's drum rack, there are a lot of "pages", and here are some pictures of it. The one starting with C2 is the default page, and I shifted the pages upwards, one by one. They are configured quite weirdly. The question that I'm wondering is: is there a way to make all of the midi notes go up/low for a certain value when I press a button? Any help will be greatly appreciated.
Basically, I wanted to buy a Midi Fighter (which is a 16 button midi controller), but since I love electronics and DIY, I thought about making one with teensy and some arcade buttons. Because of my budget, I am going to get a Teensy LC.
I am going to 3D print the frame and I have some decent knowledge about hardware, so I am not concerned about it. The thing that I am concerned, though, is software. Using Teensyduino, I have created this code so far (though I do need to edit the Midi value, I put them in randomly because I didn't have time)
Code:
#include <Bounce.h>
const int channel = 1;
Bounce button1 = Bounce(0, 5);
Bounce button2 = Bounce(1, 5);
Bounce button3 = Bounce(2, 5);
Bounce button4 = Bounce(3, 5);
Bounce button5 = Bounce(4, 5);
Bounce button6 = Bounce(5, 5);
Bounce button7 = Bounce(6, 5);
Bounce button8 = Bounce(7, 5);
Bounce button9 = Bounce(8, 5);
Bounce button10 = Bounce(9, 5);
Bounce button11 = Bounce(10, 5);
Bounce button12 = Bounce(11, 5);
Bounce button13 = Bounce(12, 5);
Bounce button14 = Bounce(13, 5);
Bounce button15 = Bounce(14, 5);
Bounce button16 = Bounce(15, 5);
Bounce button17 = Bounce(16, 5);
Bounce button18 = Bounce(17, 5);
void setup() {
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
pinMode(15, INPUT_PULLUP);
pinMode(16, INPUT_PULLUP);
pinMode(17, INPUT_PULLUP);
pinMode(18, INPUT_PULLUP);
void loop() {
button1.update();
button2.update();
button3.update();
button4.update();
button5.update();
button6.update();
button7.update();
button8.update();
button9.update();
button10.update();
button11.update();
button12.update();
button13.update();
button14.update();
button15.update();
button16.update();
button17.update();
button18.update();
if (button1.fallingEdge()) {
usbMIDI.sendNoteOn(81, 99, channel); // 61 = C#4
}
if (button2.fallingEdge()) {
usbMIDI.sendNoteOn(80, 99, channel); // 62 = D4
}
if (button3.fallingEdge()) {
usbMIDI.sendNoteOn(79, 99, channel); // 63 = D#4
}
if (button4.fallingEdge()) {
usbMIDI.sendNoteOn(78, 99, channel); // 64 = E4
}
if (button5.fallingEdge()) {
usbMIDI.sendNoteOn(77, 99, channel); // 65 = F4
}
if (button6.fallingEdge()) {
usbMIDI.sendNoteOn(76, 99, channel); // 66 = F#4
}
if (button7.fallingEdge()) {
usbMIDI.sendNoteOn(75, 99, channel); // 67 = G4
}
if (button8.fallingEdge()) {
usbMIDI.sendNoteOn(74, 99, channel); // 68 = G#4
}
if (button9.fallingEdge()) {
usbMIDI.sendNoteOn(73, 99, channel); // 69 = A5
}
if (button10.fallingEdge()) {
usbMIDI.sendNoteOn(72, 99, channel); // 70 = A#5
}
if (button11.fallingEdge()) {
usbMIDI.sendNoteOn(71, 99, channel); // 71 = B5
}
if (button12.fallingEdge()) {
usbMIDI.sendNoteOn(70, 99, channel); // 71 = B5
}
if (button13.fallingEdge()) {
usbMIDI.sendNoteOn(69, 99, channel); // 71 = B5
}
if (button14.fallingEdge()) {
usbMIDI.sendNoteOn(68, 99, channel); // 71 = B5
}
if (button15.fallingEdge()) {
usbMIDI.sendNoteOn(67, 99, channel); // 71 = B5
}
if (button16.fallingEdge()) {
usbMIDI.sendNoteOn(66, 99, channel); // 71 = B5
}
if (button17.fallingEdge()) {
usbMIDI.sendNoteOn(65, 99, channel); // 71 = B5
}
if (button18.fallingEdge()) {
usbMIDI.sendNoteOn(64, 99, channel); // 71 = B5
}
if (button1.risingEdge()) {
usbMIDI.sendNoteOff(81, 0, channel); // 61 = C#4
}
if (button2.risingEdge()) {
usbMIDI.sendNoteOff(80, 0, channel); // 62 = D4
}
if (button3.risingEdge()) {
usbMIDI.sendNoteOff(79, 0, channel); // 63 = D#4
}
if (button4.risingEdge()) {
usbMIDI.sendNoteOff(78, 0, channel); // 64 = E4
}
if (button5.risingEdge()) {
usbMIDI.sendNoteOff(77, 0, channel); // 65 = F4
}
if (button6.risingEdge()) {
usbMIDI.sendNoteOff(76, 0, channel); // 66 = F#4
}
if (button7.risingEdge()) {
usbMIDI.sendNoteOff(75, 0, channel); // 67 = G4
}
if (button8.risingEdge()) {
usbMIDI.sendNoteOff(74, 0, channel); // 68 = G#4
}
if (button9.risingEdge()) {
usbMIDI.sendNoteOff(73, 0, channel); // 69 = A5
}
if (button10.risingEdge()) {
usbMIDI.sendNoteOff(72, 0, channel); // 70 = A#5
}
if (button11.risingEdge()) {
usbMIDI.sendNoteOff(71, 0, channel); // 71 = B5
}
if (button12.risingEdge()) {
usbMIDI.sendNoteOff(70, 0, channel); // 71 = B5
}
if (button13.risingEdge()) {
usbMIDI.sendNoteOff(69, 0, channel); // 71 = B5
}
if (button14.risingEdge()) {
usbMIDI.sendNoteOff(68, 0, channel); // 71 = B5
}
if (button15.risingEdge()) {
usbMIDI.sendNoteOff(67, 0, channel); // 71 = B5
}
if (button16.risingEdge()) {
usbMIDI.sendNoteOff(66, 0, channel); // 71 = B5
}
if (button17.risingEdge()) {
usbMIDI.sendNoteOff(65, 0, channel); // 71 = B5
}
if (button18.risingEdge()) {
usbMIDI.sendNoteOff(64, 0, channel); // 71 = B5
}
while (usbMIDI.read()) {
}
}
Notice how there are 18 buttons, instead of 16. What I wanted to do was to use those extra 2 buttons as a bank shifter, as I am going to use this in Ableton. In Ableton's drum rack, there are a lot of "pages", and here are some pictures of it. The one starting with C2 is the default page, and I shifted the pages upwards, one by one. They are configured quite weirdly. The question that I'm wondering is: is there a way to make all of the midi notes go up/low for a certain value when I press a button? Any help will be greatly appreciated.