midi-kbd
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Preview of computer keyboard overlaid with musical notes

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

Readme

Keywords

none

Package Sidebar

Install

npm i midi-kbd

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

44.5 kB

Total Files

36

Last publish

Collaborators

  • bitmachina