@devaloop/devalang 0.1.3 โ†’ 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +121 -50
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,40 +19,50 @@
19
19
 
20
20
  # ๐ŸฆŠ Devalang โ€” Write music with code
21
21
 
22
- Devalang is a compact domain-specific language (DSL) for music makers, sound designers, and creative coders.
23
- Compose loops, control samples, synthesize audio, and render your ideas โ€” all in clean, readable text.
22
+ Devalang is a compact **domain-specific language** (DSL) for **music makers**, **sound designers**, and **creative coders**.
23
+ Compose loops, control samples, synthesize audio, and render your ideas โ€” all in clean, **readable text**.
24
24
 
25
- Whether you're prototyping a beat, building generative music, or performing live, Devalang gives you rhythmic precision with the elegance of code.
25
+ Whether you're prototyping a beat, building **generative music**, or **performing live**, Devalang gives you rhythmic precision with the elegance of code.
26
26
 
27
- From studio sketches to live sets, Devalang puts musical ideas into motion.
27
+ **From studio sketches to live sets, Devalang puts musical ideas into motion.**
28
28
 
29
- > **๐Ÿš€ v0.1.0 - Complete Rewriting**
30
- >
29
+
30
+ > **๐Ÿš€ v0.1.0+ - Complete Rewriting**
31
31
  >
