sponsored by djcj.org
Linux Audio Users Guide

CMKeyboard - CLUTTER MIDI KEYBOARD

DEVELOPER

Author: Patrick Shirkey - Boost Hardware Ltd
Contact: pshirkey_at_boosthardware.com

DOWNLOAD

DESCRIPTION

CMKeyboard is a 128 note ALSA MIDI virtual piano keyboard spanning from C-1 to G9 written in python3 and taking advantage of the latest Clutter (>1.12.2) features to enable scrolling and opengl goodness. It is a stand alone program which can also be embedded into other python3 applications as a class library. It uses code from the very handy pyclutter-widgets project for the rounded rectangles of the key buttons.

The code demonstrates use of Clutter.ScrollActor(), GtkClutter.Embed(), layering of multiple clutter actors, handling of events including: "button-press-event" & "key-press-event".

USING

MIDI Connections: Connect the alsa midi ports with your favourite connections manager, for example, qjackctl

Scrolling: To scroll the piano keyboard use the left/right arrows on your keyboard.

TODO

Gesture support for touch screen devices

DEPENDENCIES

Python3
Clutter > 1.12.2
GTK+

INSTALL

1: Extract the archive

tar -jxf cmkeyboard.tar.bz2
cd cmkeyboard

Optional step - Only necessary if you don't already have this library installed

2: Install alsaseq-0.4.1 which is included in the tarball for your convenience

cd alsaseq-0.4.1
python3 setup.py build
sudo python3 setup.py install

3: Run the code

python3 cmkeyboard.py

EXAMPLE CODE

There is example code for embedding the keyboard into a gtk+ application

Run the code

python3 gtk3-clutter-midi-keyboard.py

MORE PROJECTS

Linux Midi Instrument Convertor - Linux MIDI Instrument Convertor for lscp to idf, midnam for use in muse2 and ardour3

GtkMeter - A custom vu meter widget for GTK3 and Cairo

Check out jackEQ and jack-menu for more projects from DJCJ and Boost Hardware Ltd.

Check out the Linux Audio Users Guide, the Linux Audio Musicians - Best of Mixes, Linux Music Videos and the Quick Toots for lots of useful information, music and multimedia from the Linux Audio Community.