Boomie-0.1.0 has been yanked.
Boomie
______ _______ _______ _______ _________ _______
( ___ \ ( ___ )( ___ |( )\__ __/( ____ \
| ( ) )| ( ) || ( ) || () () | ) ( | ( \/
| (__/ / | | | || | | || || || | | | | (__
| __ ( | | | || | | || |(_)| | | | | __)
| ( \ \ | | | || | | || | | | | | | (
| )___) )| (___) || (___) || ) ( |___) (___| (____/\
|/ \___/ (_______)(_______)|/ \|\_______/(_______/
Made for Liefde.
Real-time music synth and composition engine written in Rust with support for custom file formats, dynamic playback control, and advanced audio effects. Ideal for real time playback.
Features
Audio Synthesis
- Waveform types: Sine, Square, Triangle, Sawtooth, and Noise
- Sample-based playback: Load and play WAV files with pitch adjustment
- ADSR envelope shaping: Full Attack, Decay, Sustain, Release control
- Real-time synthesis: Low-latency audio output using
cpal
Effects Processing
- Reverb: Freeverb-based algorithm with room size, damping, wet/dry mix, and width controls
- Delay: Configurable delay time, feedback, and wet/dry mix
- Distortion: Drive, tone control, and wet/dry mix
File Formats
.mel, Melody Files
Define individual tracks with notes, instruments, and effects:
name: melody
waveform: sine
tempo: 120
volume: 0.8
attack: 0.01
decay: 0.1
sustain: 0.7
release: 0.2
note: C4, 1.0, 0.8
note: E4, 0.5, 0.9
note: G4, 1.0, 0.7
reverb: 0.6, 0.5, 0.3, 1.0
.bmi, Arrangement Files (Bundled Music Index)
Compose multiple melody tracks into complete songs:
name: song
track: bass.mel, 0.0
track: melody.mel, 2.0, volume=0.9
track: drums.mel, 4.0, pitch=1.2
loop: 0.0, 16.0
Compilation & Usage
Add to your Cargo.toml Dependecies:
# or newer when available
= "0.16.0"
= "2.3.0"
= "3.5.1"
Example
use *;
API Reference
Core Functions
SynthEngine::new(): Create a new synthesizer engineload_sample(name, path): Load a.wavfile into the sample cacheload_melody(name, path): Load a.melfileload_arrangement(path): Load a.bmifileplay_arrangement(arrangement): Start playbackstop(): Stop playback and clean up
Playback Control
pause()Vresume(): Pause and resume playbackset_loop_enabled(bool): Enable/disable loopingcrossfade_to(arrangement, duration): Smooth transition to a new arrangementget_playback_position(): Get current playback timeget_playback_state(): Get current state (Playing/Paused/Stopped)
Dynamic Parameters
set_master_volume(volume): Set global volume (0.0-2.0)set_master_pitch(pitch): Set global pitch multiplier (0.5-2.0)set_track_enabled(name, enabled): Enable/disable a trackset_track_volume(name, volume): Set track volume (0.0-2.0)interpolate_track_volume(name, target, duration): Gradual volume change
File Format Reference
Melody File (.mel)
Metadata:
name:- Melody nametempo:- BPM (default: 120)loop:- Loop points in seconds,start, end
Instrument:
waveform:- sine | square | triangle | sawtooth | noisesample:- Reference to loaded sample namevolume:- Amplitude (0.0-1.0)pitch:- Pitch multiplierattack:,decay:,sustain:,release:- ADSR envelope
Notes:
note: PITCH, DURATION, VELOCITY- Pitch: C4, D#5, Gb3, etc.
- Duration: In beats
- Velocity: 0.0-1.0
Effects:
reverb: room_size, damping, wet, widthdelay: time, feedback, wetdistortion: drive, tone, wet
Arrangement File (.bmi)
Metadata:
name:- Arrangement nameloop:- Loop points:start, end
Tracks:
track: melody_file.mel, start_time, [overrides...]
Override parameters:
volume=0.8orvol=0.8pitch=1.2tempo=140reverb=0.6:0.5:0.3:1.0delay=0.25:0.4:0.3distortion=2.0:0.7:0.5ordist=...
Note Parsing
Notes follow standard music notation:
- Base notes: C, D, E, F, G, A, B
- Sharps: C#, D#, etc. (also accepts 'S')
- Flats: Db, Eb, etc. (also accepts 'F' or 'B')
- Octaves: C4 (middle C), A3, E5, etc.
Technical Details
- Built on
cpalfor consistent audio output - Freeverb algorithm for reverb effect
- Linear interpolation for sample playback
- Automatic gain normalization to prevent clipping