nanoKEY Experiments

All right, following up on this post. Playing around some more with my new KORG nanoKEY, which is a tiny USB-connected keyboard. I wrote a sketch that interprets the midi signal from the keyboard. When a tone is played, an object is created (in this case either a black or a white circle). While a tone is played, all objects originating from that tone grow in size. All objects also shrink at all times. The strength I use to tap the keys (velocity) affects the object’s initial location on the screen. So depending on how I play the keyboard, different visuals appear on the screen, which is what you can see in the video.

The midi signal is sent to Ableton Live simultaneously. I wasn’t feeling the audio though, so I decided to use another track instead. In the end it works out pretty well. Starting out purely as a proof-of-concept experiment, I didn’t really go overboard with the complexity of the visuals. I’m a sucker for circles anyway, but with the black-and-white the result is pretty stylish in my opinion. As usual the HD version can be found on Vimeo and I would recommend watching it full-screen. Enjoy 🙂

*UPDATE* Big thanks to for featuring my little experiment. Appreciate it!:D

10 Responses to “nanoKEY Experiments”
  1. Ian says:

    I am very very very interested in how you did this please please please send me instructions. I read the article you wrote about it and downloaded oscp5. Im using a mac and just can’t figure this out, i have a couple midi controllers that connect via usb, is there any way i could get your code it would be amazing, i love your work. Thanks so much

  2. Amnon says:

    It’s better to use the midiBus for this. Here is a basic code example of how to use it, so you can press a note on your midi device and have graphical effect in Processing. Use the line “MidiBus.list();” to find all available midi devices. Then change the line “myBus = new MidiBus(this,1,0);” to the correct midi device you want to use.

    import themidibus.*;
    MidiBus myBus;
    float x = 60;
    float targetx = 60;
    float adjust = 0.1;
    void setup() {
    // MidiBus.list(); // List all devices
    myBus = new MidiBus(this,1,0); // nanoKEY
    void draw() {
    x = (1-adjust) * x + (adjust) * targetx;
    void noteOn(int channel, int pitch, int velocity) {
    println("Pitch: " + pitch + " | Velocity: " + velocity);
    targetx = pitch;

  3. R.Torre says:

    Thanks a lot for this code! is just what i needed…. i follow you experiment and your blog usally…is a good resource!! ;)) best from Spain!

  4. HVP says:

    Nice works (not only this one)
    What’s the Philip Glass’s track?

  5. johnbrindle says:

    Hey there, I am trying to trigger multiple objects at the same time (much like you have done in the above video, except with images). I am having difficulty making processing display more than one object when multiple MIDI keys are pressed though. What was your method to draw multiple circles when multiple keys are pressed?

    I am currently using if statements as such;

    if (x == 67) {
    image(leftimg, 0, 0);
    } if (y == 60) {
    image(rightimg, 200, 0);
    } if (z == 65) {
    image(bottomRight, 0, 200);
    } if (v == 63) {
    image(bottomLeft, 200, 200);

    Any input would be appreciated, I enjoyed experimenting with your circle above!



    • Amnon says:

      I used an array of booleans, like this:

      boolean[] noteOn = new boolean[128];

      Then for a certain midi key (aka pitch) the boolean for that note would be set to true, until the key was released.

      void noteOn(int channel, int pitch, int velocity) {
      noteOn[pitch] = true;
      void noteOff(int channel, int pitch, int velocity) {
      noteOn[pitch] = false;

%d bloggers like this: