openAVproductions / openAV-Luppp

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

Mappa initial implementation #241

Closed harryhaaren closed 5 years ago

harryhaaren commented 6 years ago

This commit is the first commit to support Mappa, the "mapping" solution from the Ctlra project.

The code here implements two targets as callback functions, making use of the Mappa "token" when registering a target. The track-id is stored in the token, allowing easy identification of the software parameter to tweak.

The main UI thread polls the mappa library, which internally handles all Ctlra APIs. The application sees its callbacks being called when a control surface is moved. The callbacks are invoked in the same thread as that which calls mappa_iter().

The mapping from control-surface to software-target is done using a simple .ini file, which the user supplies. The format is still in flux, but the basic structure is not expected to change.

The user provides multiple "layers" of mappings, and Mappa provides a mechanism to switch between these layers on the fly. This enables complex multi-layered controller setups, without any application logic complexity.

Note that the latest commit from the Mapping PR of Ctlra is required in order to get access to mappa.h, see details of PR here: https://github.com/openAVproductions/openAV-Ctlra/pull/87

This resolves the following Ctlra issue to do real testing with Luppp: https://github.com/openAVproductions/openAV-Ctlra/issues/90

Signed-off-by: Harry van Haaren harryhaaren@gmail.com

georgkrause commented 5 years ago

@harryhaaren Where can I get an information how to use this? I managed to built, but don't know what to do now...

coderkun commented 5 years ago

Based on @harryhaaren’s feedback I can report some progress in testing this branch:

To use a virtual device I started Luppp with the two environment variables CTLRA_VIRTUAL_VENDOR and CTLRA_VIRTUAL_DEVICE (together with LD_LIBRARY_PATH for starting Luppp without installing AVTKA globally):

LD_LIBRARY_PATH=~/.local/lib/ CTLRA_VIRTUAL_VENDOR="Native Instruments" CTLRA_VIRTUAL_DEVICE="Kontrol Z1" ./luppp

Additionally I copied the ini-file from the PR to the build directory. To get rid of some error messages, I also had to add the section [mapping] with layer_count = 2 to the ini-file as well as a name key/value pair to [layer.0] and [layer.1].

With these changes I was able to start Luppp without error messages from Ctlra/Mappa. However using any control element on the virtual device did not effect anything in Luppp and vice versa. Maybe I selected the wrong virtual device or the ini-file does not match the device? Or am I doing something wrong here?

harryhaaren commented 5 years ago

Good progress!

There needs to be actual mappings in the file itself, making Mappa bind the application "target" to the hardware device name. Current script that is commited in the repo is probably out of sync... That said, the Mappa create() API has recently changed - so I need to refactor and sync some things before pushing fixes.

So, for now it looks like there isn't anything worth testing here right now - I'll keep yee posted.

georgkrause commented 5 years ago

@harryhaaren Is there any progress here or can you give us some pointers how to finish this?

harryhaaren commented 5 years ago

THere is progress in general with Ctlra, absolutely yes. I'm not 100% that Mappa is the correct solution - while I believe it to be a very good (technical) solution to the mapping problems, many developers I talk to seem to be hesitant and have concerns over if it will really work.

I'm focussing on enabling Ctlra more first, and will revist Mappa as a mapping solution at a later time. Hence, for now the Luppp/Mappa integration (although I still feel it to be very good solution) has become dormant for now. I'll close this - but will re-open when Mappa/Luppp is re-started at a later date.