1.1.1 • Published 1 year ago

midi-kbd v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Web MIDI input keyboard controller

📦 Install

npm install midi-kbd

# or

yarn add midi-kbd

⚡️ Quick start

Example of using the keyEvents observable piped though to MIDI note values.

import {
  filterKeyboardEvents,
  keyEvents,
  mapToMidiEvent
} from "midi-kbd";

keyEvents
  .pipe(filterKeyboardEvents())
  .pipe(mapToMidiEvent(4))
  .subscribe((event) => {
    // The MIDI note value is a property o the event, `event.note`
    if (event.type === "on") {
      // trigger a note
    } else if (event.type === "off") {
      // release a note
    }
  });

📚 Documentation

This is still a work in progress.

Though if you want to checkout an example of what it is/or could be, you can see it in action here, johnhooks/midi-kbd.

The source code for the example above is found in the website directory of this repo.

Inspiration

AudioKeys

License

MIT @ John Hooks