midi-visualizer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

midi-visualizer

Visualize a set of MIDI events as a piano roll.

npm i midi-visualizer pnpm add midi-visualizer yarn add midi-visualizer

Examples

# 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
    )

API

# MidiVisualizerElement src/midi-visualizer.tsx#L12

} & __module & {}, "transition">>

mounted($)  =>

    void

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Readme

Keywords

none

Package Sidebar

Install

npm i midi-visualizer

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

1.06 MB

Total Files

18

Last publish

Collaborators

  • stagas