项目作者: matthewshirley

项目描述 :
React hook to easily use MIDI inputs via the Web MIDI API 🎹 🎼
高级语言: JavaScript
项目地址: git://github.com/matthewshirley/react-midi-hook.git
创建时间: 2020-04-29T05:30:36Z
项目社区:https://github.com/matthewshirley/react-midi-hook

开源协议:

下载


react-midi-hook

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

Install

  1. yarn add --save react-midi-hook

Usage

  1. import React from 'react'
  2. import useMidi from 'react-midi-hook'
  3. export default function App() {}
  4. const { pressedKeys } = useMidi();
  5. return (
  6. <p>{pressedKeys[0].letter}</p>
  7. );
  8. }

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