Author Topic: Help.. Arduino midi control change  (Read 1563 times)

rosesound

Help.. Arduino midi control change
« on: October 06, 2016, 01:19:34 PM »
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

Re: Help.. Arduino midi control change
« Reply #1 on: October 06, 2016, 04:03:17 PM »
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

Re: Help.. Arduino midi control change
« Reply #2 on: October 10, 2016, 01:22:55 PM »
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

Re: Help.. Arduino midi control change
« Reply #3 on: October 10, 2016, 07:33:48 PM »
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

Re: Help.. Arduino midi control change
« Reply #4 on: October 11, 2016, 02:32:21 AM »
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