I connected a Family BASIC keyboard to an NES via a
bespoke adapter in order to play its unique triangle waveform live.
Here’s a short technical presentation:
And here’s a performance of my NES-style tune Platform Hopping, originally
composed for the music compo at X 2023:
Download
- Linus Akesson – Platform Hopping (Family Bass).mp3 (MP3, 5.7 MB)
How the adapter works
As outlined in the presentation video above, the Family BASIC keyboard is
designed to plug into the expansion port of the Famicom, but I wanted to hook
it up to one of the controller ports on my NES. This called for a custom adapter.
The keyboard
The 72 keys of the Family BASIC keyboard are wired up in a simple
matrix, nine rows by eight columns, and the columns are further subdivided into
half-columns of four bits each. During transmission, there’s also a tenth row
that is left blank. This is because the protocol is designed around a 4017
decade-counter chip inside the keyboard, which is responsible for driving one
row of keys at a time. An input signal to the keyboard selects between the two
half-columns of the current row, and the same input signal also acts as a
positive-edge clock to the decade counter, advancing to the next row. After ten
positive edges, the cycle repeats. There’s also a separate reset input. In
summary:
Direction | Function |
---|---|
To keyboard | Reset |
To keyboard | Half-row select and Clock |
From keyboard | Data 1 |
From keyboard | Data 2 |
From keyboard | Data 3 |
From keyboard | Data 4 |
(I’m ignoring a few additional signals that control two jacks at the back of
the keyboard, used for storing BASIC programs to tape and loading them
back.)
The NES controller ports
Now let’s turn to the NES controller ports. Here we find two output signals
called OUT and CLK and three input signals. OUT is
actually a common signal shared by both ports, while CLK and the input
pins are available for each port separately.
However, the cable I’m plugging into the oddly-shaped NES port happens to be
a replacement cable for a standard controller, and the standard controllers
only make use of one of the input pins. To save cost and make the cable as
flexible as p