OSC Virtual keyboard

So, I came across an amazing feature that OSC offers:
Virtual keyboard.

I was able to do the most basic thing which is to define the number of keys to correspond with my synth key but that’s pretty much it. I have no idea how to make the keyboard actually correspond or sync with my synth keyboard.

Can someone kindly post a step by step guide on how to make the keyboard respond to the synth and vice versa. Can keys pressed show that they are pressed in the OSC keyboard? Can the keys be highlighted? Colored?

And finally: a complex question will be whether there’s a script that will show the chord being played based on the group of keys being played? Or other features that you might think of. I’m trying to determine how far the keyboard capabilities can be stretched?

Thank you so much

Did anyone created a keyboard layout in his template?

Can anyone show me in the documentation how to set it up?

I assume you mean "virtual piano keyboard". To make it send notes, set the keyboard widget's properties as follows

When pressing keys, the widget will send messages of the form:

/note PREARG NOTE_NUMBER ON_OR_OFF_ VALUE

As per the documentation, these will be converted to MIDI note events.

Can keys pressed show that they are pressed in the OSC keyboard

If you're keyboard's events sent to the midi port used by the keyboard widget then it will, but only if the velocity matches the keyboard's "on" value.

Can the keys be highlighted? Colored?
And finally: a complex question will be whether there’s a script that will show the chord being played based on the group of keys being played?

With css and most likely a custom it's probably possible, but there's no official way to do that.

1 Like

Highly appreciate your detailed response jean!

I’m almost there but I think I’m missing something: See picture for the settings i entered

  1. Created a keyboard and defined key range
  2. Entered /note
  3. preArgs - I placed this : [1] - To indicate channel 1

Nothing works… :pensive:

Since on is set to 1, you’re sending notes with a velocity of 1, which is very low, try with 100. Enabling the server’s debug option will help checking what O-S-C sends.

1 Like

Thank you for replying so promptly jean!

Ok, something definitely worked, LOL

  1. the keys on the virtual key (in OSC) trigger sound on my synth but my synth keys do not show in the virtual keys
  1. probably because of this:

You are absolutely correct!
As an experiment, i hit one key on my synth and at the same time looked at OSC. I try to hit it in different strength until the velocity 100 (the one i input in settings) was met. Then for a split of a second i saw the key in the virtual keys light up !!!

So, how do i setup the virtual keys to respond to ANY velocity coming in from the synth?

You can write a custom module to convert incoming values from this midi port on address “/note” to force them to always match the “on” value (don’t filter the value “0” though, or the keys won’t turn off). This example could get you started : Examples - Open Stage Control

1 Like

I will look into it and try to do it to the best of my ability. Do i place the script in the “script” function of the widget?

No it’s a additional file that must be loaded when the server starts :

Custom module - Open Stage Control (edit: link fixed)

Capture_2021_01_11_11_47_57_636

Link broken

Now i know that every time people say Custom module they are refereeing to this- Good to know :slight_smile:

1 Like