Monthly Archives: April 2018

AK47m Project Part 5 (First cut of arranger software on PC and Pi)

Project Updates —

I have built a skeleton program that extends on the previous work and goes a long way to a full arranger. There are two builds, one for Windows and one for the Raspberry PI.

The Windows build outputs MIDI to an external MIDI device. I am currently using the MidiMan MIDI USB interface to read and write to an electronic keyboard for test purposes. I can alternatively route the MIDI to the Windows MIDI device or the excellent VirtualMIDIsynth and generate audio on the PC itself.

The PI version is linked to the QSynth program (which is a wrapper around FluidSynth) via ALSA and generates audio from an attached USB audio interface.

The arranger software is built around the use of the 3×4 matrix keypad as part of the MIDI interface described previously. I have a simulation of this for the Windows build. The software loads up a BK7m performance file called “” on start up. Individual performances may be called up by typing the performance number (from 1) and pressing the hash (#, PERF) key. The style file linked to the performance is loaded ready to play. It is possible to load a different performance file by keying in a number and pressing the asterisk (*, FILE) key. The file loaded has a filename of the number plus the .ups extension. e.g. “” .

Once the performance is loaded, it is possible to start by pressing a chord in the left hand or by pressing the zero (0) key on the keypad. When a performance is running it is possible to change to a variation by pressing keys 1..3 or to stop by pressing the zero key. I am proposing to add 4 extra push switches to handle the variation selections.

I have completed the chord finder logic. This works out the chord played in the left hand, selects the maj, min or dom7th snippet and applies appropriate pitch corrections for the chord key and the chord flavour. (i.e. converting the dom7th snippet to  Maj7th snippet) The snippet for the variation is played entirely and then repeated.

When a new variation is selected, a fill for the current variation is played and then the new variation is started. I ensure that the fill is started at the same beat in the bar as the variation that is playing.

I am selecting the instruments specified in the style file at the moment although the BK7m performance can override these. The instruments are kept within the General MIDI instrument palette.

It is still very much work in progress. The main development is done on the Windows PC and verified occasionally on the PI. I have had mixed success in playing styles on the PI. Some of the styles require a lot of processing power which load the PI up to 100%. The balance of volume between instruments is wrong for the FluidSynth sound font and there needs to be a function to correct this and write back the settings to the performance file.

I will trial the software on a PI B+ that has a lot more capacity. There are no CPU performance problems on my 4 core PC.

I may also trial with the arranger on a PI connected to another PI with the Synth. If I do this then I will use the first PI to drive the keypad. My goal is to keep the overall cost as low as possible.

I will release the two installations soon once I have truly figured out the style file format.


The setup tab allows you to select the MIDI input and output devices, test the output and bring up a debug message window. This is for Windows only.



This is the main control tab. The keypad simulation is to the right. The actual commands are listed in the central window. The red shows the BK7m performance name, the green shows the current chord selection.