https://github.com/krasjet/kb
Customizable virtual MIDI keyboard daemon for JACK.
https://github.com/krasjet/kb
c jack jackaudio keyboard midi x11
Last synced: over 1 year ago
JSON representation
Customizable virtual MIDI keyboard daemon for JACK.
- Host: GitHub
- URL: https://github.com/krasjet/kb
- Owner: Krasjet
- License: unlicense
- Created: 2020-10-15T02:00:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-08T04:43:52.000Z (about 5 years ago)
- Last Synced: 2025-01-22T09:14:49.428Z (over 1 year ago)
- Topics: c, jack, jackaudio, keyboard, midi, x11
- Language: C
- Homepage:
- Size: 69.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
kb
==
kb is a customizable virtual MIDI keyboard daemon for JACK
Audio Connection Kit. It provides MIDI input for standalone
JACK synthesizers and can be a useful debugging tool for
developing JACK-based audio applications.
Usage
-----
First start a JACK server using `jackd(1)` or `qjackctl(1)`
(see [1] for details on how to set it up), then run
$ kb
to start the MIDI keyboard daemon. Then, you need to connect
the `midi_out` port of kb to other applications (for
qjackctl, use the `Graph` or `Connect` button):
+----+-----------+ +-------+-----------+
| kb | | | synth | |
+----+ | +-------+ |
| | | audio_out +--->
| midi_out +------>+ midi_in |
+----------------+ +-------------------+
Alternatively, use the `-a` option to let kb automatically
detect and connect to input MIDI ports:
$ kb -a
kb will capture all the key presses and convert them into
MIDI messages according to your configuration.
For the default configuration, the home row of a QWERTY
keyboard
ASDFGHJKL;'
corresponds to the white keys on a piano keyboard, and
WETYUOP]
corresponds to the black keys. Additionally, `ZX`, `CV`,
`90`, and `-=` can be used to decrement and increment
octave, velocity, bank, and program, respectively. And the
Escape key is the panic button (turn off all notes). You can
easily customize these keybindings. See CUSTOMIZE section
for details.
If you want to shut down the daemon, press `Ctrl-C` in the
terminal to send a `SIGINT` signal or run
$ pkill kb
to kill the daemon process. For more information, see
`kb(1)`.
Build
-----
First, make sure JACK, Xlib, and libxi are installed. For
Arch-based distros, they can be installed by
$ pacman -S jack2 libx11 libxi
For Debian-based distros, install the dependencies by
$ apt-get install libjack-jackd2-dev libx11-dev libxi-dev
If you don't want to use libxi, check out the `no_ext`
branch. The `no_ext` version works exactly the same, but it
might have some issues capturing input within REAPER on
Linux.
You also need a C99-compatible C compiler and POSIX make.
After all the requirement are satisfied, run
$ make
to build kb and
# make install
to install it to your system.
Customize
---------
kb can be customized by editing the `config.h` file and
recompiling the source code. The default configuration is in
`config.def.h`. It provides a simple one-row keyboard
layout. Run
$ make config.h
to obtain the default config file.
Take a look at the alternative layouts in
- config.2row.h: two row keyboard layout (2 octaves)
- config.min.h: the minimal config file
to understand how to customize kb.
FAQ
---
Can I use kb with ALSA?
Use a2jmidid [2].
How can I add new MIDI messages?
See `write_midi` in jack.c.
Caveats
-------
1. kb has only been tested on Linux and with JACK 2. It
should work on any system with X11 and JACK support, but
I have not tested other systems yet. Feedbacks are
welcome.
2. Note that kb *captures* your key presses in any window.
It does not *intercept* them. This is intentional,
because I frequently need to edit code while testing the
MIDI input. As an additional benefit, you can now enjoy
some crappy generative music while typing.
[1]: https://ccrma.stanford.edu/docs/common/JACK.html
[2]: https://github.com/linuxaudio/a2jmidid/