MIDI keyboard and controller


This package includes two utilities:

[+] Keyboard
Allows playing notes by keyboard or mouse, and sends MIDI and score events.

[+] Controller
Sends the X and Y coordinates of the mouse pointer in a window as MIDI control change (7 or 14 bit) events.

It is recommended to start these programs from a terminal, as messages are printed to stderr.


Installation can be done by running "make", then (as root) "make install-strip".
Gtk-1.2.x is required for compilation.


Keyboard screenshot

Command line options
-h | -help | --help Print usage.
-o | --output <filename> Output file or device name (defaults to standard output).
-M | --midi Write MIDI messages to output (this is the default).
-S | --score Write Csound score events to output.
-w | --winsize <size> Set window size. Allowed values for size are:
0: 450x45
1: 600x60
2: 750x75
3: 1050x105
The default is 1.
Keyboard and mouse usage
A-Z, 0-9, -=\[];',./ Play notes. Pressing a key sends note-on, and releasing it sends note-off message (keyboard repeat is automatically disabled). Multiple keys can be pressed at once. It is possible to select from 4 note-on velocities by using modifier keys:
No modifiers: velocity 3 (defaults to 127)
<Shift>: velocity 2 (96)
<Ctrl>: velocity 1 (64)
<Alt>: velocity 0 (32)
These velocities can be changed using the arrow keys (see below).

Note: keyboard layout is assumed to be US or English.
Arrow keys Adjust note-on velocities. The velocity value to be changed is selected by modifier keys (<Shift>, <Ctrl>, and <Alt>) as explained above.
<F1>-<F4> Set transpose value.
<Shift> + <F1>-<F4> Adjust note-off velocity (the default is 64).
<F9>-<F12> Select MIDI program (1-128).
<Shift> + <F9>-<F12> Select MIDI channel (1-16).
<F5> Print current settings to stderr.
<F6> Turn off all active notes (also done at exit automatically).
<F7>, <F8> Change base key (the note played by Q and Z).
Mouse buttons Clicking on a key in the window plays the note. Velocity is selected by button:
Button 1 (left): velocity 3 (127)
Button 2 (middle): velocity 2 (96)
Button 3 (right): velocity 1 (64)
Other buttons (if there are): velocity 0 (32)


Controller screenshot

Command line options
-h | -help | --help Print usage.
-o | --output <filename> Output file or device name (defaults to standard output).
-7 | --7-bit Send 7 bit control messages (this is the default).
-14 | --14-bit Send 14 bit control messages (LSB is sent in MSB controller + 32). MSB is sent first.
-s | --size <size> Set window size to size * 128 pixels. size must be in the range 2 to 8, and defaults to 4.
Keyboard and mouse usage
Control change events are sent as the mouse pointer is moved in the window. Left to right movement increases X output, while moving up increases Y output. MSB values can be found with the help of the grid (the area for controller=64 is highlighted, and there are darker lines to find values that divide evenly by 8).
X, Y values (MSB) in the corners are:
Bottom-left: 0, 0
Bottom-right: 127, 0
Top-right: 127, 127
Top-left: 0, 127

Note: if the mouse pointer is not in the window, or is not moving, no events are sent.
Mouse buttons Disable sending of control change events. The events are sent again as the button is released.
<F1>-<F4> Select controller (MSB) for X output. Default: 24.
<F9>-<F12> Select controller (MSB) for Y output. Default: 25.
<F5> Print current settings to stderr.
<F7>, <F8> Select MIDI channel (1-16).
Arrow keys Set sleep time (minimum interval between updates) in the range 1 to 100 ms. The default is 10 milliseconds.


keyboard-1.0.4.tar.gz (11362 bytes)

Back to utilities page

Back to home page