/reaper_generic_control

A plugin for Reaper DAW, to use the KORG Nanokontrol2 control surface (and maybe some similar surfaces as well)

Primary LanguageC++GNU Lesser General Public License v3.0LGPL-3.0

Reaper Generic Control

A plugin for Reaper DAW, to use the KORG nanoKONTROL or KORG Nanokontrol2 MIDI control surface, and could probably support similar surfaces as well.

Why ?

So, I bought a MIDI control surface, KORG's Nanokontrol2. Nanokontrol2 I thought it would be somehow plug and play with my favorite Digital Audio Workstation Software, Reaper, but well... not so much. I found a few tutorials to make it work, but nothing worked as well as I hoped. So I made my own plugin, to have my control surface work just the way I want. I may very well have missed an easy and efficient way to make it work, but it was rather instructive anyway.

What is it ?

I looked at reaper's SDK, and discovered it was poorly documented and most existing control surface plugins shipped with it had button codes hardcoded all over the place, which is... well, not my favorite kind of code. So I decided to try to write my plugin without hardcoding MIDI codes. To do that, I made the plugin to use a simple json (text) list of the MIDI codes used by the control surface. This package is actually two-fold ; on one side, there is the plugin DLL and its folder of json MIDI codes presets, and on the other side is a super-basic console program that will assist you in generating a json preset. This code is compiled for 32 and 64 bit windows. Mac users, feel free to contribute !

Does it work ?

All buttons work, except for "Track previous" / "Track next" (what should I use them for ?). Reaper will send feedback and appropriately turn on/off the lights on your surface. The right-most controls are bound to the master.

How do I use it ?

  1. Modify your surface's behaviour, in Korg Kontrol Editor. We want the Cycle, Play, Record, and all the tracks' S, M, and R to be used as toggles. We also allow the leds control by our plugin (set LED Mode to External). You can do it yourself, or simply open the file I made which is available in the Dist folder. Dont forget to do Communications -> Write Scene Data to apply your changes ! Korg Kontrol Editor

  2. Copy the content of Dist/x64/Plugins/ to C:\Program Files\REAPER (x64)\Plugins (or wherever your Reaper plugins are installed). If you use a 32 bits version of reaper, use the 32 bits plugin.

  3. Launch Reaper. Open its preferences (Ctrl+P), browse down to Control/OSC/Web. Click Add, select Generic Surface Controller. Set your control surface as MIDI input and output. Select the json preset you want from the last list. Click OK. Reaper Preferences

  4. Play Music !

What about presets ?

Maybe my default preset won't be to your taste. For instance, I reserved the right-most track controls for the master, which may not be what you like. Or, you may usually work half of the time in Cubase or Sonar, and the other half in Reaper, and you don't want to reconfigure your surface all the time. Well, that's what presets are for. Use Dist/PluginPresetGenerator/control_surface_map_generator.exe to generate another preset suited to your needs, put the file in C:\Program Files\REAPER (x64)\Plugins\reaper_plugin_control_surface_generic_presets, select it in reaper preferences, and go back to playing music ! If you make a different preset that you're happy with, please share it back :)

What about the original nanoKONTROL ?

This is what the original nanoKONTROL looks like.

Nanokontrol

Unlike the (much better) KORG nanoKONTROL2 the original KORG nanoKONTROL lacked the marker set/cycle buttons and also has only two buttons per track which are not labelled. I've mapped the two buttons to SOLO and MUTE in each track. The per-track RECORD buttons on the nanonKONTROL2 are nice but SOLO and MUTE are more useful.

One quirk of the original nanoKONTROL is the SCENE button. This cycles through four scenes 1, 2, 3 & 4. There are 9 physical sliders/pots so you can control 27 different tracks.

But wait, surely four times nine equals 36 tracks? In another quirk the fourth scene has all 9 physical controls mapped to a single track. So this is by defacto the master track. In summary:

  • Scene 1 -> tracks 1 through 9
  • Scene 2 -> tracks 10 through 18
  • Scene 3 -> tracks 19 through 27
  • Scene 4 -> master track

The transport buttons (PLAY/STOP/REC/RWD/FWD/LOOP) are the same for each scene. But in yet another quirk, when you're using KORG Kontrol Editor to change the PLAY/REC/LOOP buttons from "momentary" to "toggle" you need to do it four times; once per scene. You also need to set "toggle" for each SOLO/MUTE button separately in each scene.

The file Korg_NanoKontrol_ReaperMap.nktrl_data has a pre-built configuration for KORG Kontrol Editor. Load it with File -> Load Scene Data File then write it to your nanoKONTROL with Communication -> Write Scene Set. Then all the buttons will be setup correctly and you're ready to go. Follow Pierousseau's instructions to install the plugin (.dll) and presets (.json) into your Reaper\Plugins directory and then select "Generic Surface Controller" and the "nanokontrol" preset within Reaper.

Could it work with my whatever control surface ?

I don't know ! But feel free to try, or to grab the code and modify it to adapt to your gear, and give feedback !

Licence

This work is covered by the LGPL3 License. Third parties include the Reaper SDK, and Rapidjson library, which are covered by their own license sets.

Within these licenses bonds, use freely, as long as you acknowledge that should smoke come out of your control surface, or out of your hands after a great jam, I'm not responsible.