openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
258 stars 45 forks source link

Bind MIDI-event to FL_Right, _Left, _Up and _Down? #167

Open mathiasfriman opened 7 years ago

mathiasfriman commented 7 years ago

First of all, thank you for the brilliant software, it has made music creation on Linux fun again, at least for me! :)

Not sure if this is possible or not, but if it is not, I would like to make a feature request:

I own a Novation Launchkey 49, which has a couple of faders and knobs, and also a couple of scene keys that I've successfully bound to control recording on tracks 1-8 in Scene 1. Also, the volume faders and knobs work splendidly! :) However, I would like to use keys present on the Launchkey to step around in the grid, and also utilize the scene start/stop buttons.

However, I'm unsure how to bind them, in the gui I can bind the scene keys to start and stop e.g. Scene 1, but not use the same keys to start Scene 2 if I haven't missed something vital.

Is it possible to "hack" the ctlr file and add these options in some way?

Sorry for the vagueness, I'm quite non-technical with these things..

harryhaaren commented 7 years ago

Hi Mathias,

Thanks, glad to hear you're having fun!

Perhaps you've found a bug, perhaps something isn't quite right in the mappings - I've been working on a new and more powerful/flexible way of mapping controllers to audio software - stay tuned to OpenAV stuff for details :)

Yes you can "hack" the controller file to your hearts content - ~/.config/openAV/luppp/controllers/ should have a .ctlr file, which is JSON. Its auto-generated, and a little hard to understand at first... If you have an understanding of MIDI messages that will help greatly!

I don't fully undertand why you want to bind to FL_Right / Left / Up / Down, would you mind explaining why? Cheers, -Harry

mathiasfriman commented 7 years ago

Well, I saw this below in ´src/gui.cxx´:

    // keyboard arrows to special key mapping
    if ( Fl::event_key( FL_Left  ) ) {
            EventGridSelectNewChosen e( gui->specialTrack-1, gui->specialScene  );
            writeToDspRingbuffer( &e );
            return 1;
    }
    if ( Fl::event_key( FL_Right ) ) {
            EventGridSelectNewChosen e( gui->specialTrack+1, gui->specialScene  );
            writeToDspRingbuffer( &e );
            return 1;
    }
    if ( Fl::event_key( FL_Up    ) ) {
            EventGridSelectNewChosen e( gui->specialTrack  , gui->specialScene-1);
            writeToDspRingbuffer( &e );
            return 1;
    }
    if ( Fl::event_key( FL_Down  ) ) {
            EventGridSelectNewChosen e( gui->specialTrack  , gui->specialScene+1);
            writeToDspRingbuffer( &e );
            return 1;
    }

I thought one could use the arrow keys to move around the grid. But I don't know how to get the desired effect using the "Bind enable" button to bind them to the launchkey buttons. Pardon the confusion :)

harryhaaren commented 7 years ago

Aha - I see why that seems logical, but its not the approach that MIDI binding takes..

The User interface code is totally sepereate from MIDI bindings. The MIDI bindings allow to "sample" a new special clip, by press-and-hold a "shift" MIDI button, then press the sampled clip, and release the shift button.

It is not currently possible to bind this using the UI - you will have to hack the .ctlr file manually... please look at the APC example here: https://github.com/openAVproductions/openAV-Luppp/blob/master/resources/controllers/akai_apc.ctlr#L17

Do you have an understanding of MIDI messages? It is required to understand the messages from your controller, and to put them in the .ctlr file. Make sure to run Luppp from the command-line, as it prints errors when the loading of a .cltr file doesn't succeed.

Hope that helps you on your way a little! -Harry

georgkrause commented 6 years ago

Anyway, it should be possible to move the special clip by midi. i think ctrla could do this?