Sending MIDI Messages not working.
hello,
im trying create midi foot switch control axe fx ii unit (http://wiki.fractalaudio.com/index.php?title=midi midi cc messages). schematic i'm using attached.
this code:
i've tried changing numbers on "midi.sendnoteon(60,127,1);" , still nothing changing. can guide me command should sent @ least 1 function?
im trying create midi foot switch control axe fx ii unit (http://wiki.fractalaudio.com/index.php?title=midi midi cc messages). schematic i'm using attached.
this code:
code: [select]
#include <midi.h>
#include <midi_defs.h>
#include <midi_namespace.h>
#include <midi_settings.h>
#include <button.h>
int ledpin = 13; //choose pin led - needs (3,5,6,9,10, or 11)
int buttonpin = 2; //choose input pin pushbutton
int buttonval = 0; //variable reading button status
int buttonstate = 0; //variable hold buttons current state
int bouncecheck = 0; //variable debouncing
void setup() {
pinmode(ledpin, output); //declare led output
pinmode(buttonpin, input); //declare pushbutton input
serial.begin(31250); //midi communicates @ 31250 baud
}
void loop(){
buttonval = digitalread(buttonpin); //read input value button
delay(10); //wait 10ms
bouncecheck = digitalread(buttonpin); //check again
if(buttonval == bouncecheck){ //if val same not bounce
if (buttonval == high && buttonstate == 1) { //check if input high
digitalwrite(ledpin, low); //turn led off
midi.sendnoteoff(60,0,1);
buttonstate = 0;
}
if(buttonval == low && buttonstate == 0){
digitalwrite(ledpin, high); //turn led on
midi.sendnoteon(60,127,1);
buttonstate = 1;
}
}
}
void midiout(char command, char value1, char value2) {
serial.write(command);
serial.write(value1);
serial.write(value2);
}
}
i've tried changing numbers on "midi.sendnoteon(60,127,1);" , still nothing changing. can guide me command should sent @ least 1 function?
image big, please resize it.
able send midi message?
you don't need midiout function since you're using midi library
go slowly, rid of button part , send midi note delay of 500 or so. how monitoring output? best use computer midi monitor, midi-ox.
maybe connection wrong, it's hard tell pin 4 , 5 on midi connector.
able send midi message?
you don't need midiout function since you're using midi library
go slowly, rid of button part , send midi note delay of 500 or so. how monitoring output? best use computer midi monitor, midi-ox.
maybe connection wrong, it's hard tell pin 4 , 5 on midi connector.
Arduino Forum > Using Arduino > Audio > Sending MIDI Messages not working.
arduino
Comments
Post a Comment