32
32
  > **NEW**: [Devalang Playground V2.0 is now available](https://playground.devalang.com) โ€” Try it in your browser!
33
33
 
34
- ---
35
34
 
36
35
  ## ๐Ÿ“š Quick Access
37
36
 
37
+ ### Websites & Resources
38
+ - [๐ŸŒ Website](https://devalang.com) โ€” Project homepage
38
39
  - [โ–ถ๏ธ Playground](https://playground.devalang.com) โ€” Try Devalang in your browser
39
40
  - [๐Ÿ“– Documentation](https://docs.devalang.com) โ€” Complete language reference
40
- - [๐Ÿงฉ VSCode Extension](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode) โ€” Syntax highlighting & snippets
41
+
42
+ ### Important files
41
43
  - [๐Ÿ“œ Changelog](./docs/CHANGELOG.md) โ€” Version history
42
44
  - [๐Ÿ’ก Examples](./examples/)
43
- - [๐ŸŒ Website](https://devalang.com) โ€” Project homepage
44
- - [๐Ÿ“ฆ npm Package](https://www.npmjs.com/package/@devaloop/devalang)
45
- - [๐Ÿ“ฆ Rust Crate](https://crates.io/crates/devalang)
46
45
 
47
- ---
46
+ ### Common projects and tools
47
+ - [๐Ÿ“ฆ Devapack](https://github.com/devaloop-labs/devapack) โ€” Community-driven addons
48
+ - [๐Ÿงฉ VSCode Extension](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode) โ€” Syntax highlighting & snippets
49
+
50
+ ### Downloads
51
+ - [๐Ÿ™ Installers](https://devalang.com/download) โ€” For Windows, macOS, and Linux
52
+ - [๐Ÿ“ฆ npm](https://www.npmjs.com/package/@devaloop/devalang) โ€” Install via npm
53
+ - [๐Ÿ“ฆ cargo](https://crates.io/crates/devalang) โ€” Install via Cargo
48
54
 
49
55
  ## โšก Quick Start
50
56
 
51
57
  ### Try in Your Browser
52
58
 
53
- > **[Launch the Playground](https://playground.devalang.com)** to try Devalang without installing anything.
59
+ > **[Launch the Playground](https://playground.devalang.com) to try Devalang without installing anything.**
60
+
61
+ ### Download the Installers (Recommended)
54
62
 
55
- ### Install via npm (Recommended)
63
+ Visit the [Download page](https://devalang.com/download) to get the latest releases for Windows, macOS, and Linux.
64
+
65
+ ### Install via npm (Node.js)
56
66
 
57
67
  ```bash
58
68
  npm install -g @devaloop/devalang
@@ -83,17 +93,48 @@ devalang build --path examples/index.deva --formats wav mid
83
93
  devalang play --live --input examples/index.deva
84
94
  ```
85
95
 
86
- ---
96
+ ## ๐Ÿ“ฆ (optional) Install addons
97
+
98
+ Devalang supports addons to extend functionalities. This allows you to easily add sound banks, effects, or other features.
99
+
100
+ > To create your own addon, please refer to the [Devapack documentation](https://github.com/devaloop-labs/devapack/tree/main/docs).
101
+
102
+ ```bash
103
+ # List available addons
104
+ devalang addon list
105
+
106
+ # Install an addon (format: <author>.<addon-name>)
107
+ devalang addon install devaloop.808
108
+ ```
109
+
110
+ This will install the `devaloop.808` sound bank in your current working directory inside `.deva` folder.
111
+
112
+ **You can then use it in your Devalang scripts !**
113
+
114
+ ## ๐ŸŽต Your First Devalang File
87
115
 
88
- ## ๐ŸŽต Your First Devalang Script
116
+ Create a file `hello.deva` or `index.deva` (if you do not specify `--input` argument, it defaults to `index.deva`).
89
117
 
90
- Create a file `hello.deva`:
118
+ #### Nomenclature for .deva files
119
+
120
+ - Devalang files use the `.deva` extension.
121
+ - Devalang engine is **indentation-sensitive** for blocks, similar to Python.
122
+ - Files are plain text and can be edited with **any text editor** (VSCode recommended).
123
+ - Ensure your text editor supports **UTF-8 encoding**.
124
+ - Devalang is **case-sensitive**, so be consistent with capitalization.
125
+ - Devalang reads files from **top to bottom**, so order matters.
126
+ - Devalang files typically start with global settings (e.g., `bpm`, `bank`), followed by definitions (`synth`, `pattern`, `group`), and finally execution commands (`spawn`, `play`).
127
+ - Devalang files can include comments using `#` or `//` for single-line comments.
128
+ - You can name your files anything, but `index.deva` is a common convention for the main entry file.
129
+ - You can organize your project with subfolders as needed. (use module system like `@import { var } from '<module_path>'` and `@export { var }`).
130
+
131
+ Refer to the [documentation](https://docs.devalang.com) for a complete syntax reference.
91
132
 
92
133
  ```deva
93
134
  # Set the tempo
94
135
  bpm 120
95
136
 
96
- # Load a bank of sounds (make sur you have the bank installed)
137
+ # Load a bank of sounds (make sure you have the bank installed)
97
138
  bank devaloop.808 as drums
98
139
 
99
140
  # Create a simple kick pattern
@@ -104,32 +145,66 @@ let mySynth = synth saw
104
145
 
105
146
  # Define a melody using a group to organize notes
106
147
  group myMelody:
107
- mySynth -> note(C5)
108
- -> duration(500)
109
148
 
110
- mySynth -> note(E5)
111
- -> duration(500)
149
+ mySynth -> note(C5)
150
+ -> duration(500) # 500ms
151
+
152
+ mySynth -> note(E5)
153
+ -> duration(1/4) # Quarter note
112
154
 
113
- mySynth -> note(G5)
114
- -> duration(500)
155
+ mySynth -> note(G5)
156
+ -> duration(1/16) # Sixteenth note
157
+ -> velocity(0.8) # Velocity (0.0 to 1.0) or 0-127
158
+ -> lpf(800) # Lowpass filter at 800Hz
159
+ -> reverb({ size: 0.3 }) # Reverb effect
115
160
 
116
- # Play the melody
161
+ # Play the melody (in parallel)
117
162
  spawn myMelody
118
163
 
119
- # Play the kick pattern
164
+ # Play the kick pattern (in parallel too)
120
165
  spawn kickPattern
121
166
  ```
122
167
 
168
+ ### (optional) Configure project settings
169
+
170
+ You can create a `devalang.json` (recommended) or `devalang.toml` or even `.devalang` (legacy) file to customize check/build/play settings.
171
+
172
+ This typically evitate to re-type common arguments like `--path`, `--formats`, etc.
173
+
174
+ > Comments are not supported in config files, please use `devalang init` to generate a default config.
175
+
176
+ ```jsonc
177
+ {
178
+ "project": {
179
+ "name": "My Awesome Project" // Change this to adjust project name
180
+ },
181
+ "paths": {
182
+ "entry": "audio/helloWorld.deva", // Change this to adjust entry file path
183
+ "output": "output" // Change this to adjust output directory
184
+ },
185
+ "audio": {
186
+ "format": ["wav", "mid"], // Change this to adjust output formats (options: wav, mid, mp3)
187
+ "bit_depth": 16, // Change this to 24 or 32 for higher quality
188
+ "channels": 2, // Change this to 1 for mono output
189
+ "sample_rate": 44100, // Change this to 48000 for higher quality
190
+ "resample_quality": "sinc24", // Change this to adjust resampling quality (options: sinc8, sinc16, sinc24, sinc32)
191
+ "bpm": 120 // Change this to adjust the project tempo (only if not set in code)
192
+ },
193
+ "live": {
194
+ "crossfade_ms": 500 // Change this to adjust crossfade duration when playing live
195
+ }
196
+ }
197
+
198
+ ```
199
+
123
200
  ### Build the audio
124
201
 
125
202
  ```bash
126
- # Build to WAV
127
- devalang build --path hello.deva --formats wav
128
-
129
- # Output: ./output/audio/hello.wav
203
+ # Build to WAV, MP3, and MIDI
204
+ devalang build --path hello.deva --formats wav,mp3,mid
130
205
  ```
131
206
 
132
- # Play the audio
207
+ ### Play the audio
133
208
 
134
209
  ```bash
135
210
  # Play the audio file
@@ -137,9 +212,11 @@ devalang play --input hello.deva
137
212
 
138
213
  # Play live (repeats and watch until stopped)
139
214
  devalang play --live --input hello.deva
140
- ```
141
215
 
142
- ---
216
+ # Play live loop with very short crossfade
217
+ # With 50ms, transitions between loops are no more distinguishable
218
+ devalang play --live --crossfade-ms 50 --input hello.deva
219
+ ```
143
220
 
144
221
  ## ๐Ÿš€ Features
145
222
 
@@ -174,7 +251,7 @@ devalang play --live --input hello.deva
174
251
  ### ๐Ÿ“ฆ **Output Formats**
175
252
  - โœ… **WAV** โ€” 16/24/32-bit audio export
176
253
  - โœ… **MIDI** โ€” Standard MIDI file export
177
- - โœ… **MP3/FLAC** โ€” Planned
254
+ - โœ… **MP3** โ€” Lossy audio export (via LAME)
178
255
 
179
256
  ### ๐ŸŽฏ **Performance**
180
257
  - โšก **Fast builds** โ€” 7-10ms for typical projects
@@ -185,8 +262,6 @@ devalang play --live --input hello.deva
185
262
  - โœ… **Online Docs** โ€” Complete language reference
186
263
  - โœ… **VSCode Extension** โ€” Syntax highlighting
187
264
 
188
- ---
189
-
190
265
  ## ๐Ÿ’ก Why Devalang?
191
266
 
192
267
  - ๐ŸŽน **Prototype audio ideas** without opening a DAW
@@ -197,11 +272,9 @@ devalang play --live --input hello.deva
197
272
  - ๐ŸŽจ **Live code** with fast iteration cycles
198
273
  - ๐Ÿ“ฆ **Version control** your music with git
199
274
 
200
- ---
201
-
202
275
  ## ๐Ÿ“– Documentation
203
276
 
204
- **[Visit docs.devalang.com](https://docs.devalang.com)** for:
277
+ Visit **[docs.devalang.com](https://docs.devalang.com)** for:
205
278
  - Complete syntax reference
206
279
  - API documentation
207
280
  - WASM integration guide
@@ -209,8 +282,6 @@ devalang play --live --input hello.deva
209
282
  - Advanced tutorials
210
283
  - Best practices
211
284
 
212
- ---
213
-
214
285
  ## ๐Ÿ”ง Development
215
286
 
216
287
  ### Build from Source
@@ -220,14 +291,16 @@ devalang play --live --input hello.deva
220
291
  git clone https://github.com/devaloop-labs/devalang.git
221
292
  cd devalang
222
293
 
294
+ # NPM (TypeScript) and Cargo (Rust) are required
295
+ npm install
296
+
223
297
  # Build CLI (Rust)
224
- cargo build --release --features cli
298
+ cargo build
225
299
 
226
- # Build WASM
227
- cargo build --release --features wasm --lib
300
+ # Build WASM (Web & Node.js)
301
+ npm run rust:wasm:all
228
302
 
229
303
  # Build TypeScript
230
- npm install
231
304
  npm run ts:build
232
305
 
233
306
  # Run tests
@@ -247,18 +320,16 @@ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guideline
247
320
  - ๐ŸŽต **Share examples** of your creations
248
321
  - ๐Ÿงช **Write tests** for new features
249
322
 
250
- ---
251
-
252
323
  ## ๐Ÿ“œ License
253
324
 
254
325
  MIT License โ€” See [LICENSE](./LICENSE) for details.
255
326
 
256
- Copyright (c) 2025 Devaloop
327
+ Copyright (c) 2025 Labscend Studios
257
328
 
258
329
  ---
259
330
 
260
331
  <div align="center">
261
- <strong>Made with โค๏ธ by the Devaloop team</strong>
332
+ <strong>Made with โค๏ธ by <a href="https://labscend.studio">Labscend Studios</a></strong>
262
333
  <br />
263
- <sub>Star โญ the repo if you like it!</sub>
334
+ <sub>Star โญ the repo if you like it !</sub>
264
335
  </div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devaloop/devalang",
3
3
  "private": false,
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "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.",
6
6
  "main": "out-tsc/index.js",
7
7
  "types": "./out-tsc/index.d.ts",