jmon/algo (jam on studio - algorithms) a JavaScript music composition toolkit for the JMON (JSON Music Object Notation) format. We don'Mt provide an installation guide yet, but you can start using it on Observable. Check out the interactive guide.
- Music theory: Scales, progressions, harmony, rhythm
- Minimalism: Process-based composition techniques
- Generative algorithms: no deep learning, just you, your imagination and math: random walks, Fractals, cellular automata, genetic algorithms, Gaussian processes
- Tone: Core format validation and Tone.js integration
- ABC notation: Convert JMON to ABC notation
- MIDI: MIDI file conversion utilities
- Display: Score visualization and playback functions
- SuperCollider: JMON format to SuperCollider code
- Musical analysis tools (usefull for genetic algorithms)
- Format conversion utilities
- Mathematical utilities for music
deno task build # Build ESM and UMD bundles- Install Deno: https://deno.com/manual/getting_started/installation
- Install JupyterLab:
pipx install jupyterlab - Install Deno kernel:
deno jupyter --install - Launch:
jupyter-lab - Create a notebook with the Deno kernel
| Function | JSR | npm | Description |
|---|---|---|---|
jm.theory.* |
✓ | ✓ | Scales, chords, progressions, intervals |
jm.generative.* |
✓ | ✓ | Melodies, walks, fractals, cellular automata |
jm.analysis.* |
✓ | ✓ | Pitch, rhythm, harmony analysis |
jm.converters.* |
✓ | ✓ | MIDI, ToneJS, WAV, SuperCollider, VexFlow |
jm.audio.* |
✓ | ✓ | DSP, synthesis, audio processing |
jm.score(comp, VF, opts) |
✓ | ✓ | Sheet music (requires VexFlow param) |
jm.play(comp, opts) |
✗ | ✓ | Audio playback (npm only) |
jm.render(comp, opts) |
✗ | ✓ | Full UI player (npm only) |
jmon-algo has zero dependencies in the JSR package. Libraries are passed as parameters:
// VexFlow for notation (both JSR and npm)
const notation = jm.score(composition, vexflowInstance, options);
// Tone.js for audio (npm package only)
const player = jm.play(composition, {Tone: toneInstance});This design allows you to:
- Use any version of VexFlow or Tone.js
- Load libraries from CDN in browsers
- Avoid dependency bloat in Deno/Node
- Pass mocked libraries for testing
GPL-3