How to lit in nanoKONTROL2

I’m using a nanoKONTROL2 to control the volume and the on/off of the instruments/plugins but I would like to be able to say for example when I pressed a button (m) in this case to be able to have that button lit in the nanokontrol2 so I can see it instead of the computer so that way I know for sure what plugins are active or no active. I hope you understand what I’m trying to accomplish here.

Thanks in advance

P.S. I’m new to GP

I don’t know, but maybe this post will give you a head start (I often search the forum to try to get information):

Jeff

Thanks for your reply Jeff

The problem I have when I pressed a Button, I get this 2 values on/off is there any way so it can show only one value(light on) or off when I Press it?

I can put this to “toggle” on the nanoKONTROL2 but then I have to press the button twice(2) to stay on and to go off.

Any help will be really appreciate it

Look up “momentary” in the forum and manual. You might just need to change that setting.

The nanoKontrol2 puts out note-off in the form of note-off with velocity of 0. For LED’s to turn off, it requires a different form of note-of which is a note-on with a velocity of 0.

The below script will toggle the value of the LED of any button pushed. You have to define the names of your MIDI In and MIDI out blocks. I just named them “nk2in” and “nk2out”. I toggle a single value so if you need to track multiple notes, each button would need to have its own toggle value

Var 
  nk2in: MidiInBlock
  nk2out: MidiOutBlock
  toggle: Int
  value : Int
  notenum: Int
  midichan: Int
  message: MidiMessage

On NoteOnEvent(m : NoteMessage) from nk2in
    notenum = GetNoteNumber(m)
    midichan = GetChannel(m)
    toggle=!toggle
    Print ("Value is " + toggle)
    if toggle <0 then value = 127
    else value = 0
    End
    message = MakeNoteMessageEx(notenum,value,midichan)
     SendNowExternal(nk2out,message)
End

SteveC

Sorry but where should I add this, I get an error when adding it to global rackspace

I put it into one of my local rackspaces.

I modified it to only recognize C-1

Var 
  nk2in: MidiInBlock
  nk2out: MidiOutBlock
  toggle: Int
  value : Int
  notenum: Int
  midichan: Int
  message: MidiMessage

On NoteOnEvent(m : NoteMessage) from nk2in
    notenum = GetNoteNumber(m)
    midichan = GetChannel(m)
    value = GetVelocity(m)
    if notenum == 0 then
           Print ("toggle =" + toggle)
           toggle=!toggle
           if toggle<0 then value=0 else value = 127 end
     End // if notenum=0
    message = MakeNoteMessageEx(notenum,value,midichan)
    SendNowExternal(nk2out,message)

End

I tested it with a button widget

I think if you have the proper input and output blocks in the global rackspace it should work but I haven’t tested it there.

SteveC

sorry for not understanding but I’m having too much problem to catch this around my head

Global rackspace in this gig file. Just a demo.

nk2-demo.gig (97.7 KB)

I changed from momentary to toggle (in nanoKontrol Editor) everything is working fine but now when switching rackspaces the button in nanoKONTROL2 is not changing with the new rackspace.

Ex: if rackspace1 has button1 and button2 lights ON, when I switch to rackspace2 button1 stays (light ON) even if the widget that belongs to button1 is off.

I don’t know if you are understanding my issue

but my button in nanoKONTROL2 stays off

You just want to update the LED on your NanoKontrol2 right? That is all I’m fixing here because sync doesn’t work because off sends the wrong kind of message to the NanoKontor2.

The script makes sure that proper MIDI message goes back to your controller. That is all it does.

You need to learn the button from your NanoKontrol 2. I have C1 which is R on MIDI CH 1 or our you can change the note number if you want in the script.s

The button should be Momentary to Latching and Thru to make sure the MIDI message gest through to wherever you wanted the original MIDI message to go. You may need to select a plugin to control with the button which I did not.

Attach your gig file and the note number and MIDI channel you are using on you NK2. Make sure it is set to momentary, not toggle. I’ll take a look.

Steve

FYI,
If you only need to recognize a single note, then consider adding a matching clause,

On NoteOnEvent(m : NoteMessage) matching C-1 from nk2in

That will save you from having to test the incoming note and so will be significantly more efficient because the system will only invoke that callback for C-1

Apparently you didn’t name your MIDI IN and MIDI OUT blocks.

Thanks @dhj , forgot about this clause. Not sure if he will be mapping more buttons on the future though. We’ll see.

nk2-demo(2).gig (108.5 KB)

I want to map the 24 buttons it has(nanoKONTROL2)