qKontrol - an open source mapping editor for the Komplete Kontrol MK2 on Linux and Mac

Discussion in 'KOMPLETE KONTROL SERIES' started by GoaSkin, Aug 11, 2018.

  1. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Another update permits now to configure four pages of knob / button assignments which can be switched using the arrow buttons on the MK2.

    Furthermore the source code has been cleaned and simplified. The same functionality requires much less lines of code now. Thus, the CC value illustration when you turn the knobs is much faster now.

    An updated download is attached to the first posting of this thread.
     
  2. EduCampi

    EduCampi New Member

    Messages:
    5
    Hey, Thanks for this.
    Any chance to upload to GitLab or GitHub?
    That could help with contribution, news, feature requests, etc..

    thanks!
     
  3. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    I thought about sourceforge. Maybe, github is also OK. But before making this project "more public", it would be a good idea to provide a proper legal and license information. I don't know if an included license file is enough or if any included source file must include some information as comment; how 3rd party code needs to be credited and so on.

    I don't have much experience with these formalities.
     
    • Like Like x 1
  4. Marco Forlin

    Marco Forlin New Member

    Messages:
    2
    Hi GoaSkin,

    great job!

    My use-case is slightly different than yours, I was hoping the KK had better "midi only" functionality, and had not understood it's totally un-configurable when not using the SW Komplete Kontrol. This is a problem because I often don't want to turn on my PC and just control HW synths. I was just thinking about selling my S49 mk2.. (pity because NKS control is great)

    My idea was then to use your SW on a (headless) raspberry pi. Unluckily, I'll have to wait until I am back home to try things out.

    However, a couple of suggestions:
    - it would be cool (at least for me) to have an "editor only" (stripped of any HID and USB dependencies) and a "daemon" (stripped of UI). The idea would be of generating the xml preset even on other platforms, and then launch qKontrol at boot on headless raspi.
    - given that you're already setting the color of the keys, it wouldn't be too unthinkable to add the scale visualisation (not mapping) using the light guide (i.e. by switching off the light on out of scale keys). This could be done independently of the split, thus extending a functionality that is missing on Komplete Kontrol itself (no scales on midi mode). I guess the main question is how to select the scale...

    Let me know your thoughts.

    I might give these ideas a shot depending on how much time I have. If you put the code on github contributions/forks would be indeed easier :)

    thanks a lot for your work so far, cheers
    Marco
     
  5. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Hello,


    in one of the next update, I planned to make it possible to use the preset up/down keys to browse all saved preset files which are placed in a specified directory. This is no separated daemon / frontend solution but it would make it possible to use the program without paying attention to the UI. Then, the program may be started on a RPi using a dummy X-Server like xvfb with the behavior like a daemon.
     
  6. s.sameer

    s.sameer New Member

    Messages:
    6
    GoaSkin truly impressive job you're doing & really appreciate your efforts.

    I'm not sure if you're planning to make this possible for windows too, I'd love to have an editor like this
     
  7. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    The source code should compile under Windows too and also under Mac OS X. It is based on the QT framework which make it possible to get native Linux, Windows and macOS applications using the same source code.

    The barrier in this case is the Komplete Kontrol software by Native Instruments. It starts a system service which claims the device to provide a middle where which is used by the frontend software. It may be (what not means must be) that a windows binary of the software cannot open the device because it is blocked by another process.

    In the worst case, the Komplete Kontrol software must be deinstalled before this software is usable under windows.

    I will try it out when I have the time but currently I don't have set up any development enviroment under windows.
     
    • Like Like x 1
  8. Marco Forlin

    Marco Forlin New Member

    Messages:
    2
    Hi, yes if it loads the preset at startup and doesn't need fiddling on the UI then it's as good as a daemon to me.
    I think it doesn't actually need to run headless for what I am doing, xserver should be fine.

    For generating the presets, I guess doing it on the RasPi is not too bad either. I'll give it a shot in a few days.

    Marco
     
    • Like Like x 1
  9. s.sameer

    s.sameer New Member

    Messages:
    6
    Appreciate it mate, that's right, the NI service is taking control. My main purpose from such editor is to remap certain buttons since they are having MCU support, also that I use KK S61 MKII as a standalone master keyboard.
     
  10. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    I tried to build the program on windows but I did not manage it to compile the hidapi library as a static library which is used for the HID I/O. If anybody wants to compile it, the following dependencies are required:

    If anybody wants to try to build it, the following dependencies are required to compile it for windows:

    minGW or visual studio
    the QT framework, version 5 (open source edition): https://www.qt.io/
    hidapi: https://github.com/signal11/hidapi
    libusb: https://libusb.info/
     
    Last edited: Jul 22, 2019
    • Like Like x 1
  11. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    While I still did not manage it to get the code compiled under WIndows, I tried it under Mac OS X. The program compiles well if you install libusb and libhidapi using the brew repositories.

    The good news it that it is possible to change all the MIDI mappings and also the lightguide and button colors - even if the system service by Native Instruments are running, so they don't disturb anything. In other words deactivating or deinstalling the Komplete Kontrol software isn't neccessary to use this.

    The bad news is that the libusb calls to transmit RGB16 bulk data to the displays don't transmit anything to the USB device. The bulk data transfer function returns an error code that means "no such device" but the device was opened as usual before and a device handle exists.
     
    Last edited: Jul 16, 2019
    • Like Like x 1
  12. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Finally I got the software working on macOS X.

    qkontrol_mac.png

    libusb had to be treatened a little bit different than on Linux (one different character in one line of the source code, really).

    Furthermore, three system processes need to be terminated before the program will be working after startup but I will provide a shell script that will do that with one prior click. And they will be re-opened automaticly if you start the Komplete Kontrol software afterwhile, so don't worry. No reboot or anything complicated required.

    I will post a binary file later because actually it works only if a full installation of the QT framework exists in your system. A few libraries need to be bundled.

    A windows port is more complicated and far away.
     
    • Like Like x 2
  13. s.sameer

    s.sameer New Member

    Messages:
    6
    Brilliant work! This is going to be very useful for some users!

    And for posting to Windows, hopefully it will find its way to realized :)
    Thanks for your efforts
     
  14. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Problem with Windows it as first that the compilation of the QXT widgets (slider with two handles and spinbox) fails with an error under Windows for an unknown reason. But the bigger point is that Linux and macOS allow a driverless communication with USB devices but not Windows. libusb can be used under Windows if the winusb-driver is installed and configured to claim the device. That is a more complicated case.

    A redistributable version for macOS which does not require a QT installation has been created but not tested very much yet.
     
    • Like Like x 1
  15. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    macOS port is ready... See first posting to download!
     
    Last edited: Jul 22, 2019
    • Like Like x 1
  16. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Here is it: A raspberry version which permits to use the preset keys to zap preset files. After startup, you need to open a preset file from a directory where others are also placed and then, you can zap them alphabetically using the preset keys.

    But it is very slow on my RPi3+. It requires around 3 seconds to update one of the displays but miliseconds on a PC.

    The updated file in the first version includes the raspberry PI version now.
     
    Last edited: Jul 22, 2019
  17. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    The download attached to the first posting has been updated.

    The ZIP file there includes binary versions for Linux (PC and raspberryPI) as well as macOS beside the source code.


    improvements:
    - macOS and raspberry PI support
    - after a preset is opened, other preset files in the same directory can be browsed using the preset keys
    - when defining keyzones, you can also switch off the LEDs for a specific zone instead of selecting a light color by force
    - the name of the open preset file is displayed in the window title bar
    - some bugfixes
     
  18. D-One

    D-One Moderator Moderator

    Messages:
    6,541
    The Mac version works pretty well from my testing, amazing work dude, congrats, extra kudos for making it cross-platform! :thumbsup::thumbsup::thumbsup:

    Do you own other NI gear by any chance?
    I would love to mess around with something like this for maschine + a Raspberry Pi 4, for a DIY standalone drum-machine project.
     
  19. GoaSkin

    GoaSkin NI Product Owner

    Messages:
    125
    Sorry, I don't know other NI hardware. But it is known that the protocols of the Komplete Kontrol MK2 and Machine MK3 are almost the same, so it should be possible to create a fork of this program to control the Maschine MK3.
     
  20. gsdt45

    gsdt45 New Member

    Messages:
    3
    First many thanks to the developer for writing this app. I did try to compile the source on Mac OS 10.13.6 and note the following. "brew install libhidapi" is now "brew install hidapi". That distribution is now at rev 0.9.0 release instead of 0.8.0-rc1 (release candidate 1), so I had to make a soft link under /usr/local/Cellar/hidapi from 0.9.0 to 0.8.0-rc1 as it did not work to do "brew install hidapi@0.8.0". When using the Qt downloader application you get a choice of kit distributions with the latest being 5.13.0. But I got compile errors with that version. At that point I decided to try and run the provided .app bundle and it worked, but maybe you could post the version of Qt you built against.

    Apologies if I am missing something, but I was wondering if you might consider adding an entry for the "first note" of the MIDI zone in addition to the current "last note" entry? Or I often need to have overlapping zones that transmit on different MIDI channels, so there might be only 1 MIDI channel for a bass zone, but there could be 3 different MIDI channels that need to receive data for the treble zone (where the treble zones go from say E3 to G8). I'm not sure what the LED's would show for a color with overlapping MIDI zones but, maybe they would just default to show the same color, or the LED's map to zones but not distinct MIDI channels when zones overlap. or overlapping zones could just default to the last color you assigned to the same range of notes.

    It's a shame that NI did not build in more MIDI controller functionality and also that template files cannot be downloaded into the keyboard so it can run them independent of having a USB connection.