Part 01 Isomorphic keyboard: hex keys
Use Raspberry Pi Pico to make an isomorphic music keyboard with hexagons
Mike Cook Veteran magazine author from the old days, writer of the Body Build series, plus co-author of Raspberry Pi for Dummies, Raspberry Pi Projects, and Raspberry Pi Projects for Dummies. magpi.cc/mikecook
One alternative layout to a conventional piano keyboard is an isomorphic keyboard. Here, the notes are laid out so that adjacent keys differ by only a semitone. It is said that such a keyboard is easier to learn to play in any key. This month, we show you how to make a USB interfaced MIDI keyboard with an isomorphic layout.
While the principle of adjacent keys differing only by a semitone is simple enough, there is considerable variety in exactly how they are laid out. The arrangement of keys can be on a square grid, or an offset grid; the keys themselves can be square, round, or, our favourite, hexagonal. There are a number of different layouts that detail exactly what keys are where; these have names like Gerhard, Park, Maupin, Wicki-Hayden, Harmonic, Janko, C-system, and B-system. We are going to use the Harmonic type that was used by the now defunct C-Thru Music company.
We came up with the concept of a two-layer box – this is shown in **Figure 1**. The top surface is where the keys are. They are cut out and press down on the tack switches underneath. To stop them falling out when the box is turned upside down, each key has an oversize version of itself glued to it. The tack switches are mounted on a large piece of stripboard, supported by 3 mm spacers screwed to the middle level. Underneath this is a Raspberry Pi Pico board, supported on five 30 mm pillars between the base and middle level.
A scanning switch matrix is a way of reading a lot of switches from a few inputs/outputs. **Figure 2** shows the schematic of a small 3×4 matrix. There are many variations on this, but we have chosen to use a column drive with a row input. A walking zero signal is applied to the columns, and pressing a key connects a column to an input. As you know what column was low when an input was low, you know what key was pressed. We will be making a 15 column by 7 row matrix for this project.
The laser files
We have started using the software LightBurn to produce our laser cutter artwork, and all the files can be found on our GitHub page. If you use another system, then you can get a full version of this software on a 30-day free trial to use or convert the files. Alternatively, we have also supplied SVG files for each sheet you have to cut. The top panel also includes vector engraving on the keys – this has to be done first at a lower setting so as not to burn all the way through.
Enclosure construction
Figure 3 shows the construction of the two- layer box. Note how the side with only a 1.5 mm tab sticking out goes to the middle layer of the box, and the 3 mm tabs on the other side go to the top and the base. We assembled and glued the sides into two rings, and then we reinforced each corner with a small length of half round dowel fixed with superglue. Then we plugged up the bottom end with Blu Tack (tack putty) and dribbled some Gorilla clear glue down the joint for added rigidity. See **Figure 4**.
Painting
We have come up with a new way to paint plywood boxes that doesn’t show brush marks, by using a half-inch foam brush and normal emulsion paint. This allows us to use paint from the wide range of match-pot colours, and gives a nice flat finish. To keep things clean from finger marks, we add three coats of a water-based clear matt varnish. We used yellow for the top and base, and matt black for the sides and visible edges of the box.
Painting the keys
Figure 4 shows the colours we used to paint the keys. The keys can be painted any colours you like, but keep the groups consistent for the best playing experience. Again, three coats of matt varnish are applied to each key. Once painted, you can glue the keys to the oversized key blanks. We used a small drop of superglue in the middle of each and pressed down for ten seconds. Try to get them centralised; if not, this can be corrected with a disc sander. The top and bottom flat of each key blank should be about 1 mm from the edge of the actual key.
Once painted, you can glue the keys to the oversized key blanks
The stripboard
We need a piece of stripboard 101 holes long by 58 strips high. Unfortunately, we couldn’t find one, so we had to make one out of three pieces of board. Fortunately, this could be done by buying just one 119 by 455 mm sheet of stripboard. The maximum height of this board is 46 strips, so we cut out a 101 hole by 46 strip high main piece, a 71 hole by 12 strip, and a 30 hole by 12 strip piece. We also got a 58 hole by 8 strip piece for the triangular control button board from the same piece of stripboard. See our GitHub page for more notes about joining these together.
The Matrix
Figure 6 shows the first five columns. There are two additional diagrams showing the rest of the wiring on our GitHub page, but the basic pattern is the same. The even and odd numbered columns both have identical patterns of key placement and track breaks round them. We fitted the switch first and then, before soldering it, cut the tracks between the switch pins and surrounding the tracks. To make sure you have picked up the correct place to make the break, insert a wire through the place indicated, then turn the board over and make the break where you see the wire.
The Matrix 2
Make sure the tack switches are flat to the board when you solder them. They have a habit of pushing themselves out once the board is turned over for soldering. To make sure they are OK, solder one of the four pins and check. If it is not flat then hold down the corner of the key with your finger nail and reapply the soldering iron and push it into place. Do the same for the opposite corner. Once two corners are in place, simply solder up the other two. Then fit the 1N4148 diode next to each switch; get it the right way round.
The Matrix 3
The long tracks of tinned copper wire with a black dot on them denote a joint where one wire enters the hole and another leaves it. Here, push all the wires in place before soldering them. We found this easier if these holes were enlarged slightly with a 1.2 mm drill. When fitting the keys, turn the top over and insert from the back; we numbered the columns and rows on the board and wrote the column and row number, along with its name, on the back of each key. We then placed a blank board over the top and inverted it. Finally, we attached each key to the top with masking tape so they would not drop out when we fitted the top – see **Figure 7**.
Warp one, Mr Sulu
One problem we encountered was that the top board had an inwards warp. This meant that when the top retaining screws were tightened, the top was pressing some switches. To counter this, one or two securing holes were turned round so that a screw pushed up on the board, correcting the warping. We used a 20 mm pan-head M3 screw with a 3mm spacing and three 0.5 mm solder tags on the underside of the board – see Figure 8. The solder tags allowed for fine adjustment, making the switch tops flush with the board. We had to cut away at the oversize key mount on surrounding keys to ensure the push-up screw was not fouled.
Part 2
Next issue, we’ll look at the construction of Raspberry Pi Pico, control switches, OLED display, and rotary encoder, as well as how to wire it all together. We will also look at the software we need to test what we have built, and the final software bring it all to life.