LED Key Zones or What Happens When You Are Bored

One of the things I have missed from “the program that shall not be mentioned”, is the keyboard split and layer indication. Some of the music I play has some complex splits and layers going on, it would be nice if I could get a reminder of where they are, especially when the songs are recently learnt.

I did like the look of the NI Kontakt Komplete Kontrol as it has LEDs that can indicate the zones, but more keyboards, the wife would leave me. I am happy with the boards I have, for live use and at home, so an idea popped into my head. Off to AliExpress…..

I bought a bundle of 10, RPi Pico boards (small but capable development boards) for 15 quid, then a string of Neopixels, again about 15 quid. The neopixels were 144 pixels per metre, which was pretty close to twice what I needed. When they turned up it was 72 pixels per 0.5m with a joint in the middle. To be fair the blurb did say there was a joint but it does remove the linearity every 500mm.

So the plan is to build a prototype on my ageing Kurzweil K2500, of a LED strip that I can use to see the zones. I am not planning to integrate it into the K2500, but it must fit to any board. Secondly it must work with Gig Performer and not destroy any of my rig functionality if the Led strips are not fitted. At this point I will say that the K2500 and my Korg Triton both have GP patches that simply make them simple controllers, I do not rely on splits/zones or sounds from the keyboards, all zone control is from within GP.

A bit of programming later ……

I now have the first prototype fitted to the K2500 (ignore the spare wires). Using every other LED was almost spot on, but when it came to the join then it ran off the key alignment. I decided to break the join and remake it to get the alignment back, this involved lighting the two adjacent LEDs across the new joint, so the note to LED mapping was now slightly complicated.

After a couple of tries I ended up with the 88 notes covered in three sections of LED’s but the nature of the neopixels is, they all just work as a linear array regardless of where the joints are. The software on the RPi Pico can deal with the complication. Some basic testing looked good so I ploughed on.

On the Korg Triton the keys are fractionally narrower and a slightly different approach was needed to hold the alignment, this time the neopixels were cut into octave lengths (23 pixels) with each odd position used, this limits the runoff and the difference is adjusted at the join every octave, so helping to keep the alignment.

The octave splitting/joining technique will work for any size board and provides a consistent (although not linear) note to LED mapping regardless of size. The LED strips have a fairly low tack self adhesive strip on the back and can easily be removed with no damage. So, I will redo the K2500 at some point, using the same scheme, but for now the RPi Pico can deal with the differences.

So with both my keyboards retro-fitted with “KeyZone”, it was time to delve into GP and get it working. It turned out to be very simple and does not require any scripting. The following shows the various zones being selected as I move through the song parts. A short video is here,

I decided to organise the colours, based on type of sound or source, White Piano, Orange Mellotrons, Yellow Sequencers and Arps, Green Pads, Purple Organs, Red hard leads, Less Red soft leads, and Blue Percussive and Chimes. I was pretty pleased with the results.

Global Rackspace

The RPi Pico is powered by USB and has a USB-MIDI interface that can be seen as a MIDI device within Gig Performer. The first thing was to get note on and note off to go to the Led strips, regardless of patch and zone and very importantly transpose. This would be optional if you didn’t want to see any key press indication.

In the global rackspace I added this straightforward wiring. This simply routes everything from the Rig Manager keyboard alias’s MIDI In to the MIDI Out, one per keyboard.

The settings on the MIDI In blocks are identical for both units. They just filter out everything except note on and note off messages. The “Ignore global transpose” must be selected.

There is one more piece to be completed in the MIDI Out blocks. SysEx messages are added and the “Reset on deactivation” option must be selected. Rechannalising does not matter as the LED strip responds in omni mode. The information in the SysEx message is slightly different in each block depending on the keyboard it is fitted to. This is used to initialise the units when loading a gig file and to turn off the units when closing a gig file.

Local Rackspace

The implementation here was even more straightforward than the global rackspace. Two MIDI out blocks are added, one for each keyboard. No wiring is needed to these blocks.

Each output block is set up with “Reset on deactivation” selected and a SysEx message added. The SysEx message is sent when the rackspace is selected. Each SysEx message is slightly different and is used to define the zones used on that keyboard.

