Visualize a set of MIDI events as a piano roll.
# web
# view source
example/web.tsx
/** @jsxImportSource sigl */
import $ from 'sigl'
import { MidiVisualizerElement } from 'midi-visualizer'
import { createMidiNoteEvents } from 'webaudio-tools'
const midiEvents = [
midi - visualizer.createMidiNoteEvents(0, 30, 127, 0.1),
midi - visualizer.createMidiNoteEvents(0.25, 35, 107, 0.1),
midi - visualizer.createMidiNoteEvents(0.5, 40, 127, 0.1),
midi - visualizer.createMidiNoteEvents(0.75, 37, 95, 0.1),
]
const MidiVisualizer = $.element(MidiVisualizerElement)
$.render(
<MidiVisualizer
style="width:400px;height:100px;overflow:hidden;resize:both;"
midiEvents={midiEvents}
/>,
document.body
)
# MidiVisualizerElement
src/midi-visualizer.tsx#L12
# onmounted
EventHandler<MidiVisualizerElement, CustomEvent<any>>
# onunmounted
EventHandler<MidiVisualizerElement, CustomEvent<any>>
# mounted
($)
src/midi-visualizer.tsx#L46
# $
Context<MidiVisualizerElement & JsxContext<MidiVisualizerElement> & Omit<{
<T>(ctor) =>
- CleanClass<T>
<T>(ctx) =>
- Wrapper<T>
"transition"
>> mounted($) =>
- void
- sigl by stagas – Web framework
- webaudio-tools by stagas – Useful tools for WebAudio.
All contributions are welcome!