Expand description
Procedural chiptune music from arbitrary bytes — same input yields the same audio.
Core synthesis has no mandatory file or audio-device I/O so it builds for wasm32-unknown-unknown
as well as native targets; [SongMetadata::from_path] is omitted on wasm32-unknown-unknown
(browser) where std::fs metadata is unavailable—use [SongMetadata::from_string] there.
§WebAssembly
Use the chiptunomatic-wasm crate for wasm-bindgen bindings (incremental synth + metadata for JS). It
depends on this library and is built with:
rustup target add wasm32-unknown-unknown
cargo build -p chiptunomatic-wasm --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/release/chiptunomatic_wasm.wasm --out-dir pkg --target webOn wasm32, enable this crate’s js feature so getrandom is built with its js
backend (the chiptunomatic-wasm crate does that). Without js, a wasm32 build
must supply another getrandom backend. Use a JavaScript-capable host when js is on.
Modules§
Structs§
- Arpeggiator
- Wraps [
SongNoteReader] and expands each [SongNote::Melody] intosubdivisionsshorter sub-notes cycling through the active chord tones. [SongNote::Bass] passes through unchanged. - Arpeggiator
Config - Bass
Note - Note for the bass
- Chiptunomatic
- Drum
Pattern - 16-step drum pattern
- Drum
Sampler - Generate infinite samples from a drum pattern
- Drum
Step - Master
Output - Melody
Note - Note for the melody
- Mixer
- Same per-sample peak-normalization behaviour as [
IterMix], for feedingSamplevalues one-by-one from JS/workers. - Mixer
Config - Configure the volumes
- Note
Generator - Drives interleaved melody/bass notes generation from a growable byte stream
- Sample
- Sample
Drum - Allow to iterate the drum samples one by one
- Sample
Reader - Sampler
- Sample the voice, square and triangle stems
- Song
Metadata - Timing, key, BPM, chords, drum loop, etc. derived from a file seed.
- Square
Note - Stem
Output - Stem
Sample - Sample of an individual stem
- Stems
Sample - Single sample of the stems
- Steps
- Yield the steps of a drum pattern infinitely
- Timing
- Triangle
Note
Enums§
- Arpeggio
Pattern - Chiptunomatic
Error - Convert
WavError - Generate
Error - Note
- Either a melody of bass note
- Song
Metadata From Path Error