No alterations were made to my existing Rackspace wiring.

Rackspace Variations

In order to turn on and turn off the zones a number of CC messages can be sent to the RPi Pico, this allows various zone combinations to be selected as the rackspace variations are changed. A single widget one per keyboard is added to the panel and mapped to the CC message that enables or disables the zones. Optionally a widget per zone could be added to give a simpler user interface, but it is far more complex graphically but this is achieved without scripting. One interface per keyboard is required.

Cool Features

When a key is pressed, the LED for that key brightens, so what…..

The note on brightness can be selected, this means that the note could be dimmed or set to go off, when pressed, or by setting the note on brightness to the same as the note off brightness the note indication is effectively disabled.

Keys held under the hand, when a variation or song part changes, stay at their current colour and brightness until released.

Layers can be used (multiple zones on the same note). When a zone is layered on an existing zone it can be placed on top or underneath the current zone. When layered, the zone on top note off colour and brightness is displayed. When keys are pressed, the colour and brightness of the lower zone note on is displayed.

The last display is always turned off when switching away from a rackspace or song, so that any rackspaces or songs that have no “KeyZone” information are not not left with confusing or misleading displays. The displays will blank when quitting Gig Performer.

Parts Required

  • Raspberry Pi Pico or clone one per keybed. I used a full sized board with the debug port, but for final use I am going to buy the small form factor type.

  • Neopixel strips 144 LEDs per Meter. 500mm is sufficient for a single 37 note key bed. A 49 note and an 88 note keybed can be constructed with 2 meters of neopixels. I used the IP67 with a silicon cover, but they are harder to work with. (DC5V / WS2812B / Black / 1M 144 IP30)

  • USB cable to connect suitable for the RPi Pico.

ToDo

Tidy up the wiring and 3D print a case,

If anyone wants to have a go at building one or more of these, I am happy to provide more information. The RPi Pico software binary is available FoC with the usual caveats.

25 Likes

Looks like great fun with colourful showing results :wink:

1 Like

Nice project! Had something similar in mind, but time, time, time…

2 Likes

Fantastic application of tech, love it!

1 Like

I love this more than you can imagine. This is way beyond my tech level and i tried to do something similar but withing gig performer

But would love to do this…

Wow…nice project!

1 Like

Glad you like it. Happy to walk you through how to get it up and running. The first port of call is to look at the keyboards you want fit it on. All the ones I have have will allow the LEDs to fit easily behind the keys without interfering with operation of the keys.

Measure one octave of keys ideally from a white/white split point to a white/white split. E/F or B/C will work. I will keep a list of keyboards and sizes just for information. Once we have the key sizes, the next thing is to check that a 144L/M will work without too much run out over one octave. The pitch of the LEDs on the strip is 6.94mm, by actual measurement I get 6.9mm or 13.8mm every other LED centre.

One octave measurements of the keybeds I had to hand
Kurzweil K2500 = 165mm / Pitch = 13.75mm / Run out from octave centre +0.3mm
Korg Triton = 161mm / Pitch = 13.42mm / Run out from octave centre +2.28mm
Moog Voyager = 163mm / Pitch 13.58 / Run out from octave centre +1.32mm
Fatar TP9 keybed = 165mm / Pitch 13.75mm / Run out from octave centre +0.3mm

Although I have realised that, the run out is not as important as you may think when it is just being used for zones and not as a teaching aid.

I will put something together on the construction detail.

2 Likes

Nice! I have a Native Instruments Keyboard, and they have builtin LEDs for each key, maybe GigPerformer could be used to display configured zones in a similar way, without an RPi? As I’m not using zones often, I’ll not go into these details, though…

I don’t know, as the NI board was too rich for me to justify. If the LED’s can be controlled from an external device, I’m sure it would be straight forward.

I had a quick look through the NI Kontakt Komplete Kontrol manual and could not find any reference to allow control of the LEDs externally. It would appear that only the zones set in the keyboard will work with the lights. But is does beg the question could you set up the zones on the keyboard externally (via sysex??), and do this from GP?

