A C++17 library for auto-generating pop music MIDI sketches. Designed for WebAssembly deployment with zero external dependencies.
- 8 Track Output: Vocal, Chord, Bass, Motif, Arpeggio, Aux, Drums, SE
- Rich Presets: Structure (18) × StylePreset (17) × Mood (20) × Chord Progression (22)
- Advanced Melody: Phrase-based generation, HookIntensity, MelodicComplexity, VocalStyleProfile
- Music Theory: Voice leading, non-chord tones, chord extensions, dynamic velocity
- Composition Styles: MelodyLead, BackgroundMotif, SynthDriven
- Deterministic: Seed-based reproducible generation
make build # Native build
make test # Run tests
./build/bin/midisketch_cli # Generate output.mid
# WASM build (requires Emscripten)
source ~/emsdk/emsdk_env.sh && make wasm#include "midisketch.h"
midisketch::MidiSketch sketch;
midisketch::GeneratorParams params;
params.structure_id = 1; // BuildUp (0-17)
params.mood_id = 0; // StraightPop (0-19)
params.chord_id = 0; // Canon progression (0-21)
params.seed = 12345;
sketch.generate(params);
auto midi = sketch.getMidi(); // SMF binaryimport { init, MidiSketch } from '@libraz/midi-sketch';
await init();
const sketch = new MidiSketch();
sketch.generate({
structureId: 1,
moodId: 0,
chordId: 0,
seed: 12345
});
const midiData = sketch.getMidi(); // Uint8Array
sketch.destroy();| Track | Channel | Program | Purpose |
|---|---|---|---|
| Vocal | 0 | Piano | Melody |
| Chord | 1 | E.Piano | Chords |
| Bass | 2 | E.Bass | Bass line |
| Motif | 3 | Synth Lead | Background |
| Arpeggio | 4 | Saw Lead | Arpeggio |
| Aux | 5 | Warm Pad | Sub-melody |
| Drums | 9 | - | GM Drums |
| SE | 15 | - | Markers |
- Getting Started
- API Reference (JavaScript)
- API Reference (C++)
- Presets
- Track Generators
- Architecture
- CLI Reference
This project is dual-licensed:
- Open Source: Apache License 2.0 - For evaluation, research, and non-commercial use
- Commercial: Commercial License - For closed-source, proprietary, or SaaS use
| Use Case | License |
|---|---|
| Evaluation / Research | Apache-2.0 (free) |
| Non-commercial use | Apache-2.0 (free) |
| Closed-source product | Commercial (paid) |
| Commercial SaaS | Commercial (paid) |
For commercial licensing inquiries: libraz@libraz.net
This project provides a core engine, not a complete music generation system.
Sound sources, vocals, and rendering are out of scope.
libraz libraz@libraz.net