Help.. Arduino midi control change

Started by rosesound, October 06, 2016, 01:19:34 PM

Previous topic - Next topic

rosesound

I need help to the code on arduino.

(to keep it simple)

Midi IN:

When cc 40 on Ch 2 velocity 120 set LED HIGH

When cc 40 on Ch 2 velocity 00 set LED LOW


I got all the circut running and done somme midi out that works, but i cant make this work.. anybody help :) please :)

best JK

ElectricDruid

Since when did control change messages have velocity? I think you mean "value".

The typical way to do what you suggest is for all values below 64 to clear the LED, and all values 64 and above to set it. Although usually buttons send 0 and 127 as the values, programming this way allows your code to work with non-standard things that send something else.

If I were you, I'd have a good hunt around on Google. Handling simple MIDI control changes using Arduino must have been done a dozen times, and someone is bound to have put some code online somewhere.

HTH,
Tom



rosesound

Yes you were right ..value..:) not velocity.. I have been on google and could not find much when it comes to midi IN and CC .. for some examples codes..

JK

ElectricDruid

How about this? With some tweaks this looks like it might be pretty much there:

Arduino MIDI Library

It's got code that lets you receive messages, so you probably just need to fill in the correct callback routine.

HTH,
Tom


potul

take a look at my midi switcher project

http://www.diystompboxes.com/smfforum/index.php?topic=112424.0

It uses program change messages instead of CC, but you should be able to get the point looking at the code