Hey, it's my first time using MIDI and I can't figure out how to send a control change using the MIDI.h library.
The goal is to switch de video input on my Roland HD video switcher V-1HD. I attatched my code and the controller manual. I tried switching the numbers but nothing seems to work.
Mike: I'm trying to do the same thing--control a Roland video switcher. Are you using MIDI through a midi cable or via USB? Were you able to get it working?
This is where I am at, but I dont really know what I'm doing!
I am currently using MIDI on a cable vs USB, but as I am cutting and pasting code from other sketches, I may be confusing USB commands with serial commands.
I need to associate pinmode 2 thru 5 with changing the sendcontrol change 00H thru 03H, ideally on both channel A and channel B.
Please edit your post and add [code][/code] tags around your code. Your code is incomplete, the if statements, for loop and loop function are never closed.
What is the problem you're facing? What works, what doesn't? What have you tried to troubleshoot the issue?
Nothing is working as I dont really know what I'm doing--I've jumped into this without fully understanding arduino and MIDI.
I really only need a direct translation from arduino digital in pins 2-5 to midi commands in the form of //sendControlChange (DataByte inControlNumber, DataByte inControlValue, Channel inChannel);
i expect it to look like (1,32,1) for camera one, (1,33,1) for camera 2 and so on.
I can set up the physical interface from mic switcher to arduino to video switcher, but need help with the code.When mic one is active, camera 1 selected, mic 2 active camera 2 selected, etc.
Arduino Uno send basic commands to midi controlled video switcher (Roland V1HD) either using midi cable or usb.
I've jumped into this without fully understanding arduino and MIDI.
Yes that will give you a big problem.
That code is a nonsense. It won’t even compile. Once it compiles it actually needs to what you want as well, which is not very clear. So suppose a pin is pressed, what control value do you need to send, what value if any needs sending when it is released? What about the other controls do they only change when their own pin is changed?
You need to decide what sort of interface you want to use, that code only uses a serial output, not a USB output.
I'm going to use serial/MIDI, not USB--I can only deal with one headache at a time.
Here is my updated code, which is still not doing what I want. I can see on that its receiving the input from the external mixer (and switching based on which mic goes active), but I do not have a way to view the MIDI commands as they (hopefully) execute.
#include <MIDI.h>
enum {BUS_A, BUS_B, BUS_AB};
MIDI_CREATE_DEFAULT_INSTANCE();
const int INPUT_NUM = 4;
int inputPins[INPUT_NUM] = {2, 3, 4, 5};
void setup() {
// put your setup code here, to run once:
Serial.begin(31250); //Serial.begin(9600);
MIDI.begin(MIDI_CHANNEL_OMNI);
Just as added context, I'm using an automatic mic mixer to output 4v to the digital pins on the uno. When mic 1 turns on, arduino pin 2 goes up, when mic 2 turns on, pin 3 and so on. Only 1 mic is active at a time, and the last mic holds until the next activates.
Not that you need it but here is a link to that mixer:
Page 5 shows where I'm pulling the control voltage. That part works!