Switching LEDs with CC

Hi all,

 

I’m trying to configure my MIDIbox to work with FL Studio, and so far I’ve successfully mapped outputs from the box to control knobs and switches in FL. However, I haven’t had any luck in sending feedback to the box to trigger LEDs to light up.

 

FL has a plugin called ‘MIDI out’ which allows you to send CC, RPN or NRPN bytes to an external MIDI device. My firmware has only been configured to switch LEDs in response to note events. Does anyone have any suggestions how I can take CC, RPN or NRPN bytes being sent from FL and translate them into note events so the LEDs light up on my MIDIbox?

 

Ideally, I’d like to configure FL so it sends out a separate CC for each LED (on channel 2, as 1 is used for my pots and encoders). A CC value of 0 would turn off the LED, while 127 would turn it on.

 

Thanks

Hi Triffki,

what Midibox do you have? Midibox NG or Midio128?

Best regrads

marxon

Hey, its actually a custom design based on the MIDIbox 64 with 1x Core8, 3x DOUT, 4x DIN and 2x AIN modules. I used the SDCC skeleton for the firmware.

 

Thanks

Did you already notice this page: http://www.ucapps.de/mios8_c.html ?

There is an example how LEDs can be controlled via MIDI.

 

Best Regards, Thorsten.

Hey, yes thats the code I’ve been using. But it only covers note events; can it be adapted for CC events too?

Of course, e.g.:

 

if( evnt0 == 0xb0 ) { // listen to CC Channel 1
        // the CC number selects the pin:
        unsigned char pin = evnt1;
        // and the CC value turns the LED on or off
        unsigned char value = (evnt2 >= 64) ? 1 : 0;
        // finally set the LED:
        MIOS_DOUT_PinSet(pin, value);
    }

 

 

Best Regards, Thorsten.