MIDIHasKey — Virtual MIDI keyboard suitable for microtonal music
GPL-3.0 License
Virtual MIDI keyboard for microtonal music.
It works with JACK Audio Connection Kit but technically it can work with anything you name. You’d just have to create an application or a script that handles the events that are coming from MIDIHasKey’s stdout.
One of the main reasons to create MIDIHasKey is to use all keyboard keys efficiently in context of microtonal music. For example Jack Keyboard is trying to simulate the feel of a real piano keyboard by imitating its layout of white and black keys. It doesn’t make any sense for microtonal scales such as 17tet, 19tet, 22tet and many other. Those scales won’t be devided in equal octaves on the piano keyboard, and we have some unused keys,‥ so wasteful when we have just about 2 and half octaves in 12tet scale and even less in other micro scales.
Work in progress! It’s playable but some stuff can be changed or is only partially implemented.
See https://github.com/metachronica/audio-midihaskey/projects/1 page that about progress of first release.
For now you can:
Panic
buttonNix is the recommended way to run it.
You can run it just from a nix-shell:
nix-shell --arg with-midihaskey true --arg with-midiplayer-jack-cpp true --run 'midihaskey /dev/input/by-id/usb-xxxx_yyyy-event-kbd | midiplayer-jack-cpp'
Where /dev/input/by-id/usb-xxxx_yyyy-event-kbd
is your keyboard device path
(you must have access to read from that file for your current user).
nix-shell
Look at default.nix’s arguments to see available options.
nix-shell -A midiplayer-jack-cpp
nix-build -A midihaskey.exe -o result-midihaskey
nix-build -A midiplayer-jack-cpp -o result-midiplayer-jack-cpp
result-midihaskey/bin/midihaskey /dev/input/by-id/usb-xxxx_yyyy-event-kbd | result-midiplayer-jack-cpp/bin/midiplayer-jack-cpp
Here is an example how to build using GHC 9.2.3 (HLS is failing to build at the moment):
nix-build --argstr ghcVersion ghc923 --arg withHLS false -o result-test-ghc923
Nix setup for nix-shell includes HLS turned on by default. If you use Vim here is how you can configure vim-lsp plugin to use it:
if executable('haskell-language-server-wrapper')
aug HaskellLsp
au! User lsp_setup cal lsp#register_server({
\ 'name': 'hls',
\ 'cmd': {server_info->['haskell-language-server-wrapper', '--lsp']},
\ 'allowlist': ['haskell'],
\ })
aug END
en
See .envrc example file. See direnv.net if you are not familiar with direnv.
stack build --install-ghc
(cd midiplayer-jack-cpp && make)
stack exec -- midihaskey /dev/input/by-id/usb-xxxx_yyyy-event-kbd | midiplayer-jack-cpp/build/midiplayer-jack-cpp
Viacheslav Lotsmanov