react-use-midi
v0.0.3
Published
React hook for using MIDI in the browser
Downloads
2
Readme
react-use-midi
MIDI hook for react 🎹↩
Usage
import { useMIDI } from 'react-use-midi';
const MyMIDIComponent = props => {
const midi = useMIDI();
useEffect(() => {
midi.inputs.map((input) =>
input.addListener("noteon", "all", (e) => {
console.log(`${e.note.name}`);
})
);
}, [midi])
return <div>{midi.inputs.map(inp => <p key={inp.name}>inp.name<p>)}</div>
}
Demo app
https://github.com/jottenlips/useMIDI/tree/main/packages/demo-react-use-midi