Giter Site home page Giter Site logo

unclechu / midihaskey Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 0.0 303 KB

MIDIHasKey — Virtual MIDI keyboard suitable for microtonal music

License: GNU General Public License v3.0

Haskell 77.32% Makefile 0.29% C++ 5.20% CSS 1.97% Nix 15.21%
audio-processing audio jack jackaudio midi midi-keyboard haskell wxwidgets keyboard cplusplus

midihaskey's Introduction

MIDIHasKey

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.

Screenshot

WARNING!

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:

  • Play notes by pressing keys on keyboard you set to handle
  • Play notes by pressing GUI buttons
  • Trigger note-offs for everything by pressing Panic button
  • Change base pitch, octave, MIDI channel to play to
  • Store settings between application restarts

Supported OS

  • GNU/Linux

Requirements

  • GTK3
  • JACK Audio Connection Kit
    For included C++ JACK MIDI Player application. It’s optional (if you have your own app for that) because MIDIHasKey just writes events to stdout (in its own format) and you can redirect it wherever you want.
    TODO For me: Document the MIDI Player API. For now you can reverse-engeneer it by looking inside this file for instance. It also will change in the future.
  • GCC >=6.4.* (maybe lower, but must support C++17)
    To build C++ JACK MIDI Player (it’s optional too if you use your own one).

Usage

Using Nix

Nix 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).

Tuning nix-shell

Look at default.nix’s arguments to see available options.

Development mode for C++ JACK MIDI Player
nix-shell -A midiplayer-jack-cpp

Build and run

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
Test against newer GHC

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

Dev tools for Haskell apps

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
direnv

See .envrc example file. See direnv.net if you are not familiar with direnv.

Using Stack

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

Author

Viacheslav Lotsmanov

License

GNU/GPLv3

midihaskey's People

Contributors

unclechu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

midihaskey's Issues

Keys which was out of bounds at start remain so

This doesn't affect notes triggering so it's only appearance bug.

Akeys are out of bound at start
screenshot from 2018-06-05 00-37-47

Beven if octave shifted back these keys isn't colored
screenshot from 2018-06-05 00-37-59

Pressed/released state is also not indicated on these keys.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.