New library: Control and tweak your sketches using MIDI controller Novation Launch Control

Hello! I frequently like to play with changing the parameters of my sketches, and after experimenting a little I came up with a good solution using the MIDI controller Launch Control, which has 16 knobs and 8 pads. Useful when you want to fine tune your sketch, or make something interactive without polluting the screen with the GUI controls. Probably useful for VJs too :D The library provides events for when the values of knobs and pads have changed, during which you can e.g. adjust variables:

void launchControllerKnobChanged(KNOBS knob) {
 println("Launch Control knob changed: " + knob.name());

 //maps r to the value of the first knob
 //getKnobMap() is the same as:
 //r = map(controller.getKnob(KNOBS.KNOB_1_HIGH), 0, 127, 100,500);
 r = controller.getKnobMap(KNOBS.KNOB_1_HIGH,100,500);
 m = controller.getKnobMap(KNOBS.KNOB_2_HIGH,0,100);
 lat_start = controller.getKnobMap(KNOBS.KNOB_3_HIGH,-HALF_PI,0);
 lat_end = controller.getKnobMap(KNOBS.KNOB_4_HIGH,0,HALF_PI);
 lon_start = controller.getKnobMap(KNOBS.KNOB_5_HIGH,-PI,0);
 lon_end = controller.getKnobMap(KNOBS.KNOB_6_HIGH,0,PI);
}

The source code is at https://github.com/haschdl/pLaunchController

Tagged:

Comments

  • edited March 2018

    Hi! Thank you for sharing! May i ask you a question? Is this library may be used only for this MIDI controller? I copy the library, but Processing still don't see it. Or maybe the problem is because i have Novation Control XL MK2? Thank you!

  • Hello @olyaionina! Unfortunately the current implementation works only with the Novation Launch Control (something in my code makes it work only if the MIDI controller is called "Novation LaunchControl"). What I can do is to remove the name of the device, and maybe something will work :D If you'd like to try that, please send me a private message ok? I can create a separate version on the code in Github.

  • If you are trying to get this working with any MIDI controller, and not that specific one, you can use the library TheMIDIbus.

    Install from PDE Contributions Manager, or from http://www.smallbutdigital.com/projects/themidibus/

    Header:

    import themidibus.*;
    MidiBus myBus;
    

    In setup():

      // List all our MIDI devices
      MidiBus.list();
      // Connect to input, output
      myBus = new MidiBus(this, 0, 1);
    

    Generic event handler function:

    // Called by TheMidiBus library each time a knob, slider or button
    // changes on the MIDI controller.
    void controllerChange(int channel, int number, int value) {
      println(channel, number, value);
      if(number == 23) {  // korg nanoKontrol scene 1, button 1 top
        // do something with value
      }
      if(number == 33) {  // korg nanoKontrol scene 1, button 1 bottom
        // do something with value
      }
      if(number == 2) {   // korg nanoKontrol scene 1, slider 1
        // do something with value
      }
    }
    

    Tested with a Korg nanoKontrol and nanoKontrol2.

Sign In or Register to comment.