JSPM

  • Created
  • Published
  • Downloads 108
  • Score
    100M100P100Q64683F
  • License MIT

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.

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 Logo

Rust TypeScript Node.js

Project Status Version License: MIT Platform

npm

🎼 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.

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
  • πŸ‘οΈ Watch mode for build and check commands
  • ⏱️ bpm assignment for setting tempo
  • 🧱 bank declaration 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
  • πŸ“„ let assignments for storing reusable values
  • πŸ”„ @load assignment to load a sample (.mp3, .wav) to use it as a value
  • πŸ› οΈ CLI tools for syntax checking (check), AST output (build)

πŸ“† Installation

For users

Install the package globally (NPM)

npm install -g @devaloop/devalang

Usage without install (NPX)

npx @devaloop/devalang <command>

For contributors

> 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:check
# For building test
npm run rust:dev:build

❔ Usage

For more examples, see docs/COMMANDS.md

Initialize a new project

In the current directory

devalang init

Or use optional arguments to specify a directory name and a template

devalang init --name <project-name> --template <template-name>

Checking syntax only

devalang check --entry <entry-directory> --output <output-directory> --watch

Building output files

devalang build --entry <entry-directory> --output <output-directory> --watch

βš™οΈ Configuration

You can use a configuration file to set default values for various settings, making it easier to manage your Devalang project.

To do this, create a .devalang file in the root of your project directory.

See docs/CONFIG.md for more information.

πŸ“„ 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 if statements
  • No support yet for @group, @pattern, @function statements
  • No support yet for cross-platform builds (Linux, macOS)

πŸ§ͺ Roadmap Highlights

For more info, see docs/ROADMAP.md

  • ⏳ Audio engine integration (priority for alpha.4)
  • ⏳ Other statements (e.g if, @group, ...)
  • ⏳ Cross-platform support (Linux, macOS)
  • ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)

πŸ›‘οΈ 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