I was in contact with NI and there is no chance to set that dynamically via SysEx.
Maybe with Apple Script or Similar on Windows you can remote control the Komplete Software Part wich defines the Zones.

But I never missed lights which show me the zones, I know what and where to play.

Construction - Pt. 1

Preparation

First separate the LED strip factory join at 500mm using a soldering iron or SMT hot air tool. Remove the cables from the start and end of the strip, noting the positions and colours of the wires. The strips I use have an arrow and the LEDs are numbered from 1-72. The LED strips can be fitted to the keyboard with either the cable connection at the left or at the right depending on the available space on the keyboard. Use the table below to identify the segments required.

   Keybed   |  Cable  |  LED Segments (Arrow left to right)  |  Total required LEDs  |
======================================================================================
C-C Keybeds |  Left   |   23, (23 segments to fit) , 23, 1   | 72, 96, 120, 144
37,49,61,73 |  Right  |   1, 23, (23 segments to fit), 23    | 
-------------------------------------------------------------------------------------
E-G Keybeds |  Left   |   15, 23, 23, 23, 23, 23, 15         | 145
76          |  Right  |                                      |
-------------------------------------------------------------------------------------
A-C Keybeds |  Left   |   5, 23, 23, 23, 23, 23, 23, 23, 1   | 167
88          |  Right  |   1, 23, 23, 23, 23, 23, 23, 23, 5   |

Cutting for ALL note C-C keybeds

Assuming the LEDs are numbered 1-72, to minimise the waste LEDs cut at the following points:

  1. Between LED 1&2, very close to LED 1
  2. Very close on both sides of LED 25 and discard LED 25
  3. Very close on both sides of LED 49 and discard LED 49

This provides 3 x 23 LED segments and 1 x 1 LED segment. This is enough for a 37 note keyboard from a single 500mm length and it maximised the copper for soldering at the joints. Repeat for the second 500mm length if fitting to 49, 61 or 73 note boards.

Cutting for E-G 76 note keybeds

Assuming the LEDs are numbered 1-72, to minimise the waste LEDs cut at the following points:

  1. Very close on both sides of LED 24 and discard LED 24
  2. Very close on both sides of LED 48 and discard LED 48
  3. Between LED 71&72, very close to LED 72 and discard LED 72

Repeat for the second 500mm length. On a new 500mm length

  1. Very close on both sides of LED 16 and discard LED 16
  2. Between LED 31&32, very close to LED 31

This provides 6 x 23 LED segments (one not used) and 2 x 15 LED segments..

Cutting for A-C 88 note keybeds

Assuming the LEDs are numbered 1-72, to minimise the waste LEDs cut at the following points:

  1. Between LED 1&2, very close to LED 1
  2. Very close on both sides of LED 25 and discard LED 25
  3. Very close on both sides of LED 49 and discard LED 49

Repeat for the second 500mm length. On a new 500mm length

  1. Between LED 5&6, very close to LED 5
  2. Very close on both sides of LED 29 and discard LED 29

This provides 7 x 23 LED segments, 2 x 1 LED segment (one not used) and 1 x 5 LED segment..

Measuring

Measure three octaves of keys ideally from a white/white split point to a white/white split. E/F or B/C will work. Then divide this measurement by 3 to get the size of one octave. This is done to improve the measurement accuracy of a single octave.

Joining the Segments

On a flat and solid surface (ideally longer than the keybed) mark a line. Mark the centre of the line. Then mark either side of the centre at intervals corresponding to the octave measurements made for the keybed it is to be fitted to.

Start by placing one of the 23 LED segments on the line, with the middle LED placed centrally about the centre mark. Fix this section in place with tape, ensuring the arrows are pointing left to right. The LED numbers are not significant. At either end of the placed LED strip, add another LED strip, with the middle LED placed centrally around the next corresponding octave mark, ensure the arrows are all pointing left to right and fix with masking tape.

If the surface is large enough, repeat for each section. Where the strips meet, if there is an overlap, trim the overlap so the ends of the sections lay flat. If there is a slight gap this can usually be bridged when soldering or a short length of wire can be added.

For the short sections add the same space between LED centres as at the join used between the 23 LED segments.

Check that all the arrows point in the same direction

