@devaloop/devalang 0.1.2 โ†’ 0.1.3

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,264 @@
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
+ > **๐Ÿš€ 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 (make sur you have the bank installed)
97
+ bank devaloop.808 as drums
98
+
99
+ # Create a simple kick pattern
100
+ pattern kickPattern with drums.kick = "x--- x--- x--- x---"
101
+
102
+ # Define a synth and a melody
103
+ let mySynth = synth saw
104
+
105
+ # Define a melody using a group to organize notes
106
+ group myMelody:
107
+ mySynth -> note(C5)
108
+ -> duration(500)
109
+
110
+ mySynth -> note(E5)
111
+ -> duration(500)
112
+
113
+ mySynth -> note(G5)
114
+ -> duration(500)
115
+
116
+ # Play the melody
117
+ spawn myMelody
118
+
119
+ # Play the kick pattern
120
+ spawn kickPattern
121
+ ```
122
+
123
+ ### Build the audio
124
+
125
+ ```bash
126
+ # Build to WAV
127
+ devalang build --path hello.deva --formats wav
128
+
129
+ # Output: ./output/audio/hello.wav
130
+ ```
131
+
132
+ # Play the audio
133
+
134
+ ```bash
135
+ # Play the audio file
136
+ devalang play --input hello.deva
137
+
138
+ # Play live (repeats and watch until stopped)
139
+ devalang play --live --input hello.deva
140
+ ```
141
+
142
+ ---
143
+
144
+ ## ๐Ÿš€ Features
145
+
146
+ ### ๐ŸŽต **Core Language**
147
+ - โœ… **Lexer & Parser** โ€” Complete tokenization and AST generation
148
+ - โœ… **Patterns** โ€” Rhythmic notation with swing, humanize, velocity
149
+ - โœ… **Synths** โ€” Built-in synthesizers with ADSR envelopes
150
+ - โœ… **Filters** โ€” Lowpass, highpass, bandpass audio filtering
151
+ - โœ… **Effects** โ€” Reverb, delay, distortion, drive, chorus
152
+ - โœ… **Variables** โ€” `let`, `const`, `var` with scoping
153
+ - โœ… **Groups & Spawn** โ€” Organize and parallelize execution
154
+ - โœ… **Loops & Conditions** โ€” `for`, `if`, `else` control flow
155
+ - โœ… **Triggers** โ€” Conditional audio triggering
156
+ - โœ… **Events** โ€” Event system with `on` and `emit`
157
+
158
+ ### ๐Ÿ› ๏ธ **CLI Tools**
159
+ - โœ… `devalang init` โ€” Scaffold new projects (3 templates)
160
+ - โœ… `devalang build` โ€” Compile to WAV/MIDI
161
+ - โœ… `devalang check` โ€” Validate syntax
162
+ - โœ… `devalang play` โ€” Audio playback
163
+ - โœ… `devalang addon` โ€” Manage addons (install, list, discover)
164
+ - โœ… `devalang login/logout` โ€” Authentication
165
+ - โœ… `devalang telemetry` โ€” Privacy controls
166
+
167
+ ### ๐ŸŒ **WASM API**
168
+ - โœ… `render_audio()` โ€” Browser audio rendering
169
+ - โœ… `render_midi_array()` โ€” MIDI export
170
+ - โœ… `debug_render()` โ€” Debug information
171
+ - โœ… `parse()` โ€” Parse Devalang code
172
+ - โœ… TypeScript types included
173
+
174
+ ### ๐Ÿ“ฆ **Output Formats**
175
+ - โœ… **WAV** โ€” 16/24/32-bit audio export
176
+ - โœ… **MIDI** โ€” Standard MIDI file export
177
+ - โœ… **MP3/FLAC** โ€” Planned
178
+
179
+ ### ๐ŸŽฏ **Performance**
180
+ - โšก **Fast builds** โ€” 7-10ms for typical projects
181
+ - โšก **Low latency** โ€” Optimized audio engine
182
+ - โšก **Release builds** โ€” 5-6x faster than debug
183
+
184
+ ### ๐Ÿ“š **Learning Resources**
185
+ - โœ… **Online Docs** โ€” Complete language reference
186
+ - โœ… **VSCode Extension** โ€” Syntax highlighting
187
+
188
+ ---
189
+
190
+ ## ๐Ÿ’ก Why Devalang?
191
+
192
+ - ๐ŸŽน **Prototype audio ideas** without opening a DAW
193
+ - ๐Ÿ’ป **Integrate sound** into code-based workflows
194
+ - ๐ŸŽ›๏ธ **Control audio parameters** with readable syntax
195
+ - ๐Ÿงช **Build musical logic** with variables and conditions
196
+ - ๐Ÿ”„ **Create patterns** with expressive notation
197
+ - ๐ŸŽจ **Live code** with fast iteration cycles
198
+ - ๐Ÿ“ฆ **Version control** your music with git
199
+
200
+ ---
201
+
202
+ ## ๐Ÿ“– Documentation
203
+
204
+ **[Visit docs.devalang.com](https://docs.devalang.com)** for:
205
+ - Complete syntax reference
206
+ - API documentation
207
+ - WASM integration guide
208
+ - CLI command reference
209
+ - Advanced tutorials
210
+ - Best practices
211
+
212
+ ---
213
+
214
+ ## ๐Ÿ”ง Development
215
+
216
+ ### Build from Source
217
+
218
+ ```bash
219
+ # Clone the repository
220
+ git clone https://github.com/devaloop-labs/devalang.git
221
+ cd devalang
222
+
223
+ # Build CLI (Rust)
224
+ cargo build --release --features cli
225
+
226
+ # Build WASM
227
+ cargo build --release --features wasm --lib
228
+
229
+ # Build TypeScript
230
+ npm install
231
+ npm run ts:build
232
+
233
+ # Run tests
234
+ cargo test --features cli
235
+ npm test
236
+ ```
237
+
238
+ ## ๐Ÿค Contributing
239
+
240
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
241
+
242
+ ### Ways to Contribute
243
+
244
+ - ๐Ÿ› **Report bugs** via [GitHub Issues](https://github.com/devaloop-labs/devalang/issues)
245
+ - ๐Ÿ’ก **Suggest features** in discussions
246
+ - ๐Ÿ“ **Improve docs** with pull requests
247
+ - ๐ŸŽต **Share examples** of your creations
248
+ - ๐Ÿงช **Write tests** for new features
249
+
250
+ ---
251
+
252
+ ## ๐Ÿ“œ License
253
+
254
+ MIT License โ€” See [LICENSE](./LICENSE) for details.
255
+
256
+ Copyright (c) 2025 Devaloop
257
+
258
+ ---
259
+
260
+ <div align="center">
261
+ <strong>Made with โค๏ธ by the Devaloop team</strong>
262
+ <br />
263
+ <sub>Star โญ the repo if you like it!</sub>
264
+ </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.3",
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",