Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ttys026/midi-canvas
https://github.com/ttys026/midi-canvas
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ttys026/midi-canvas
- Owner: ttys026
- Created: 2024-03-19T06:59:01.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-27T02:23:05.000Z (10 months ago)
- Last Synced: 2025-01-20T13:08:45.552Z (13 days ago)
- Language: TypeScript
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Midi Canvas
### install
```bash
npm i --save midi-canvas
```### usage
```javascript
midi.current = new MidiCanvas({
midis: [{ src: "base64" }],
audio: "url",
width: "100%",
height: 150,
container: document.body,
});midi.current.audio.ontimeupdate = () => {
const time = midi.current?.audio?.currentTime || 0;
setProgress(time);
};
midi.current.audio.onplay = () => setPlaying(true);
midi.current.audio.onpause = () => setPlaying(false);midi.current.audio.play();
```