LOGICAL MIDI QUESTION

Hello,
I’m trying to do this circuit (see image attached).
At the moment I can send & receive midi message, everything works.

If I push the Button 1 I can send the midi CC 21 to the external midi device, and that’s it ok.

If I push the Button 2 I can send midi CC 20 to the arduino and change the Relay and led status.

What I have to do is to use the button 1 to switch on the relay and the led keeping updated the external midi device.
So my question is, which way is the right way?

  • Change the Button 1’s midi cc from 21 to 20? (could I have a midi loop problem?)
  • Activate or deactivate the relay and led by a simple digitalWrite?

I can’t figure this problem out…

I’m using the midi library and the controller.h library (http://www.notesandvolts.com/2016/03/arduino-midi-controller-potentiometers.html)

The way this is handled by most MIDI controllers is as follows:
When the user presses the button (1) on the controller, a MIDI message is sent to the external device. The device then sends a MIDI message back to the controller, and the controller changes the state of the LED.
When the user presses the button (2) on the external device, the device sends a MIDI message to the controller, and the controller changes the state of the LED.

Pieter

So what I need is just to use the same CC message for button 1 and 2 right?

Yes.

Whether that will work or not depends on the external device.

Thank you a lot pieterP!
I will try this solution!
Thanks again!

Hi Pieter,
finally I've tried your solution but it doesn't work.
When I push the button 1 the external midi device receives the MIDI message but it doesn't respond (I guess..) with a MIDI message. So.. the led doesn't lit.
When I push the button 2 the external device sends the MIDI message and the led switch on.
I can't use this solution I think.

Any idea?