hairless-midiserial
hairless-midiserial copied to clipboard
only hairless midi in to see Arduino led changing according software output information master out level
Hello,
version : http://projectgus.github.io/hairless-midiserial
With only « Midi in » that’s the good result : when Traktor is stopping playing the led turn off.
But when I put « Midi in » and « Midi OUT » the led is frozen and when Traktor is stopping playing the led doesn’t change his state.
Traktor setting for "Master Out Level"
Thank you for your help
/**************************** Here the pgm **************************/
#include <MIDI.h> // Add Midi Library
#define LEDPWM6 10
//Create an instance of the library with default name, serial port and settings
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI); // Initialize the Midi Library.
// OMNI sets it to listen to all channels.. MIDI.begin(2) would set it
// to respond to notes on channel 2 only.
MIDI.setHandleControlChange(f); // This command tells the MIDI Library
// the function you want to call when a Continuous Controller command
// is received. In this case it's "f".
//analogWrite(LEDPWM6, 255);
Serial.begin(115200);
}
void loop() { // Main loop
MIDI.read(); // Continuously check if Midi data has been received.
}
void f(byte channel, byte number, byte value) {
if(channel == 2)
{
if(number == 3)
{
analogWrite(LEDPWM6, value*36);//252 max (7*36)
}
}
}