Foundational music theory library: pitches, intervals, scales, chords and rhythm. Typed, pure, in-memory, all targets.
| Package | Contents |
|---|---|
| maya0513/music/pitch | PitchClass (mod 12, normalization proven), spelled Pitch, parse / format ("C#4", "Eb5"), MIDI conversion, equal-temperament frequency, cents conversion and numeric n-EDO conversion. |
| maya0513/music/interval | Interval (number + quality, compound numbers and double alterations), parse / format ("P5", "m3", "AA4"), inversion, addition (semitone addition proven), spelling-preserving transposition, interval between pitches, 5-limit just-intonation ratios. |
| maya0513/music/scale | A scale dictionary: major, the minor forms, harmonic major, the seven church modes, pentatonics and whole tone. Generation is by degree with notation-grade spelling (Eb major is spelled Eb F G Ab Bb C D). Key signatures as ordered accidental data. |
| maya0513/music/chord | Triads, suspended and six chords, seventh chords and extensions up to the thirteenth, built from intervals (degree spelling, like the scale package), pitch classes, symbols, inversions. |
| maya0513/music/rhythm | Duration as a normalized rational number of quarter notes (canonicalization covered by proof + property tests), dots, PPQ 480 tick conversion, tempo / seconds, time signatures. |
| maya0513/music/midi | In-memory Standard MIDI File conversion on Bytes: format 0 read / write with the full channel-message set, SysEx and meta events as opaque payloads, VLQ, running status on read. Format 1/2, multiple tracks and SMPTE division are rejected explicitly. No file IO. |
let c = @pitch.Pitch::parse("C4")
let g = @interval.transpose_pitch(c, @interval.Interval::parse("P5"))
// g is G4, spelled as a fifth above Cjust check # moon check --deny-warn --target all
just test # moon test on native, wasm, wasm-gc and js
just coverage # must report no uncovered lines
just prove # moon prove for the proof-enabled packages
just bench # moon bench --target native
just ci # everythingInstall
Download zipFoundational music theory library: pitches, intervals, scales, chords and rhythm. Typed, pure, in-memory, all targets.