2 Likes

@pianopaul ,

This is possible given the effort of building a vst that could be hosted inside in GP that uses the NI Komplete Kontrol SDK to set the zones, etc… I contacted NI regarding this a couple of years ago and did get the SDK, but time has not been on my side for that project.

GP Integration - Pt. 2

I have been asked how I got this working with GP so here is the detail I used to get things going. The interface is to use MIDI compliant mechanisms so it is easy for GP to output the messages. The messages used are Note On/Off, CC messages and system exclusive messages. The microcontroller is programmed to provide the MIDI to hardware functionality for these messages.

The device should work in Omni mode and the zones are limited to 7 so that the control can fit within a single CC message.

Each hardware device must be programmed to be identical and then configured for the keyboard attached, assigning the number of keys, the start key number and the direction. Up to seven zones, can be configured, and each has six parameters that should be configured; colour, low note number, high note number, zone brightness, note brightness and enable.

The hardware should be identified at startup. When switching to a song the keyboard zones should be initialised, when in a song/rackspace, parts/variations should control the zones and finally when leaving a song/rackspace the LED must be turned off to prevent misleading indications.

The system exclusive message and how it can be used without a defined Manufacturers ID.

In the context of MIDI (Musical Instrument Digital Interface), $7D is a specific byte value designated as the Universal Non-Commercial Identification byte, reserved for prototyping, test, private use, and experimentation. It allows researchers and non-commercial entities to use System Exclusive (SysEx) messages without requiring a formal manufacturer ID from the MIDI Manufacturer’s Association.

One message can define the keyboard and all zones. The message is identified using a keyword ‘KZ’ followed by the protocol revision ascii number to reduce the risk of invalid configurations being applied. Further checks can be made on message payload.

System exclusive message format: F0 7D ‘K’ ‘Z’ ‘1’ <payload> F7

Protocol 1

Defines a single message that can be used to fully control the device. This will allow zones to be defined and used without any permanent configuration storage on the device. Setting zones is optional and if no zones are defined the display will go off.

______ Keybed ______  ___________ Zone _________    __Zones__
[<KEYS><START><REV>]  [<COL><LO><HI><ZV><NV><EN>    [.......]]

Keybed Settings

KEYS - This is the size of the keybed, only values 88, 76, 73, 61, 49, 44 and 37 are supported. If this value is <=32, this is a colour and the keybed has been omitted.
START - This is the MIDI note value of the lowest key on the keybed.
REV - This is the order of the LEDs on the keyboard, zero is L to R and one is R to L.

Zone Settings

A maximum of seven zones can be defined in a single message. If zones are not defined all current zones are deleted.
COL - This is the colour assigned to the zone. Colours are in the range 0-32, see the colour table below.
LO - This is the MIDI note value that is the lowest key in the zone. A zone may be safely extended beyond the limit of the keybed.
HI - This is the MIDI note value that is the highest key in the zone. A zone may be safely extended beyond the limit of the keybed.
ZV - This is the brightness value that is assigned to the Note Off in the zone. Typically these values will be 0-127.
NV - This is the brightness value that is assigned to the Note On in the zone. Typically these values will be 0-127.
EN - This is the flag that enables and disables the Zone (turns on/off a zone).

Messages

System Exclusive Messages can be sent from GP using the MIDI Out block in global and local rackspaces, without any scripting. To define the keybed send a message from a MIDI out block in the global rackspace.

Examples:

61 Note all LEDs off - $F0 $7D ‘K’ ‘Z’ ‘1’ 61 36 0 $F7
88 Note one white zone all on - $F0 $7D ‘K’ ‘Z’ ‘1’  88 21 0 32 0 127 32 64 1 $F7

To define the zones for each song/rackspace send a message from a MIDI out block in the local rackspace. The keybed definition may be omitted if the global MIDI Out block has been used to define the keybed.

Examples:

Two zones one red, one blue (88 Keys) Red on and Blue Off (Hex)
      K  Z  1 <KEYS><NOTE><REV> <COL><LO><HI><ZV><NV><EN><COL><LO><HI><ZV><NV><EN>
