Programming with the piano as interface

View on GitHub


Live coding with the piano as interface.

An open source project by Felipe Ignacio Noriega and Anne Veinberg. Supported By Stimuleringsfonds Creatieve Industrie NL

CodeKlavier development started in April 2017 and currently has four prototypes (newest on top):

More information about the specific prototypes can be found in their respective directories.

A performance on these prototypes was presented at SHA2017 and can be viewed here:
#sha2017 presentation

The dream:
🐍🎹 An intuitive programming language with the piano as interface.
The starting-to-be-graspable dream:
πŸ‘©πŸΌβ€πŸ’» A programming language for the piano as interface
The long term goal:
🎼🎧 a live coding music-domain programming language for the piano as interface
The mid term goal:
πŸ’ΎπŸ“Œ strategy-specific releases of mini-language approaches for live coding through the piano
The short term goal:
πŸ“†πŸ“ˆ research-release-evaluation cycles of prototypes which tackle specific aspects of the system


  1. An acoustic-MIDI piano such as a Yamaha Disklavier, any piano fitted with a silent system or an acoustic intrument in combination with a MOOG piano bar. If an acoustic-MIDI piano is not available, any 88-key MIDI keyboard will suffice providing this instrument is of suitable sensitivity for the pianist.

  2. MIDI interface (in case this is not present in the piano)


Install with pip3

  1. python-rtmidi
  2. pynput
  3. sphinx

Run pip3 install -r requirements.txt to install the required libraries.


For this version please add the CodeKlavier directory to your sys.path so the CK modules are recognized

You can run the every time you start a new shell (type . - not the dot-space before the command), or put the following lines in your ~/.bash_profile or ~/.bashrc or equivalent add the following lines (make sure you have the correct path!):

# Modules for the CodeKlavier PYTHONPATH="/path/to/your/codeklavier/project/folder:$PYTHONPATH" export PYTHONPATH

As an example, the path to the Codeklavier in my system looks like this:



Please install the latest release of SuperCollider

Test run

After installing the libraries, plug in your midi device and run the miditest by python3 After you complete the setup and configuration, you will see the midi messages on the screen. After that: try playing a hello world piece. Move into the hello world directory and run python3

Be sure to setup the correct port and device ID via default_setup.ini


Codeklavier Videos

This project is possible thanks to the Stimuleringsfonds Creatieve Industrie