@devaloop/devalang 0.1.2 โ†’ 0.1.4

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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Devaloop Labs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Devaloop Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,251 +1,335 @@
1
- <div align="center">
2
- <img src="https://devalang.com/images/devalang-logo-min.png" alt="Devalang Logo" width="100" />
3
- </div>
4
-
5
- ![Rust](https://img.shields.io/badge/Made%20with-Rust-orange?logo=rust)
6
- ![TypeScript](https://img.shields.io/badge/Built%20with-TypeScript-blue?logo=typescript)
7
- ![Node.js](https://img.shields.io/badge/Node.js-16%2B-brightgreen?logo=node.js)
8
-
9
- ![Project Status](https://img.shields.io/badge/status-preview-blue)
10
- ![Version](https://img.shields.io/npm/v/@devaloop/devalang)
11
- ![License: MIT](https://img.shields.io/badge/license-MIT-green)
12
-
13
- ![Linux](https://img.shields.io/badge/linux-supported-blue?logo=linux)
14
- ![macOS](https://img.shields.io/badge/macOS-supported-blue?logo=apple)
15
- ![Windows](https://img.shields.io/badge/windows-supported-blue?logo=windows)
16
-
17
- ![npm](https://img.shields.io/npm/dt/@devaloop/devalang)
18
- ![crates](https://img.shields.io/crates/d/devalang)
19
-
20
- # ๐ŸฆŠ Devalang โ€” Write music with code
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.
24
-
25
- Whether you're prototyping a beat, building generative music, or performing live, Devalang gives you rhythmic precision with the elegance of code.
26
-
27
- From studio sketches to live sets, Devalang puts musical ideas into motion.
28
-
29
- > **๐Ÿš€ v0.1.0 - Complete Rewriting**
30
- >
31
- >
32
- > **NEW**: [Devalang Playground V2.0 is now available](https://playground.devalang.com) โ€” Try it in your browser!
33
-
34
- ---
35
-
36
- ## ๐Ÿ“š Quick Access
37
-
38
- - [โ–ถ๏ธ Playground](https://playground.devalang.com) โ€” Try Devalang in your browser
39
- - [๐Ÿ“– Documentation](https://docs.devalang.com) โ€” Complete language reference
40
- - [๐Ÿงฉ VSCode Extension](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode) โ€” Syntax highlighting & snippets
41
- - [๐Ÿ“œ Changelog](./docs/CHANGELOG.md) โ€” Version history
42
- - [๐Ÿ’ก 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
-
47
- ---
48
-
49
- ## โšก Quick Start
50
-
51
- ### Try in Your Browser
52
-
53
- > **[Launch the Playground](https://playground.devalang.com)** to try Devalang without installing anything.
54
-
55
- ### Install via npm (Recommended)
56
-
57
- ```bash
58
- npm install -g @devaloop/devalang
59
- ```
60
-
61
- ### Install via Cargo (Rust)
62
-
63
- ```bash
64
- cargo install devalang
65
- ```
66
-
67
- ### Create Your First Project
68
-
69
- ```bash
70
- # Initialize a new project
71
- devalang init my-project
72
-
73
- # Navigate to the project
74
- cd my-project
75
-
76
- # Check syntax
77
- devalang check --entry examples/index.deva
78
-
79
- # Build audio files
80
- devalang build --path examples/index.deva --formats wav mid
81
-
82
- # Play audio (live mode)
83
- devalang play --live --input examples/index.deva
84
- ```
85
-
86
- ---
87
-
88
- ## ๐ŸŽต Your First Devalang Script
89
-
90
- Create a file `hello.deva`:
91
-
92
- ```deva
93
- # Set the tempo
94
- bpm 120
95
-
96
- # Load a bank of sounds
97
- bank devaloop.808 as drums
98
-
99
- # Create a simple drum pattern
100
- pattern kickPattern with drums.kick = "x--- x--- x--- x---"
101
- pattern snarePattern with drums.snare = "---- x--- ---- x---"
102
- pattern hihatPattern with drums.hihat = "x-x- x-x- x-x- x-x-"
103
-
104
- # Play the patterns
105
- call kickPattern
106
- call snarePattern
107
- call hihatPattern
108
- ```
109
-
110
- ### Build the audio
111
-
112
- ```bash
113
- # Build to WAV
114
- devalang build --path hello.deva --formats wav
115
-
116
- # Output: ./output/audio/hello.wav
117
- ```
118
-
119
- # Play the audio
120
-
121
- ```bash
122
- # Play the audio file
123
- devalang play --input hello.deva
124
-
125
- # Play live (repeats and watch until stopped)
126
- devalang play --live --input hello.deva
127
- ```
128
-
129
- ---
130
-
131
- ## ๐Ÿš€ Features
132
-
133
- ### ๐ŸŽต **Core Language**
134
- - โœ… **Lexer & Parser** โ€” Complete tokenization and AST generation
135
- - โœ… **Patterns** โ€” Rhythmic notation with swing, humanize, velocity
136
- - โœ… **Synths** โ€” Built-in synthesizers with ADSR envelopes
137
- - โœ… **Filters** โ€” Lowpass, highpass, bandpass audio filtering
138
- - โœ… **Effects** โ€” Reverb, delay, distortion, drive, chorus
139
- - โœ… **Variables** โ€” `let`, `const`, `var` with scoping
140
- - โœ… **Groups & Spawn** โ€” Organize and parallelize execution
141
- - โœ… **Loops & Conditions** โ€” `for`, `if`, `else` control flow
142
- - โœ… **Triggers** โ€” Conditional audio triggering
143
- - โœ… **Events** โ€” Event system with `on` and `emit`
144
-
145
- ### ๐Ÿ› ๏ธ **CLI Tools**
146
- - โœ… `devalang init` โ€” Scaffold new projects (3 templates)
147
- - โœ… `devalang build` โ€” Compile to WAV/MIDI
148
- - โœ… `devalang check` โ€” Validate syntax
149
- - โœ… `devalang play` โ€” Audio playback
150
- - โœ… `devalang addon` โ€” Manage addons (install, list, discover)
151
- - โœ… `devalang login/logout` โ€” Authentication
152
- - โœ… `devalang telemetry` โ€” Privacy controls
153
-
154
- ### ๐ŸŒ **WASM API**
155
- - โœ… `render_audio()` โ€” Browser audio rendering
156
- - โœ… `render_midi_array()` โ€” MIDI export
157
- - โœ… `debug_render()` โ€” Debug information
158
- - โœ… `parse()` โ€” Parse Devalang code
159
- - โœ… TypeScript types included
160
-
161
- ### ๐Ÿ“ฆ **Output Formats**
162
- - โœ… **WAV** โ€” 16/24/32-bit audio export
163
- - โœ… **MIDI** โ€” Standard MIDI file export
164
- - โš ๏ธ **MP3/FLAC** โ€” Planned for v0.1.1
165
-
166
- ### ๐ŸŽฏ **Performance**
167
- - โšก **Fast builds** โ€” 7-10ms for typical projects
168
- - โšก **Low latency** โ€” Optimized audio engine
169
- - โšก **Release builds** โ€” 5-6x faster than debug
170
-
171
- ### ๐Ÿ“š **Learning Resources**
172
- - โœ… **Online Docs** โ€” Complete language reference
173
- - โœ… **VSCode Extension** โ€” Syntax highlighting
174
-
175
- ---
176
-
177
- ## ๐Ÿ’ก Why Devalang?
178
-
179
- - ๐ŸŽน **Prototype audio ideas** without opening a DAW
180
- - ๐Ÿ’ป **Integrate sound** into code-based workflows
181
- - ๐ŸŽ›๏ธ **Control audio parameters** with readable syntax
182
- - ๐Ÿงช **Build musical logic** with variables and conditions
183
- - ๐Ÿ”„ **Create patterns** with expressive notation
184
- - ๐ŸŽจ **Live code** with fast iteration cycles
185
- - ๐Ÿ“ฆ **Version control** your music with git
186
-
187
- ---
188
-
189
- ## ๐Ÿ“– Documentation
190
-
191
- **[Visit docs.devalang.com](https://docs.devalang.com)** for:
192
- - Complete syntax reference
193
- - API documentation
194
- - WASM integration guide
195
- - CLI command reference
196
- - Advanced tutorials
197
- - Best practices
198
-
199
- ---
200
-
201
- ## ๐Ÿ”ง Development
202
-
203
- ### Build from Source
204
-
205
- ```bash
206
- # Clone the repository
207
- git clone https://github.com/devaloop-labs/devalang.git
208
- cd devalang
209
-
210
- # Build CLI (Rust)
211
- cargo build --release --features cli
212
-
213
- # Build WASM
214
- cargo build --release --features wasm --lib
215
-
216
- # Build TypeScript
217
- npm install
218
- npm run ts:build
219
-
220
- # Run tests
221
- cargo test --features cli
222
- npm test
223
- ```
224
-
225
- ## ๐Ÿค Contributing
226
-
227
- We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
228
-
229
- ### Ways to Contribute
230
-
231
- - ๐Ÿ› **Report bugs** via [GitHub Issues](https://github.com/devaloop-labs/devalang/issues)
232
- - ๐Ÿ’ก **Suggest features** in discussions
233
- - ๐Ÿ“ **Improve docs** with pull requests
234
- - ๐ŸŽต **Share examples** of your creations
235
- - ๐Ÿงช **Write tests** for new features
236
-
237
- ---
238
-
239
- ## ๐Ÿ“œ License
240
-
241
- MIT License โ€” See [LICENSE](./LICENSE) for details.
242
-
243
- Copyright (c) 2025 Devaloop
244
-
245
- ---
246
-
247
- <div align="center">
248
- <strong>Made with โค๏ธ by the Devaloop team</strong>
249
- <br />
250
- <sub>Star โญ the repo if you like it!</sub>
251
- </div>
1
+ <div align="center">
2
+ <img src="https://devalang.com/images/devalang-logo-min.png" alt="Devalang Logo" width="100" />
3
+ </div>
4
+
5
+ ![Rust](https://img.shields.io/badge/Made%20with-Rust-orange?logo=rust)
6
+ ![TypeScript](https://img.shields.io/badge/Built%20with-TypeScript-blue?logo=typescript)
7
+ ![Node.js](https://img.shields.io/badge/Node.js-16%2B-brightgreen?logo=node.js)
8
+
9
+ ![Project Status](https://img.shields.io/badge/status-preview-blue)
10
+ ![Version](https://img.shields.io/npm/v/@devaloop/devalang)
11
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
12
+
13
+ ![Linux](https://img.shields.io/badge/linux-supported-blue?logo=linux)
14
+ ![macOS](https://img.shields.io/badge/macOS-supported-blue?logo=apple)
15
+ ![Windows](https://img.shields.io/badge/windows-supported-blue?logo=windows)
16
+
17
+ ![npm](https://img.shields.io/npm/dt/@devaloop/devalang)
18
+ ![crates](https://img.shields.io/crates/d/devalang)
19
+
20
+ # ๐ŸฆŠ Devalang โ€” Write music with code
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**.
24
+
25
+ Whether you're prototyping a beat, building **generative music**, or **performing live**, Devalang gives you rhythmic precision with the elegance of code.
26
+
27
+ **From studio sketches to live sets, Devalang puts musical ideas into motion.**
28
+
29
+
30
+ > **๐Ÿš€ v0.1.0+ - Complete Rewriting**
31
+ >
32
+ > **NEW**: [Devalang Playground V2.0 is now available](https://playground.devalang.com) โ€” Try it in your browser!
33
+
34
+
35
+ ## ๐Ÿ“š Quick Access
36
+
37
+ ### Websites & Resources
38
+ - [๐ŸŒ Website](https://devalang.com) โ€” Project homepage
39
+ - [โ–ถ๏ธ Playground](https://playground.devalang.com) โ€” Try Devalang in your browser
40
+ - [๐Ÿ“– Documentation](https://docs.devalang.com) โ€” Complete language reference
41
+
42
+ ### Important files
43
+ - [๐Ÿ“œ Changelog](./docs/CHANGELOG.md) โ€” Version history
44
+ - [๐Ÿ’ก Examples](./examples/)
45
+
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
54
+
55
+ ## โšก Quick Start
56
+
57
+ ### Try in Your Browser
58
+
59
+ > **[Launch the Playground](https://playground.devalang.com) to try Devalang without installing anything.**
60
+
61
+ ### Download the Installers (Recommended)
62
+
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)
66
+
67
+ ```bash
68
+ npm install -g @devaloop/devalang
69
+ ```
70
+
71
+ ### Install via Cargo (Rust)
72
+
73
+ ```bash
74
+ cargo install devalang
75
+ ```
76
+
77
+ ### Create Your First Project
78
+
79
+ ```bash
80
+ # Initialize a new project
81
+ devalang init my-project
82
+
83
+ # Navigate to the project
84
+ cd my-project
85
+
86
+ # Check syntax
87
+ devalang check --entry examples/index.deva
88
+
89
+ # Build audio files
90
+ devalang build --path examples/index.deva --formats wav mid
91
+
92
+ # Play audio (live mode)
93
+ devalang play --live --input examples/index.deva
94
+ ```
95
+
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
115
+
116
+ Create a file `hello.deva` or `index.deva` (if you do not specify `--input` argument, it defaults to `index.deva`).
117
+
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.
132
+
133
+ ```deva
134
+ # Set the tempo
135
+ bpm 120
136
+
137
+ # Load a bank of sounds (make sure you have the bank installed)
138
+ bank devaloop.808 as drums
139
+
140
+ # Create a simple kick pattern
141
+ pattern kickPattern with drums.kick = "x--- x--- x--- x---"
142
+
143
+ # Define a synth and a melody
144
+ let mySynth = synth saw
145
+
146
+ # Define a melody using a group to organize notes
147
+ group myMelody:
148
+
149
+ mySynth -> note(C5)
150
+ -> duration(500) # 500ms
151
+
152
+ mySynth -> note(E5)
153
+ -> duration(1/4) # Quarter note
154
+
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
160
+
161
+ # Play the melody (in parallel)
162
+ spawn myMelody
163
+
164
+ # Play the kick pattern (in parallel too)
165
+ spawn kickPattern
166
+ ```
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
+
200
+ ### Build the audio
201
+
202
+ ```bash
203
+ # Build to WAV, MP3, and MIDI
204
+ devalang build --path hello.deva --formats wav,mp3,mid
205
+ ```
206
+
207
+ ### Play the audio
208
+
209
+ ```bash
210
+ # Play the audio file
211
+ devalang play --input hello.deva
212
+
213
+ # Play live (repeats and watch until stopped)
214
+ devalang play --live --input hello.deva
215
+
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
+ ```
220
+
221
+ ## ๐Ÿš€ Features
222
+
223
+ ### ๐ŸŽต **Core Language**
224
+ - โœ… **Lexer & Parser** โ€” Complete tokenization and AST generation
225
+ - โœ… **Patterns** โ€” Rhythmic notation with swing, humanize, velocity
226
+ - โœ… **Synths** โ€” Built-in synthesizers with ADSR envelopes
227
+ - โœ… **Filters** โ€” Lowpass, highpass, bandpass audio filtering
228
+ - โœ… **Effects** โ€” Reverb, delay, distortion, drive, chorus
229
+ - โœ… **Variables** โ€” `let`, `const`, `var` with scoping
230
+ - โœ… **Groups & Spawn** โ€” Organize and parallelize execution
231
+ - โœ… **Loops & Conditions** โ€” `for`, `if`, `else` control flow
232
+ - โœ… **Triggers** โ€” Conditional audio triggering
233
+ - โœ… **Events** โ€” Event system with `on` and `emit`
234
+
235
+ ### ๐Ÿ› ๏ธ **CLI Tools**
236
+ - โœ… `devalang init` โ€” Scaffold new projects (3 templates)
237
+ - โœ… `devalang build` โ€” Compile to WAV/MIDI
238
+ - โœ… `devalang check` โ€” Validate syntax
239
+ - โœ… `devalang play` โ€” Audio playback
240
+ - โœ… `devalang addon` โ€” Manage addons (install, list, discover)
241
+ - โœ… `devalang login/logout` โ€” Authentication
242
+ - โœ… `devalang telemetry` โ€” Privacy controls
243
+
244
+ ### ๐ŸŒ **WASM API**
245
+ - โœ… `render_audio()` โ€” Browser audio rendering
246
+ - โœ… `render_midi_array()` โ€” MIDI export
247
+ - โœ… `debug_render()` โ€” Debug information
248
+ - โœ… `parse()` โ€” Parse Devalang code
249
+ - โœ… TypeScript types included
250
+
251
+ ### ๐Ÿ“ฆ **Output Formats**
252
+ - โœ… **WAV** โ€” 16/24/32-bit audio export
253
+ - โœ… **MIDI** โ€” Standard MIDI file export
254
+ - โœ… **MP3** โ€” Lossy audio export (via LAME)
255
+
256
+ ### ๐ŸŽฏ **Performance**
257
+ - โšก **Fast builds** โ€” 7-10ms for typical projects
258
+ - โšก **Low latency** โ€” Optimized audio engine
259
+ - โšก **Release builds** โ€” 5-6x faster than debug
260
+
261
+ ### ๐Ÿ“š **Learning Resources**
262
+ - โœ… **Online Docs** โ€” Complete language reference
263
+ - โœ… **VSCode Extension** โ€” Syntax highlighting
264
+
265
+ ## ๐Ÿ’ก Why Devalang?
266
+
267
+ - ๐ŸŽน **Prototype audio ideas** without opening a DAW
268
+ - ๐Ÿ’ป **Integrate sound** into code-based workflows
269
+ - ๐ŸŽ›๏ธ **Control audio parameters** with readable syntax
270
+ - ๐Ÿงช **Build musical logic** with variables and conditions
271
+ - ๐Ÿ”„ **Create patterns** with expressive notation
272
+ - ๐ŸŽจ **Live code** with fast iteration cycles
273
+ - ๐Ÿ“ฆ **Version control** your music with git
274
+
275
+ ## ๐Ÿ“– Documentation
276
+
277
+ Visit **[docs.devalang.com](https://docs.devalang.com)** for:
278
+ - Complete syntax reference
279
+ - API documentation
280
+ - WASM integration guide
281
+ - CLI command reference
282
+ - Advanced tutorials
283
+ - Best practices
284
+
285
+ ## ๐Ÿ”ง Development
286
+
287
+ ### Build from Source
288
+
289
+ ```bash
290
+ # Clone the repository
291
+ git clone https://github.com/devaloop-labs/devalang.git
292
+ cd devalang
293
+
294
+ # NPM (TypeScript) and Cargo (Rust) are required
295
+ npm install
296
+
297
+ # Build CLI (Rust)
298
+ cargo build
299
+
300
+ # Build WASM (Web & Node.js)
301
+ npm run rust:wasm:all
302
+
303
+ # Build TypeScript
304
+ npm run ts:build
305
+
306
+ # Run tests
307
+ cargo test --features cli
308
+ npm test
309
+ ```
310
+
311
+ ## ๐Ÿค Contributing
312
+
313
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
314
+
315
+ ### Ways to Contribute
316
+
317
+ - ๐Ÿ› **Report bugs** via [GitHub Issues](https://github.com/devaloop-labs/devalang/issues)
318
+ - ๐Ÿ’ก **Suggest features** in discussions
319
+ - ๐Ÿ“ **Improve docs** with pull requests
320
+ - ๐ŸŽต **Share examples** of your creations
321
+ - ๐Ÿงช **Write tests** for new features
322
+
323
+ ## ๐Ÿ“œ License
324
+
325
+ MIT License โ€” See [LICENSE](./LICENSE) for details.
326
+
327
+ Copyright (c) 2025 Devaloop
328
+
329
+ ---
330
+
331
+ <div align="center">
332
+ <strong>Made with โค๏ธ by <a href="https://labscend.studio">Labscend Studios</a></strong>
333
+ <br />
334
+ <sub>Star โญ the repo if you like it !</sub>
335
+ </div>
@@ -44,10 +44,10 @@ async function main() {
44
44
  console.log('๐ŸŽต Devalang TypeScript API Example\n');
45
45
  // 1. Parse Devalang code
46
46
  console.log('1๏ธโƒฃ Parsing code...');
47
- const parseResult = await devalang.parse('example.deva', `
48
- bpm 120
49
- let s = synth sine {}
50
- s -> note(C4, { duration: 500 })
47
+ const parseResult = await devalang.parse('example.deva', `
48
+ bpm 120
49
+ let s = synth sine {}
50
+ s -> note(C4, { duration: 500 })
51
51
  `);
52
52
  if (parseResult.success) {
53
53
  console.log(`โœ… Parsed ${parseResult.statements.length} statements\n`);
@@ -58,13 +58,13 @@ async function main() {
58
58
  }
59
59
  // 2. Render audio
60
60
  console.log('2๏ธโƒฃ Rendering audio...');
61
- const audioCode = `
62
- bpm 120
63
- let mySynth = synth sine {
64
- attack: 0.01,
65
- release: 0.3
66
- }
67
- mySynth -> note(A4, { duration: 1000, velocity: 80 })
61
+ const audioCode = `
62
+ bpm 120
63
+ let mySynth = synth sine {
64
+ attack: 0.01,
65
+ release: 0.3
66
+ }
67
+ mySynth -> note(A4, { duration: 1000, velocity: 80 })
68
68
  `;
69
69
  const audioBuffer = await devalang.renderAudio(audioCode, {
70
70
  sampleRate: 44100,
@@ -81,12 +81,12 @@ async function main() {
81
81
  console.log(` - BPM: ${debugResult.bpm}\n`);
82
82
  // 4. Export MIDI
83
83
  console.log('4๏ธโƒฃ Exporting MIDI...');
84
- const midiCode = `
85
- bpm 140
86
- let piano = synth sine {}
87
- piano -> note(C4, { duration: 500 })
88
- piano -> note(E4, { duration: 500 })
89
- piano -> note(G4, { duration: 1000 })
84
+ const midiCode = `
85
+ bpm 140
86
+ let piano = synth sine {}
87
+ piano -> note(C4, { duration: 500 })
88
+ piano -> note(E4, { duration: 500 })
89
+ piano -> note(G4, { duration: 1000 })
90
90
  `;
91
91
  const midiBytes = await devalang.renderMidi(midiCode, {
92
92
  bpm: 140
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devaloop/devalang",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
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",