with the keyboard?
I have 15 medias, using keyboard is easy to access from media 1 to 10 . but I need to access the 11,12 etc.
any adivice?
@Pierre GuilluyStarting with miniMAD 3.2 (currently 3.2.2) you can trigger the sixteen first medias using a microModul8 USB controller.
For the next medias you'll have to using previous and next for the moment (I'm adding your suggestion to the miniMAD wishlist though).
Code: Select all
#include <Bounce2.h> // Import the Bounce2 library into the sketch
int led = 13; // The onboard LED is pin 13
/**************************************************************************
bounce
**************************************************************************/
int debounce_interval_time = 5; // The interval time for debouncing is 5 milliseconds
Bounce push_button1 = Bounce();
int push_button_pin1 = 1;
Bounce push_button2 = Bounce();
int push_button_pin2 = 2;
Bounce push_button3 = Bounce(); // Create a Bounce2 object associated with a name
int push_button_pin3 = 3; // The push button is connected to pin 32
Bounce push_button4 = Bounce();
int push_button_pin4 = 4;
Bounce push_button5 = Bounce(); // Create a Bounce2 object associated with a name
int push_button_pin5 = 5; // The push button is connected to pin 32
Bounce push_button12 = Bounce();
int push_button_pin12 = 12;
/**************************************************************************
setup
**************************************************************************/
void setup() {
pinMode(led, OUTPUT); // The led pin is an output
pinMode(push_button_pin1, INPUT_PULLUP);
push_button1.attach(push_button_pin1);
push_button1.interval(debounce_interval_time);
pinMode(push_button_pin2, INPUT_PULLUP);
push_button2.attach(push_button_pin2);
push_button2.interval(debounce_interval_time);
pinMode(push_button_pin3, INPUT_PULLUP);
push_button3.attach(push_button_pin3);
push_button3.interval(debounce_interval_time);
pinMode(push_button_pin4, INPUT_PULLUP);
push_button4.attach(push_button_pin4);
push_button4.interval(debounce_interval_time);
pinMode(push_button_pin5, INPUT_PULLUP); // In the setup() function, set the digital pin as an input
push_button5.attach(push_button_pin5); // In the setup() function, attach the digital pin to the Bounce2 object
push_button5.interval(debounce_interval_time); // In the setup() function, set an interval time in milliseconds to debounce the input - 5 - 50 milliseconds is recommended, the shorter the better (as long as a clear and stable signal can be read)
pinMode(push_button_pin12, INPUT_PULLUP);
push_button12.attach(push_button_pin12);
push_button12.interval(debounce_interval_time);
}
/**************************************************************************
loop
**************************************************************************/
void loop() {
push_button1.update();
push_button2.update(); // In the loop() function, update the Bounce2 object regularly
push_button3.update();
push_button4.update();
push_button5.update(); // In the loop() function, update the Bounce2 object regularly
push_button12.update();
pbuton1();
pbuton12();
}
/**************************************************************************
voids
**************************************************************************/
void pbuton12() {
if (push_button12.fell() == true) { // Was there a transition from the button being depressed to being pressed...?
digitalWrite(led, HIGH); // ... if so, turn on the onboard led
usbMIDI.sendControlChange(100, 127, 1);
}
if (push_button12.rose() == true) { // Was there a transition from the button being pressed to being depressed...?
digitalWrite(led, LOW); // ... if so, turn off the onboard led
usbMIDI.sendControlChange(100, 0, 1);
}
}
void pbuton1() {
if (push_button1.fell() == true) { // Was there a transition from the button being depressed to being pressed...?
digitalWrite(led, HIGH); // ... if so, turn on the onboard led
usbMIDI.sendControlChange(90, 127, 1);
}
if (push_button1.rose() == true) { // Was there a transition from the button being pressed to being depressed...?
digitalWrite(led, LOW); // ... if so, turn off the onboard led
usbMIDI.sendControlChange(90, 0 , 1);
}
}
Code: Select all
if (push_button12.fell() == true) { // Was there a transition from the button being depressed to being pressed...?
digitalWrite(led, HIGH); // ... if so, turn on the onboard led
usbMIDI.sendControlChange(100, 127, 1);
}
if (push_button12.rose() == true) { // Was there a transition from the button being pressed to being depressed...?
digitalWrite(led, LOW); // ... if so, turn off the onboard led
usbMIDI.sendControlChange(100, 0, 1);
}
Code: Select all
if (push_button1.fell() == true) { // Was there a transition from the button being depressed to being pressed...?
digitalWrite(led, HIGH); // ... if so, turn on the onboard led
usbMIDI.sendControlChange(90, 127, 1);
}
if (push_button1.rose() == true) { // Was there a transition from the button being pressed to being depressed...?
digitalWrite(led, LOW); // ... if so, turn off the onboard led
usbMIDI.sendControlChange(90, 0 , 1);
Users browsing this forum: No registered users and 12 guests
Copyright 2017 © garageCube. All Rights Reserved. Powered by phpBB® Forum Software © phpBB Limited.