tttapa / MIDI_controller

This is a library for creating a MIDI controller using an Arduino or Teensy board.
GNU General Public License v3.0
403 stars 70 forks source link

Add LED on/off with MIDI send #12

Closed devwmbr closed 6 years ago

devwmbr commented 7 years ago

Hello, I've decided to use your great library in guitar foot controller for Guitar Rig 5 project. May I ask how to turn on/off LED for momentary button during MIDI send? For example for Delay on/off or Reverb on/off. I button pressed, MIDI is send do Guitar Rig, LED is turned on. Press button again send MIDI and LED is turned off.

Regards devwmbr

tttapa commented 7 years ago

You could edit the source code for the Digital class to add this functionality. Or you could use my Control Surface library. It should be fully functional, but I haven't added the documentation yet, and the API will probably change a little bit in upcoming releases.

An example would look like this:

#include <Control_Surface.h>

const uint8_t noteNumber = 0x10; // Note number for delay effect
const uint8_t channel = 1; // MIDI channel 1
const uint8_t velocity = 127; 

const pin_t buttonPin = 2;
const pin_t ledPin = 13;

Digital delayButton = { buttonPin, noteNumber, channel, 127 };

MIDI_LED delayLed = { ledPin, noteNumber, channel };

void setup() {}

void loop() {
  Control_Surface.refresh();
}
devwmbr commented 7 years ago

Hi,

Thank you very much for answer. I edited your srce files and I added some methods as much as I possibly can. Everyday I develop in Asp.NET/C#, C++ is little bit difference with .h files.

I will attach my changes and results with LEDs and LCD tomorrow morning. I will look of course your proposal.

Thank you again devwmbr

My changes to Analog.h/Analog.cpp, Digital.h/Digital.cpp with comment: added by devwmbr Analog_Digital.zip screen of constructor in Arduino setup() method analog_digital

Idea of LED and LCD https://drive.google.com/file/d/0B1Np9JvtwnDYS05iMFQ3Qkt0U1E/view

devwmbr commented 7 years ago

Hello, Surface library is all-in-one with MIDI Controller within?

tttapa commented 7 years ago

Yes, they use some of the same files. The Control Surface library was created first, and then everything related to MIDI input was removed, resulting in the MIDI Controller library.