sending midi cc

Ok, I finally found the post with the 6 potentiometers sending midi CC signals. I tried using the code but instead transmitted the data through the usb cable to my mac. I used midi monitor to check for signals and found nothing being sent though at all. I finally broke down and asked my coder friends to look it over and we re-wrote the program for one potentiometer. Still nothing being seen in midi monitor.

This is what we came up with... If someone could please help me out it would be greatly appreciated. Thanks.

int AnalogValue = 0; int val = 0;

void setup(){ Serial.begin(31250); //31250 }

void loop(){

AnalogValue = analogRead(val/8);

midiCC(0xB0,0x4F,AnalogValue); //0xB0 = 176 dec = channel 1 , 0x4F ='s midicc channel 79, "sound controller 10"


// This function sends a Midi CC. void midiCC(int CC_data, int c_num, int c_val){ Serial.print(CC_data,BYTE); Serial.print(c_num,BYTE); Serial.print(c_val,BYTE);


Have you checked if AnalogValue contains a value at all? Also, some midi monitors don't print out CC data by default, only note commands. So check if there's some filter in effect

AnalogValue does conatin a value and midi monitor is set so that it can read cc data. I found a dashboard widget for watching midi signals and crashed it when I changed BYTE to DEC in the lines "Serial.print(CC_data,Byte);" ...

I also found this video ( which is exactly what I am trying to do with this project.


You said in your original post "but instead transmitted the data through the usb cable to my mac."

Does that mean you have the arduino plugged in through its usb connection.

If so then this is the first problem. The usb connection on the arduino will not be considered a midi device by the computer as its usb declaration is that it is a serial port . This means the signals you are sending don't go into the midi processing part of the computer, so will not show up as midi even if the signals are correct midi info.

To get them into the midi system the easiest way is to take the serial signal from pin 1 of the arduino board and connect this to a commercial midi to usb convertor

More detail here



why do you need to write 0xB0? why cant you just write the number?

i would get it if all the numbers sent to the midi device were in hex, but why only the channel?

More detail here

One of my unfavoriteist sties, sending CC code is what I do in:-

Also look at the technique I have used with the conditional compilation (#ifdef) so you can use the arduino monitor for debugging before actually connecting the arduino through a MIDI output driver to a MIDI input interface into the Mac.