F0 7D 4B 5A 31  58    15    0     01  00  3F  20  40  01   54  40  7F  20  40  00  F7 

Two zones one red, one blue (Keys defined in global) Zones off (Hex)
      K  Z  1 <COL><LO><HI><ZV><NV><EN><COL><LO><HI><ZV><NV><EN>
F0 7D 4B 5A 31  01  00  3F  20  40  00   54  40  7F  20  40  00  F7 

Zone and Note Brightness

The Note Off and Note On have independent brightness levels. Setting the Zone brightness will turn on the LEDs for a Note Off state (all LEDs will default to Note Off). Setting the Note brightness will set the brightness level when a Note On message is received. By setting the Note brightness to the same value as the Zone brightness effectively turns off the Note On indication.

Control Changes

Control values are used to enable and disable up to 7 zones. The disable/enable is defined as a single bit per zone. The disable/enable state can be predefined from the System Exclusive Message. The zones are LSB = Zone 1 and MidiMSB = Zone 7. Zones can be controlled with bit masks.

CC#110 enable/disable zones

Enable/Disable the zones as defined below. All zones are updated with this single control message. By using this CC message a single GP widget can be used to control all zones..

   _ 6 _  _ 5 _  _ 4 _  _ 3 _  _ 2 _  _ 1 _  _ 0 _
   Zone7  Zone6  Zone5  Zone4  Zone3  Zone2  Zone1

CC#111 - 117 Zones 1 - 7

Independent enable and disable of zones 1-7, one zone per CC message. This uses standard MIDI switch values, if the value is <64 the zone will be disabled, if the value is >=64 the zone will be enabled.

CC#121

All Controls Off, will turn off all enabled zones. It does not change any zone assignments, but allows the LEDs to be turned off on exit from a Song/Variation.

Colour Table

The colour table entries are made up of a single 32bit number made up of three 8 bit colour levels in the lower bytes. The colour transitions are linear so can be precalculated. A table of colours can be seen below. The zero index is a special colour of Black/off and 32 is a special colour of White, the remainder scaling is across 31 entries. A midi value can be scaled to work with the limited colour pallet as follows: Index = (MIDI Value + 2) >> 2

image

Index MIDI Red Green Blue Decimal Hex
0 0 0 0 0 0 0x00000000
1 4 100 0 0 25600 0x00006400
2 8 90 10 0 1356800 0x0014B400
3 12 80 20 0 2662400 0x0028A000
4 16 70 30 0 3968000 0x003C8C00
5 20 60 40 0 5273600 0x00507800
6 24 50 50 0 6579200 0x00646400
7 28 40 60 0 7884800 0x00785000
8 32 30 70 0 9190400 0x008C3C00
9 36 20 80 0 10496000 0x00A02800
10 40 10 90 0 11801600 0x00B41400
11 44 0 100 0 13107200 0x00C80000
12 48 0 90 10 11796500 0x00B40014
13 52 0 80 20 10485800 0x00A00028
14 56 0 70 30 9175100 0x008C003C
15 60 0 60 40 7864400 0x00780050
16 64 0 50 50 6553700 0x00640064
17 68 0 40 60 5243000 0x00500078
18 72 0 30 70 3932300 0x003C008C
19 76 0 20 80 2621600 0x002800A0
20 80 0 10 90 1310900 0x001400B4
21 84 0 0 100 200 0x000000C8
22 88 10 0 90 5300 0x000014B4
23 92 20 0 80 10400 0x000028A0
24 96 30 0 70 15500 0x00003C8C
25 100 40 0 60 20600 0x00005078
26 104 50 0 50 25700 0x00006464
27 108 60 0 40 30800 0x00007850
28 112 70 0 30 35900 0x00008C3C
29 116 80 0 20 41000 0x0000A028
30 120 90 0 10 46100 0x0000B414
31 124 100 0 0 51200 0x0000C800
32 127 33 33 33 4342338 0x00424242
4 Likes

This is impressive, very appreciated. I also like the detailed information.

I’m thinking of setting up a a Led matrix or something similar that will face the audience and will light up when I start to solo, show simple animations matching the song played etc…

The midi controllers, GP connectivity and the protocol might be similar.

1 Like