Using Raspberry Pi 4 For Running The KeyMusician Keyboard

We tested the KeyMusician Keyboard application, on a Raspberry Pi 4, which has a 1.5 gigahertz, 64-bit quad-core ARMv8 CPU, and 4 gigabytes of RAM. 

Some Assembly Required


I purchased the machine as a “CanaKit”, which made me a bit apprehensive, being one of those programmers hardware engineers say, you shouldn’t give a screwdriver to...

But assembly of the kit consisted of snapping components in place, and plugging in plugs. I was even able to easily select a medium speed for the fan, by plugging the lead into the proper pin for it.

I was happy that the kit supplied everything I needed, including an attractive case, and a small cooling fan. The top of the case is the size of a credit card, and it’s about 2 inches high.

I thought I’d have to set it up in its own space downstairs, but with its small size, and just a little bit of arranging things, I was able to put it in the music room, on the same desk as an Acer laptop, an Alesis iO2 USB audio interface, a Mac Mini, and a MacBook, where I already had a monitor with an unused HDMI plug. The mouse and keyboard used for plugging into the Mac Mini, now can easily plug into the Raspberry Pi.

I can also easily plug one of my gamers keyboards into it, as well as an M-Audio KeyStation 88 MIDI keyboard.

Installing Linux

I was a little worried where the instruction booklet was fairly thin. But installation of the Raspbian Linux system, was also trouble free, and worked just the way it said in the instructions. I had no problems connecting its wireless interface to my DSL modem.

Installing the system in the micro SD card was not too time-consuming, but installing the system updates took about twice as long.

The screens displayed on rebooting seemed somewhat chaotic, but the reboot works every time, and I stopped being nervous about it.

The desktop display is fairly similar to Lubuntu 18.04, which I’m used to. Even the task-bar applets are the same, though it puts the task-bar on the top of the screen.

Installing and Running the KeyMusician Keyboard

After downloading the KMK Debian package (installer), I installed it using the system default package installer with no problems, along with the normal dependencies.

Running KMK the first time, out-of-the-box, worked fine, with no problems, and no audio glitches.


In the screen-shot above, playing chords with 3 simultaneous melody notes, it’s only using 5 percent of the processor, and an insignificant amount of memory. With the HDMI monitor, having 1920x1080 resolution, I easily had room for all of the windows.

I tried a lot of things – connecting a MIDI keyboard, playing along with a piece on the MIDI player, and learning a piece from a MIDI file. Everything worked. The Help buttons all worked, unlike on Chromebook, or on Kubuntu Linux.

The only problem in this mode, was that it used the speakers in the HDMI monitor, rather than the sound system the audio cable was connected to.

Improving the Linux System

Connecting a MIDI keyboard worked fine, but after that, I ran into a few problems.

There was no way of running JACK (qjackctl) from the menu (I couldn’t find it anywhere). I had to select “Run” from the menu, and type ‘qj’, which it finished out to ‘qjackctl’, to run it. JACK initialized okay, and it was able to configure it to use the sound system the audio cable was connected to, so my only problem above was solved.

I made a desktop launcher for qjackctl, so I could easily launch it in the future.

Qsynth worked fine, using JACK, and I easily added 3 additional Qsynth ‘engines’. Four gigabytes of RAM is probably more than you need. 2 gigabytes would have been plenty for running Linux.

Unfortunately, when I tried to use Qsynth, it didn’t appear in the MIDI Output Device drop-box. It turned out, that I needed to compile a special version of the KMK’s ALSA Device Driver for ARM machines (the Raspberry Pi as an ARM architecture machine).

But I’m the developer – I can fix that. So a few days later, armed with the new ALSA Device Driver for ARM machines, I could run everything. That new device driver is now available in KMK version 1.52, or above.

I loaded my configurations for composite voices (using two Qsynth ‘engines’), set up the patchbay connections, and composite voices worked fine, with the machine not even ‘breaking into a sweat’, though it used a little more of the CPU than with just the Java Sound Synthesizer.


In the screen-shot above, I’m holding out a massive 10-note chord with the sustain control (so you don’t see the notes displayed), using both Qsynth1 and Qsynth2 (composite voices), and it’s only using 21% of the CPU. So clearly, the Raspberry Pi 4 has plenty of ‘oomph’ to run even the most demanding cases. It would probably also work fine on Raspberry Pi 3.

I also tried using the ZynAddSubFX software synthesizer, which can barely be run on a 2 gigahertz CPU single-processor machine.

On the Raspberry Pi, no problems. It looks like it uses about 15 percent of the CPU. But that’s still not a big percentage of the processor power unavailable:


In the screen-shot above, I’m evening using it with a composite voice on Qsynth2, and it’s only using 22% of the processor.

Updated Information (Jan. 13, 2021)

On another micro SD card, I installed an Ubuntu 10.10 64-bit desktop system.

I had some initial problems creating the Ubuntu 10.10 install micro SD card, using an Ubuntu 10.10 system itself. But that problem went away when I created it on Ubuntu 20.04, and also formatted the micro SD card first. I don’t know which of the two things solved the problem.

But once that was done, it installed without problems, and booted successfully after installation. Updates also installed with no problems.

There is confusion installing the KeyMusician Keyboard Debian package using Ubuntu’s installer, where it appears to be removing it, even though it isn’t yet installed.

I used Ubuntu’s installer to install the gdebi (Debian installer) package, and used that to install both the KeyMusician Keyboard, and its ‘extra’ dependencies. Installation of these packages was successful.

When I tested the KMK, I discovered I needed a version of the ALSA device driver for 64-bit ARM machines, which I created, and put into version 1.55 (a Linux-only release).

After doing that, all of the ALSA devices were accessible, and everything worked. I even ran my Rosegarden ‘acid-test’ file, and no audio glitches occurred.

Another good thing I noticed using Ubuntu 20.10, is that streaming of videos over the Internet worked well, with no jerkiness or any percieved lost frames. So video streaming over the Internet is something (64-bit) Ubuntu 20.10 does much better than Raspbian OS.

Conclusions

I was pleasantly surprised, all the way through assembling the kit, installing Raspberry Pi OS (Raspbian), and installing and using the KeyMusician Keyboard on it.

In all usage of the KMK, the processor easily handled it, never even ‘breaking into a sweat’. Where the Raspberry Pi 4 used, is 3 times faster than the Raspberry Pi 3, it ought to work on the Raspberry Pi 3, and perhaps even slower machines.

It’s not quite up to being an all-purpose machine, as it does a poor job of streaming videos in a browser, but plays them well if you download them first.

With the new version of the ALSA Device Driver (to run on ARM processors), available in KMK version 1.52 and above, everything workseven composite voices. It sounded great, and I got no audio ‘glitches’ using JACK and Qsynth.

If you install Ubuntu 20.10 on it, it also works very well, though you need KMK version 1.55 for the 64-bit ARM ALSA device driver. I recommend this version, because video streaming over the internet works well on this system. Everything with KMK worked well, including composite voices, and also using the ZynAddSubFX synthesizer.

It’s definitely a bargain for getting a quality musical instrument!  Give it a try.

You can learn more about the KeyMusician Keyboard at:

KeyMusician.com



To return to the index of KMK Newsletter articles, click the link below.

Index Of All Newsletter Articles