hairless-midiserial icon indicating copy to clipboard operation
hairless-midiserial copied to clipboard

only hairless midi in to see Arduino led changing according software output information master out level

Open fredOnGitHub opened this issue 5 years ago • 0 comments

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. 1

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. 2

Traktor setting for "Master Out Level" 3

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)
        }
    }
}

/**************************** end of the pgm **************************/

fredOnGitHub avatar Mar 21 '19 07:03 fredOnGitHub