| Crates.io | devalang |
| lib.rs | devalang |
| version | 0.0.1-beta.3 |
| created_at | 2025-07-05 12:39:17.26011+00 |
| updated_at | 2025-09-20 06:14:43.728646+00 |
| description | Write music like code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound β in plain text. |
| homepage | https://devalang.com |
| repository | https://github.com/devaloop-labs/devalang |
| max_upload_size | |
| id | 1739035 |
| size | 1,037,593 |
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers. Compose loops, control samples, render and play audio β all in clean, readable text.
Whether you're building a track, shaping textures, or performing live, Devalang helps you think in rhythms. Itβs designed to be simple, expressive, and fast β because your ideas shouldnβt wait.
From studio sketches to live sets, Devalang gives you rhythmic control β with the elegance of code.
π§ Notice π§
Includes synthesis, playback, and rendering features, but is still in early development, and breaking changes may occur.
Have a look at the Playground to try Devalang directly in your browser
npm install -g @devaloop/devalang@latest
cargo install devalang --version <version>
devalang init --name my-project --template minimal
Create a new Devalang file src/index.deva in the project directory:
# src/index.deva
# BPM definition
bpm 125
# Bank picking (make sure you've installed it)
bank devaloop.808 as my808Bank
# Pattern literal without options
pattern kickPattern with my808Bank.kick = "x--- x--- x--- x---"
group myGroup:
# Rhythmic (each beat playing a kick)
# on beat:
# .my808Bank.kick 1/4
# Synth definition with ADSR
let myLead = synth sine {
attack: 0,
decay: 100,
sustain: 100,
release: 100
}
# Global automation
automate myLead:
param volume {
0% = 0.0
100% = 0.5
}
param pitch {
0% = -12.0
100% = 12.0
}
# Notes in a loop with condition
for i in [1, 2, 3]:
if i == 3:
myLead -> note(C5, { duration: 200 })
print "Playing note C5 for " + i
# Pause runtime for 500ms
sleep 500
# Note with automation
myLead -> note(C4, {
duration: 400,
velocity: 0.8,
automate: {
pan: {
0%: -1.0,
100%: 0.0
}
}
})
# Notes with params
myLead -> note(G4, { duration: 600, glide: true })
myLead -> note(B3, { duration: 400, slide: true })
# Spawning the group & the pattern to play them in parallel
spawn myGroup
spawn kickPattern
devalang play
devalang play --repeat
For more examples, check out the examples directory
devalang play --repeat for live feedback.automate maps, $mod.*, $easing.* and $math.* helpers for envelopes and LFOs.@use directive, and WASM plugin integration so plugins can render or process audio at runtime.devaforge helps create addons.build, check, play, install, init, discover, telemetry and more with consistent flags (--watch, --debug, --compress).examples/..deva and reference them from code; banks of sounds for fast composition.MIT β see LICENSE
Contributions, bug reports and suggestions are welcome !
Feel free to open an issue or submit a pull request.
For more info, see docs/CONTRIBUTING.md.
Feel free to reach out for any inquiries or feedback.
π§ contact@devaloop.com