Package Exports
- @devaloop/devalang
- @devaloop/devalang/out-tsc/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@devaloop/devalang) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π¦ Devalang (CORE) β Compose music with code
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.
NEW: Devaforge is now available for creating addons.
NEW: Now available for Windows, Linux, and macOS.
π Quick Access
- βΆοΈ Playground
- π Documentation
- π§© VSCode Extension
- π¨ Prettier Plugin
- π Changelog
- π‘ Examples
- π Project Website
- π¦ Devaforge on npm
- π¦ Devalang on npm
β±οΈ Try it now !
Try Devalang in your browser
Have a look at the Playground to try Devalang directly in your browser
Try Devalang in your terminal
With Node.js
npm install -g @devaloop/devalang@latestWith Rust
cargo install devalangInitialize a new project
devalang init --name my-project --template minimalWrite your first script
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, target_freq: 659.25 })
myLead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
# Spawning the group & the pattern to play them in parallel
spawn myGroup
spawn kickPatternAnd the best part ? You can play it directly from the command line:
Play the script once
devalang playLIVE mode (repeat the playback + watch mode)
devalang play --repeatπ You can now hear your Devalang code in action
For more examples, check out the examples directory
β Why Devalang ?
- πΉ Prototype audio ideas without opening a DAW, even VSCode with our Playground
- π» Integrate sound into code-based workflows
- ποΈ Control audio parameters through readable syntax
- π§ͺ Build musical logic with variables and conditions
- π Create complex patterns with ease
π Features
- β‘ Fast Build & Hot Reload β optimized build process for quicker iteration.
- π΅ Audio Engine & Real-time runner β low-latency playback, render-to-file, and a realtime runner used by
devalang playfor live feedback. - βΆοΈ Live mode (watch + repeat) β edit and hear changes instantly with
devalang play --repeatand watch mode. - π§© Language primitives β synths, notes, ADSR, maps, arrays, loops, conditionals and functions for expressive musical logic.
- ποΈ Per-note automation & modulators β
automatemaps,$mod.*,$easing.*and$math.*helpers for envelopes and LFOs. - π§© Module system & structured AST β import/export variables, stable AST output for debugging and tooling.
- π§° Plugins & Addons (WASM-ready) β install plugins/banks,
@usedirective, and WASM plugin integration so plugins can render or process audio at runtime. - π¦ Addon manager & Devaforge β CLI commands to discover/install banks, plugins and templates;
devaforgehelps create addons. - βοΈ CLI tooling β
build,check,play,install,init,discover,telemetryand more with consistent flags (--watch,--debug,--compress). - π Project templates & examples β quick-start templates and many example projects in
examples/. - π§βπ» TypeScript API & WASM distribution β Node-friendly package with TypeScript bindings and a WASM build for browser/Node usage.
- π§° Editor & formatting support β VSCode extension and Prettier plugin to edit Devalang with syntax and formatting support.
- π΅ Custom samples & banks β drop samples into
.devaand reference them from code; banks of sounds for fast composition. - π Looping, grouping & scheduling β precise beat-tied scheduling primitives for complex rhythmic patterns.
π Documentation
Please refer to the online documentation for detailed information on syntax, features, and usage examples
π° What's new
- Devaforge: Introduced a new system for creating and managing addons, including a CLI for addon generation.
- Documentation updates: Improved documentation for clarity and completeness.
- Discovering addons: Introduced a new command to detect addons.
- Public TypeScript API: Added a public TypeScript API for easier integration.
- Improved error messages: Enhanced error messages for better debugging.
- Bug fixes: Various bug fixes and stability improvements.
π§ͺ Roadmap Highlights
For more info, see docs/ROADMAP.md
- β³ Smart modules
π‘οΈ License
MIT β see LICENSE
π€ Contributing
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.
π’ Contact
Feel free to reach out for any inquiries or feedback.
π§ contact@devaloop.com