Skip to content

Installation

Package Manager

BETA

The npm package is not yet published. During the beta period, please use the library via the demo page or build from source.

bash
npm install @libraz/midi-sketch
bash
yarn add @libraz/midi-sketch
bash
pnpm add @libraz/midi-sketch

Browser Usage

html
<script type="module">
import { init, MidiSketch, createDefaultConfig } from '@libraz/midi-sketch'

await init()
const sketch = new MidiSketch()
const config = createDefaultConfig(0)
sketch.generateFromConfig(config)
const midi = sketch.getMidi()
// ...
</script>

Bundler Configuration

Vite

javascript
// vite.config.js
export default {
  optimizeDeps: {
    exclude: ['@libraz/midi-sketch']
  }
}

Webpack

WASM files need to be served correctly. Ensure your configuration handles .wasm files appropriately.

Released under the MIT License.