Skip to content

React hook to easily use MIDI inputs via the Web MIDI API 🎹 🎼

Notifications You must be signed in to change notification settings

matthewshirley/react-midi-hook

Repository files navigation

react-midi-hook

React hook to easily use MIDI inputs via the Web MIDI API.

Install

yarn add --save react-midi-hook

Usage

import React from 'react'
import useMidi from 'react-midi-hook'

export default function App() {}
  const { pressedKeys } = useMidi();

  return (
    <p>{pressedKeys[0].letter}</p>
  );
}

Browser Support

The Web MIDI API is currently only supported on Edge, Chrome and Opera. Please refer to Can I use for up to date information.

License

MIT © matthewshirley