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, by Devaloop Labs
πΆ Compose music with code β simple, structured, sonic.
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers. Compose loops, control samples, and automate parameters β 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.
π§ v0.0.1-alpha.1 Notice π§
Devalang is still in early development. This version does not yet include sound rendering.
You can parse code, generate the AST, and validate syntax β all essential building blocks for the upcoming audio engine.
Currently, only
.kickis included as a built-in trigger. Custom instruments can be defined with@load, allowing any sound sample to be triggered with the same syntax.Currently, Devalang CLI is only available for Windows.
Linux and macOS binaries will be added in future releases via cross-platform builds.
π Features
- π§© Module system for importing and exporting variables between files (
@import,@export) - π Structured AST generation for debugging and future compilation
- π’ Basic data types: strings, numbers, booleans, maps, arrays
- β±οΈ
bpmassignment for setting tempo - π§±
bankdeclaration to define the instrument set - π Looping system with fixed repetitions (
loop 4:) - π§ͺ Instruction calls with parameters (e.g.
.kick auto {reverb:10, decay:20}) for testing pattern syntax - π
letassignments for storing reusable values - π
@loadassignment to load a sample (.mp3, .wav) to use it as a value - π οΈ CLI tools for syntax checking (
check), AST output (build)
π Installation
For users
- β οΈ Requires Node.js 18+
Install the package globally (NPM)
npm install -g @devaloop/devalangUsage without install (NPX)
npx @devaloop/devalang <command>For contributors
- β οΈ Requires Node.js 18+
- β οΈ Requires Rust 1.70+
> git clone https://github.com/devaloop-labs/devalang.git
> cd devalang
> npm install
> cargo install --path .Usage for development (feel free to change arguments in package.json)
# For syntax checking test
npm run rust:dev <command>β Usage
For more examples, see docs/COMMANDS.md
Checking syntax only and output debug files
devalang check --entry <entry-directory> --output <output-directory>Building output file(s) (AST generation for the moment)
devalang build --entry <entry-directory> --output <output-directory>π Syntax example
For more examples, see docs/SYNTAX.md
# index.deva
@import { globalBpm, globalBank, kickDuration } from "global.deva"
bpm globalBpm
# Will declare the tempo at the globalBpm variable beats per minute
bank globalBank
# Will declare a custom instrument bank using the globalBank variable
loop 5:
.kick kickDuration {reverb=50, drive=25}
# Will play 5 times a kick for the duration of the kickDuration variable with reverb and drive effects# global.deva
let globalBpm = 120
let globalBank = 808
let kickDuration = 500
@export { globalBpm, globalBank, kickDuration }π§― Known issues
- No support yet for Audio Engine
- No support yet for
if,else,else ifstatements - No support yet for
@group,@pattern,@functionstatements - Nested loops and conditions may not be fully tested
π§ͺ Roadmap Highlights
For more info, see docs/ROADMAP.md
- β³ Audio engine integration
- β³ Other statements (e.g
if,@group, ...) - β³ Watch mode for automatic rebuilds
π‘οΈ License
MIT β see LICENSE
π€ Contributing
Contributions, bug reports and suggestions are welcome !
Feel free to open an issue or submit a pull request.
π’ Contact
π§ contact@devaloop.com