devalang 0.2.0

Write music with code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound — in plain text.
Documentation
# =================
# Sleep Directive
# =================
# You can make the audio engine wait for a specified duration using the sleep/rest/wait directives.
# This is useful for creating pauses or delays in your audio sequences.
# NOTE: sleep, rest, and wait are synonymous in this context.
# 
# Syntax:
# `<sleep | rest | wait> <duration>`
#
# Duration formats:
# - Milliseconds: 1000 or 500ms
# - Beats/Fractions: 1/4 (quarter note), 1/8 (eighth note)
# - Temporal: 1 beat, 2 bar, 3 measure, 1 step

# Sleeps for 1000 milliseconds (1 second)
sleep 1000

# Rest for a quarter note (based on current BPM: 120 BPM = 500ms)
rest 1/4

# Waits for 1 beat at current BPM (120 BPM = 500ms)
wait 1 beat

# Sleep for 2 bars (at 120 BPM: 2 * 4 beats = 4000ms)
sleep 2 bar

# Rest for 3 measures (same as 3 bars)
rest 3 measure

# Sleep for 4 steps (1 beat = 500ms at 120 BPM)
sleep 4 steps

# Rest for 1 step (1/4 beat = 125ms at 120 BPM)
rest 1 step