@devaloop/devalang 0.0.1-alpha.13 → 0.0.1-alpha.15
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/.devalang +2 -3
- package/Cargo.toml +58 -54
- package/README.md +59 -27
- package/docs/CHANGELOG.md +99 -2
- package/docs/CONTRIBUTING.md +1 -0
- package/docs/ROADMAP.md +3 -3
- package/docs/TODO.md +5 -4
- package/examples/automation.deva +44 -0
- package/examples/bank.deva +2 -4
- package/examples/function.deva +15 -0
- package/examples/index.deva +41 -11
- package/examples/plugin.deva +15 -0
- package/out-tsc/bin/devalang.exe +0 -0
- package/package.json +6 -6
- package/project-version.json +3 -3
- package/rust/cli/bank.rs +16 -16
- package/rust/cli/build.rs +69 -30
- package/rust/cli/check.rs +46 -6
- package/rust/cli/driver.rs +40 -28
- package/rust/cli/install.rs +22 -7
- package/rust/cli/login.rs +134 -0
- package/rust/cli/mod.rs +2 -1
- package/rust/cli/play.rs +44 -19
- package/rust/cli/update.rs +1 -1
- package/rust/common/api.rs +5 -0
- package/rust/common/cdn.rs +3 -9
- package/rust/common/mod.rs +3 -1
- package/rust/common/sso.rs +5 -0
- package/rust/config/driver.rs +19 -1
- package/rust/config/loader.rs +56 -10
- package/rust/core/audio/engine.rs +314 -63
- package/rust/core/audio/evaluator.rs +101 -0
- package/rust/core/audio/interpreter/arrow_call.rs +60 -15
- package/rust/core/audio/interpreter/automate.rs +18 -0
- package/rust/core/audio/interpreter/call.rs +4 -4
- package/rust/core/audio/interpreter/condition.rs +3 -3
- package/rust/core/audio/interpreter/driver.rs +68 -30
- package/rust/core/audio/interpreter/let_.rs +14 -7
- package/rust/core/audio/interpreter/loop_.rs +39 -6
- package/rust/core/audio/interpreter/mod.rs +2 -1
- package/rust/core/audio/interpreter/sleep.rs +2 -4
- package/rust/core/audio/interpreter/spawn.rs +4 -4
- package/rust/core/audio/loader/trigger.rs +2 -5
- package/rust/core/audio/mod.rs +2 -1
- package/rust/core/audio/renderer.rs +1 -1
- package/rust/core/audio/special/easing.rs +120 -0
- package/rust/core/audio/special/env.rs +41 -0
- package/rust/core/audio/special/math.rs +92 -0
- package/rust/core/audio/special/mod.rs +9 -0
- package/rust/core/audio/special/modulator.rs +120 -0
- package/rust/core/builder/mod.rs +11 -6
- package/rust/core/debugger/store.rs +1 -1
- package/rust/core/error/mod.rs +4 -1
- package/rust/core/lexer/handler/arrow.rs +60 -9
- package/rust/core/lexer/handler/at.rs +4 -4
- package/rust/core/lexer/handler/brace.rs +8 -8
- package/rust/core/lexer/handler/colon.rs +4 -4
- package/rust/core/lexer/handler/comment.rs +2 -2
- package/rust/core/lexer/handler/dot.rs +4 -4
- package/rust/core/lexer/handler/driver.rs +42 -13
- package/rust/core/lexer/handler/identifier.rs +5 -4
- package/rust/core/lexer/handler/indent.rs +16 -2
- package/rust/core/lexer/handler/newline.rs +1 -1
- package/rust/core/lexer/handler/number.rs +3 -3
- package/rust/core/lexer/handler/operator.rs +3 -1
- package/rust/core/lexer/handler/parenthesis.rs +8 -8
- package/rust/core/lexer/handler/slash.rs +5 -5
- package/rust/core/lexer/handler/string.rs +1 -1
- package/rust/core/lexer/mod.rs +1 -1
- package/rust/core/lexer/token.rs +4 -0
- package/rust/core/mod.rs +2 -1
- package/rust/core/parser/driver.rs +134 -11
- package/rust/core/parser/handler/arrow_call.rs +141 -65
- package/rust/core/parser/handler/at.rs +1 -1
- package/rust/core/parser/handler/bank.rs +35 -7
- package/rust/core/parser/handler/dot.rs +43 -22
- package/rust/core/parser/handler/identifier/automate.rs +194 -0
- package/rust/core/parser/handler/identifier/function.rs +2 -3
- package/rust/core/parser/handler/identifier/let_.rs +16 -0
- package/rust/core/parser/handler/identifier/mod.rs +14 -10
- package/rust/core/parser/handler/identifier/print.rs +29 -0
- package/rust/core/parser/handler/identifier/sleep.rs +1 -1
- package/rust/core/parser/handler/identifier/synth.rs +7 -9
- package/rust/core/parser/handler/loop_.rs +60 -43
- package/rust/core/parser/statement.rs +5 -0
- package/rust/core/plugin/loader.rs +48 -0
- package/rust/core/plugin/mod.rs +1 -0
- package/rust/core/preprocessor/loader.rs +7 -5
- package/rust/core/preprocessor/processor.rs +4 -4
- package/rust/core/preprocessor/resolver/bank.rs +1 -2
- package/rust/core/preprocessor/resolver/call.rs +19 -18
- package/rust/core/preprocessor/resolver/driver.rs +7 -5
- package/rust/core/preprocessor/resolver/function.rs +3 -13
- package/rust/core/preprocessor/resolver/loop_.rs +31 -1
- package/rust/core/preprocessor/resolver/spawn.rs +3 -22
- package/rust/core/preprocessor/resolver/tempo.rs +1 -1
- package/rust/core/preprocessor/resolver/trigger.rs +2 -3
- package/rust/core/preprocessor/resolver/value.rs +6 -12
- package/rust/core/shared/bank.rs +1 -1
- package/rust/core/utils/path.rs +1 -1
- package/rust/core/utils/validation.rs +0 -1
- package/rust/installer/addon.rs +80 -0
- package/rust/installer/bank.rs +25 -15
- package/rust/installer/mod.rs +4 -1
- package/rust/installer/plugin.rs +55 -0
- package/rust/main.rs +32 -10
- package/rust/utils/error.rs +51 -0
- package/rust/utils/logger.rs +20 -0
- package/rust/utils/mod.rs +1 -44
- package/rust/utils/spinner.rs +3 -5
package/.devalang
CHANGED
package/Cargo.toml
CHANGED
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "devalang"
|
|
3
|
-
version = "0.0.1-alpha.
|
|
4
|
-
authors = ["Devaloop <contact@devaloop.com>"]
|
|
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
|
-
license = "MIT"
|
|
7
|
-
repository = "https://github.com/devaloop-labs/devalang"
|
|
8
|
-
keywords = ["music", "dsl", "audio", "cli"]
|
|
9
|
-
categories = ["command-line-utilities", "development-tools", "parser-implementations"]
|
|
10
|
-
readme = "README.md"
|
|
11
|
-
homepage = "https://devalang.com"
|
|
12
|
-
documentation = "https://docs.devalang.com/"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
path = "rust/lib.rs"
|
|
23
|
-
crate-type = ["cdylib", "rlib"]
|
|
24
|
-
|
|
25
|
-
[profile.release]
|
|
26
|
-
opt-level = "s"
|
|
27
|
-
|
|
28
|
-
[features]
|
|
29
|
-
default = ["cli"]
|
|
30
|
-
cli = ["crossterm", "indicatif", "inquire", "zip", "reqwest", "flate2", "tokio"]
|
|
31
|
-
|
|
32
|
-
[dependencies]
|
|
33
|
-
clap = { version = "4.5", features = ["derive"] }
|
|
34
|
-
serde = { version = "1.0", features = ["derive"] }
|
|
35
|
-
serde_json = "1.0"
|
|
36
|
-
rodio = "0.17"
|
|
37
|
-
hound = "3.4.0"
|
|
38
|
-
toml = "0.8"
|
|
39
|
-
notify = "6.1"
|
|
40
|
-
fs_extra = "1.3"
|
|
41
|
-
include_dir = "0.7"
|
|
42
|
-
wasm-bindgen = "0.2"
|
|
43
|
-
serde-wasm-bindgen = "0.4"
|
|
44
|
-
nom_locate = "4.0.0"
|
|
45
|
-
chrono = "0.4"
|
|
46
|
-
crossterm = { version = "0.27", optional = true }
|
|
47
|
-
indicatif = { version = "0.17", optional = true }
|
|
48
|
-
inquire = { version = "0.7.5", optional = true }
|
|
49
|
-
js-sys = "0.3"
|
|
50
|
-
reqwest = { version = "0.12.22", optional = true, features = ["json"] }
|
|
51
|
-
flate2 = { version = "1.0", optional = true }
|
|
52
|
-
tokio = { version = "1", features = ["full"], optional = true }
|
|
53
|
-
zip = { version = "4.3.0", optional = true }
|
|
54
|
-
rayon = "1.10.0"
|
|
1
|
+
[package]
|
|
2
|
+
name = "devalang"
|
|
3
|
+
version = "0.0.1-alpha.15"
|
|
4
|
+
authors = ["Devaloop <contact@devaloop.com>"]
|
|
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
|
+
license = "MIT"
|
|
7
|
+
repository = "https://github.com/devaloop-labs/devalang"
|
|
8
|
+
keywords = ["music", "dsl", "audio", "cli"]
|
|
9
|
+
categories = ["command-line-utilities", "development-tools", "parser-implementations"]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
homepage = "https://devalang.com"
|
|
12
|
+
documentation = "https://docs.devalang.com/"
|
|
13
|
+
edition = "2024"
|
|
14
|
+
|
|
15
|
+
[[bin]]
|
|
16
|
+
name = "devalang"
|
|
17
|
+
path = "rust/main.rs"
|
|
18
|
+
required-features = ["cli"]
|
|
19
|
+
|
|
20
|
+
[lib]
|
|
21
|
+
name = "devalang_core"
|
|
22
|
+
path = "rust/lib.rs"
|
|
23
|
+
crate-type = ["cdylib", "rlib"]
|
|
24
|
+
|
|
25
|
+
[profile.release]
|
|
26
|
+
opt-level = "s"
|
|
27
|
+
|
|
28
|
+
[features]
|
|
29
|
+
default = ["cli"]
|
|
30
|
+
cli = ["crossterm", "indicatif", "inquire", "zip", "reqwest", "flate2", "tokio"]
|
|
31
|
+
|
|
32
|
+
[dependencies]
|
|
33
|
+
clap = { version = "4.5", features = ["derive"] }
|
|
34
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
35
|
+
serde_json = "1.0"
|
|
36
|
+
rodio = "0.17"
|
|
37
|
+
hound = "3.4.0"
|
|
38
|
+
toml = "0.8"
|
|
39
|
+
notify = "6.1"
|
|
40
|
+
fs_extra = "1.3"
|
|
41
|
+
include_dir = "0.7"
|
|
42
|
+
wasm-bindgen = "0.2"
|
|
43
|
+
serde-wasm-bindgen = "0.4"
|
|
44
|
+
nom_locate = "4.0.0"
|
|
45
|
+
chrono = "0.4"
|
|
46
|
+
crossterm = { version = "0.27", optional = true }
|
|
47
|
+
indicatif = { version = "0.17", optional = true }
|
|
48
|
+
inquire = { version = "0.7.5", optional = true }
|
|
49
|
+
js-sys = "0.3"
|
|
50
|
+
reqwest = { version = "0.12.22", optional = true, features = ["json"] }
|
|
51
|
+
flate2 = { version = "1.0", optional = true }
|
|
52
|
+
tokio = { version = "1", features = ["full"], optional = true }
|
|
53
|
+
zip = { version = "4.3.0", optional = true }
|
|
54
|
+
rayon = "1.10.0"
|
|
55
|
+
webbrowser = "0.8"
|
|
56
|
+
tiny_http = "0.9.0"
|
|
57
|
+
dirs = "5"
|
|
58
|
+
urlencoding = "2.1"
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://devalang.com/images/devalang-logo
|
|
2
|
+
<img src="https://devalang.com/images/devalang-logo.svg" alt="Devalang Logo" width="300" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|

|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|

|
|
10
|
-

|
|
11
11
|

|
|
12
12
|

|
|
13
13
|
|
|
@@ -16,26 +16,20 @@
|
|
|
16
16
|
|
|
17
17
|
[](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
Compose music with code — structured, expressive, and fast.
|
|
19
|
+
# 🦊 Devalang (CORE) — Compose music with code
|
|
22
20
|
|
|
23
21
|
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers.
|
|
24
22
|
Compose loops, control samples, render and play audio — all in clean, readable text.
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
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.
|
|
27
25
|
|
|
28
26
|
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
29
27
|
|
|
30
|
-
> 🚧
|
|
31
|
-
>
|
|
32
|
-
> NEW: Devalang is available in your browser at [playground.devalang.com](https://playground.devalang.com) !
|
|
33
|
-
>
|
|
34
|
-
> NEW: Online documentation is now available at [docs.devalang.com](https://docs.devalang.com)
|
|
28
|
+
> 🚧 Alpha Notice 🚧
|
|
35
29
|
>
|
|
36
30
|
> Includes synthesis, playback, and rendering features, but is still in early development.
|
|
37
31
|
>
|
|
38
|
-
> Currently, Devalang CLI is only available for **Windows**.
|
|
32
|
+
> Currently, Devalang CLI is only available for **Windows**.
|
|
39
33
|
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
40
34
|
|
|
41
35
|
## 📚 Quick Access
|
|
@@ -51,7 +45,11 @@ From studio sketches to live sets, Devalang gives you rhythmic control — with
|
|
|
51
45
|
|
|
52
46
|
## ⏱️ Try it now !
|
|
53
47
|
|
|
54
|
-
###
|
|
48
|
+
### Try Devalang in your browser
|
|
49
|
+
|
|
50
|
+
> Have a look at the [Playground](https://playground.devalang.com) to try Devalang directly in your browser
|
|
51
|
+
|
|
52
|
+
### Try Devalang CLI
|
|
55
53
|
|
|
56
54
|
```bash
|
|
57
55
|
# Install Devalang CLI globally
|
|
@@ -67,18 +65,48 @@ Create a new Devalang file `src/index.deva` in the project directory:
|
|
|
67
65
|
```deva
|
|
68
66
|
# src/index.deva
|
|
69
67
|
|
|
70
|
-
group
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
group main:
|
|
69
|
+
let lead = synth sine {
|
|
70
|
+
attack: 0,
|
|
71
|
+
decay: 100,
|
|
72
|
+
sustain: 100,
|
|
73
|
+
release: 100
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Global automation for this synth (applies to subsequent notes)
|
|
77
|
+
automate lead:
|
|
78
|
+
param volume {
|
|
79
|
+
0% = 0.0
|
|
80
|
+
100% = 1.0
|
|
81
|
+
}
|
|
82
|
+
param pan {
|
|
83
|
+
0% = -1.0
|
|
84
|
+
100% = 1.0
|
|
85
|
+
}
|
|
86
|
+
param pitch {
|
|
87
|
+
0% = -12.0
|
|
88
|
+
100% = 12.0
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
lead -> note(C4, {
|
|
92
|
+
duration: 400,
|
|
93
|
+
velocity: 0.8,
|
|
94
|
+
automate: { pan: { 0%: -1.0, 100%: 0.0 } }
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
lead -> note(E4, { duration: 400 })
|
|
98
|
+
lead -> note(G4, { duration: 600, glide: true, target_freq: 659.25 })
|
|
99
|
+
lead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
|
|
100
|
+
|
|
101
|
+
for i in [1, 2, 3]:
|
|
102
|
+
lead -> note(C5, { duration: 200 })
|
|
75
103
|
|
|
76
104
|
# Play the lead
|
|
77
105
|
|
|
78
|
-
call
|
|
106
|
+
call main
|
|
79
107
|
```
|
|
80
108
|
|
|
81
|
-
And the best part ? You can play it directly from the command line:
|
|
109
|
+
### And the best part ? You can play it directly from the command line:
|
|
82
110
|
|
|
83
111
|
```bash
|
|
84
112
|
# Play the Devalang file
|
|
@@ -91,23 +119,23 @@ devalang play --watch
|
|
|
91
119
|
devalang play --repeat
|
|
92
120
|
```
|
|
93
121
|
|
|
94
|
-
### 🎉 You can now hear your Devalang code in action
|
|
122
|
+
### 🎉 You can now hear your Devalang code in action
|
|
95
123
|
|
|
96
|
-
> For more examples, check out the [examples directory](./examples/)
|
|
124
|
+
> For more examples, check out the [examples directory](./examples/)
|
|
97
125
|
|
|
98
|
-
## ❓ Why Devalang?
|
|
126
|
+
## ❓ Why Devalang ?
|
|
99
127
|
|
|
100
|
-
- 🎹 Prototype audio ideas without opening a DAW
|
|
128
|
+
- 🎹 Prototype audio ideas without opening a DAW, even VSCode
|
|
101
129
|
- 💻 Integrate sound into code-based workflows
|
|
102
130
|
- 🎛️ Control audio parameters through readable syntax
|
|
103
131
|
- 🧪 Build musical logic with variables and conditions
|
|
104
|
-
|
|
105
|
-
> Producer, coder, or both — Devalang gives you musical structure, instantly.
|
|
132
|
+
- 🔄 Create complex patterns with ease
|
|
106
133
|
|
|
107
134
|
## 🚀 Features
|
|
108
135
|
|
|
109
136
|
- 🎵 **Audio Engine**: Integrated audio playback and rendering
|
|
110
137
|
- 🧩 **Module system** for importing and exporting variables between files
|
|
138
|
+
- 📦 **Addon manager** for managing external banks, plugins and more
|
|
111
139
|
- 📜 **Structured AST** generation for debugging and future compilation
|
|
112
140
|
- 🔢 **Basic data types**: strings, numbers, booleans, maps, arrays
|
|
113
141
|
- 👁️ **Watch mode** for `build`, `check` and `play` commands
|
|
@@ -117,7 +145,7 @@ devalang play --repeat
|
|
|
117
145
|
|
|
118
146
|
## 📄 Documentation
|
|
119
147
|
|
|
120
|
-
### Please refer to the [online documentation](https://docs.devalang.com) for detailed information on syntax, features, and usage examples
|
|
148
|
+
### Please refer to the [online documentation](https://docs.devalang.com) for detailed information on syntax, features, and usage examples
|
|
121
149
|
|
|
122
150
|
## 🧯 Known issues
|
|
123
151
|
|
|
@@ -141,6 +169,10 @@ MIT — see [LICENSE](./LICENSE)
|
|
|
141
169
|
Contributions, bug reports and suggestions are welcome !
|
|
142
170
|
Feel free to open an issue or submit a pull request.
|
|
143
171
|
|
|
172
|
+
For more info, see [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md).
|
|
173
|
+
|
|
144
174
|
## 📢 Contact
|
|
145
175
|
|
|
176
|
+
Feel free to reach out for any inquiries or feedback.
|
|
177
|
+
|
|
146
178
|
📧 [contact@devaloop.com](mailto:contact@devaloop.com)
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,113 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://devalang.com/images/devalang-logo
|
|
2
|
+
<img src="https://devalang.com/images/devalang-logo.svg" alt="Devalang Logo" width="300" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
7
|
+
## Version 0.0.1-alpha.15 (2025-08-27)
|
|
8
|
+
|
|
9
|
+
### ✨ Language Features
|
|
10
|
+
|
|
11
|
+
- Added `automate` statement to schedule parameter automation (e.g. volume, pan, pitch) over time
|
|
12
|
+
- Supports per-note automation via a `automate` map on note calls (e.g. `note(C4, { automate: { volume: { 0%: 0.0, 100%: 1.0 } } })`)
|
|
13
|
+
- Added `print` statement to ease debugging at runtime
|
|
14
|
+
- Added special variables and functions usable in expressions:
|
|
15
|
+
- `$env.bpm`, `$env.beat`
|
|
16
|
+
- `$math.sin(expr)`, `$math.cos(expr)`
|
|
17
|
+
- `$env.position` (alias of beat), `$env.seed` (global session seed for deterministic randomness)
|
|
18
|
+
- `$math.random(seed?)`, `$math.lerp(a, b, t)`
|
|
19
|
+
- `$easing.*` functions for shaping values in [0,1]:
|
|
20
|
+
- `linear`, `easeIn/Out/InOutQuad`, `easeIn/Out/InOutCubic`, `easeIn/Out/InOutQuart`,
|
|
21
|
+
`easeIn/Out/InOutExpo`, `easeIn/Out/InOutBack`, `easeIn/Out/InOutElastic`, `easeIn/Out/InOutBounce`
|
|
22
|
+
- `$mod.*` modulators for time-based control:
|
|
23
|
+
- `lfo.sine(ratePerBeat)`, `lfo.tri(ratePerBeat)`, `envelope(attack, decay, sustain, release, t)`
|
|
24
|
+
- Added basic `for` loops and array literals
|
|
25
|
+
- Example: `for i in [1, 2, 3]: print i`
|
|
26
|
+
|
|
27
|
+
### 🧠 Core Engine
|
|
28
|
+
|
|
29
|
+
- Implemented runtime automation in the audio renderer with linear envelope interpolation
|
|
30
|
+
- Per-note automation supported (volume, pan, pitch) and evaluated during rendering
|
|
31
|
+
- Fixed evaluator recursion guard and improved `$math.*` expression handling (prevents stack overflows)
|
|
32
|
+
- Minor ADSR defaults polish: ensure `sustain` defaults to `1.0`
|
|
33
|
+
- Evaluator now supports `$mod.*` and `$easing.*` calls (evaluated before `$math.*`) for richer automation
|
|
34
|
+
- Modularized `AudioEngine::insert_note` into small helpers (oscillator, ADSR computation, pan gains, envelope evaluation, stereo mix)
|
|
35
|
+
- Reused helpers in `pad_samples` to reduce duplication
|
|
36
|
+
- Moved special variables/functions to a dedicated module: `core::audio::special`, and refactored the evaluator to use it
|
|
37
|
+
- Continued borrow-friendly refactors to avoid unnecessary clones and improve readability
|
|
38
|
+
|
|
39
|
+
### 🧩 Parser / Preprocessor
|
|
40
|
+
|
|
41
|
+
- Parser upgrades for operators `+ - * /`, parentheses and brackets
|
|
42
|
+
- Improved arrow-call parsing and map handling for multi-line values
|
|
43
|
+
- Resolvers: refined `call`/`spawn` resolution (better error messages with stack traces)
|
|
44
|
+
|
|
45
|
+
### 🧱 Architecture / Refactor
|
|
46
|
+
|
|
47
|
+
- Modularized audio interpreter (split by statement type); clearer responsibilities
|
|
48
|
+
- Reduced allocations by passing slices/borrows instead of cloning large structures
|
|
49
|
+
- Removed dead code and unused params across resolvers, handlers, and interpreter modules
|
|
50
|
+
|
|
51
|
+
### 🧰 Tooling / Build
|
|
52
|
+
|
|
53
|
+
- Resolved binary/lib artifact collision by renaming the internal library crate to `devalang_core`
|
|
54
|
+
- Warning sweep: build now compiles cleanly without Rust warnings (and fewer Clippy lints)
|
|
55
|
+
- Moved error collection helpers into a dedicated `utils::error` module
|
|
56
|
+
|
|
57
|
+
### 🐛 Fixes & Stability
|
|
58
|
+
|
|
59
|
+
- Prevent infinite recursion during numeric expression evaluation
|
|
60
|
+
- Stabilized renderer and interpreter timing when combining `loop`, `call`, and `spawn`
|
|
61
|
+
|
|
62
|
+
### ⚠️ Breaking changes
|
|
63
|
+
|
|
64
|
+
- Internal crate rename to `devalang_core` (no change to the CLI or WASM package names)
|
|
65
|
+
|
|
66
|
+
## Version 0.0.1-alpha.14 (2025-08-24)
|
|
67
|
+
|
|
68
|
+
### 🌎 Ecosystem
|
|
69
|
+
|
|
70
|
+
- Deployed "SSO" (Single Sign-On) for user authentication. [(https://sso.devalang.com)](https://sso.devalang.com) when using `devalang login`.
|
|
71
|
+
|
|
72
|
+
### 🧩 Language Features
|
|
73
|
+
|
|
74
|
+
- Added support for ADSR envelopes in synthesizers.
|
|
75
|
+
- Example: `let mySynth = synth sine { attack: 0, decay: 50, sustain: 100, release: 50 }`
|
|
76
|
+
- Added support for `note` parameters in synthesizers.
|
|
77
|
+
- Example: `mySynth -> note(C4, { duration: 500, velocity: 0.8, glide: true, slide: false })`
|
|
78
|
+
|
|
79
|
+
### 🧠 Core Engine
|
|
80
|
+
|
|
81
|
+
- Patched banks resolution with improved namespace handling. (declaring `bank <bank_author>.<bank_name>` and using `.<bank_name>.<bank_trigger>`)
|
|
82
|
+
- Patched `arrow_call` to correctly handle argument parsing and improve error reporting.
|
|
83
|
+
- Implemented multi-line argument parsing for `arrow_call`.
|
|
84
|
+
- Patched execution of `arrow_call` to ensure correct timing and execution order.
|
|
85
|
+
- Upgraded indent lexer to handle multi-line statements and improve indentation handling.
|
|
86
|
+
- Upgraded `parse_map_value` to handle multi-line values and improve parsing logic in Parser.
|
|
87
|
+
- Added `log_message_with_trace` function to log messages with informations when running commands with `debug` flag.
|
|
88
|
+
|
|
89
|
+
### 🧰 Commands
|
|
90
|
+
|
|
91
|
+
- Added `login` command to authenticate users to install protected or private packages.
|
|
92
|
+
- Refactored `install` command to support installing banks, presets and plugins.
|
|
93
|
+
- `install bank <bank_author>.<bank_name>` to install a specific bank of sounds.
|
|
94
|
+
- `install preset <preset_author>.<preset_name>` to install a specific preset.
|
|
95
|
+
- `install plugin <plugin_author>.<plugin_name>` to install a specific plugin.
|
|
96
|
+
- Implemented `debug` and `compress` arguments for `build`, `check` and `play` commands.
|
|
97
|
+
- `build --debug` to build the AST with debug information.
|
|
98
|
+
- `check --debug` to check the syntax with debug information.
|
|
99
|
+
- `play --debug` to play the audio with debug information.
|
|
100
|
+
- `build --compress` to compress the output.
|
|
101
|
+
- `check --compress` to compress the output.
|
|
102
|
+
- `play --compress` to compress the output.
|
|
103
|
+
|
|
7
104
|
## Version 0.0.1-alpha.13 (2025-07-26)
|
|
8
105
|
|
|
9
106
|
### 🧩 Language Features
|
|
10
107
|
|
|
11
108
|
- Added support for `fn` directive to define functions in Devalang.
|
|
12
109
|
- Example: `fn myFunction(param1, param2):`
|
|
13
|
-
|
|
110
|
+
|
|
14
111
|
### 🧠 Core Engine
|
|
15
112
|
|
|
16
113
|
- Patched `trigger`, `call`, and `spawn`, `renderer` to handle correct cursor time in the audio interpreter.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file is a placeholder
|
package/docs/ROADMAP.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
|
|
2
|
+
<img src="https://devalang.com/images/devalang-logo.svg" alt="Devalang Logo" width="300" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
# Roadmap
|
|
@@ -8,7 +8,7 @@ Devalang is a work in progress. Here’s what we’re planning next:
|
|
|
8
8
|
|
|
9
9
|
## Completed
|
|
10
10
|
|
|
11
|
-
- ✅ **Audio engine**: Integrate the audio engine for sound playback.
|
|
11
|
+
- ✅ **Audio engine**: Integrate the audio engine for sound playback.
|
|
12
12
|
- ✅ **Basic syntax**: Implement the core syntax for Devalang, including data types and basic statements.
|
|
13
13
|
- ✅ **Watch mode**: Add a watch mode to automatically rebuild on file changes.
|
|
14
14
|
- ✅ **Module system**: Add support for importing and exporting variables between files using `@import` and `@export`.
|
|
@@ -27,4 +27,4 @@ Devalang is a work in progress. Here’s what we’re planning next:
|
|
|
27
27
|
|
|
28
28
|
- ⏳ **Smart modules**: Let Devalang detect and use groups, samples, and variables without needing to import them manually.
|
|
29
29
|
- ⏳ **Other statements**: Implement `pattern`, `function`, and other control structures.
|
|
30
|
-
- ⏳ **Testing**: Expand test coverage for all features.
|
|
30
|
+
- ⏳ **Testing**: Expand test coverage for all features.
|
package/docs/TODO.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://devalang.com/images/devalang-logo
|
|
2
|
+
<img src="https://devalang.com/images/devalang-logo.svg" alt="Devalang Logo" width="300" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
# TODOs list
|
|
@@ -17,15 +17,16 @@ This is a list of tasks and features to be implemented in Devalang. Note that th
|
|
|
17
17
|
- [x] Implement template info
|
|
18
18
|
- [x] Checking
|
|
19
19
|
- [x] Implement watch mode
|
|
20
|
-
- [
|
|
20
|
+
- [x] Implement debug mode
|
|
21
21
|
- [ ] Implement compilation mode
|
|
22
22
|
- [x] Building
|
|
23
23
|
- [x] Implement watch mode
|
|
24
|
-
- [
|
|
24
|
+
- [x] Implement debug mode
|
|
25
25
|
- [ ] Implement compilation mode
|
|
26
|
-
- [
|
|
26
|
+
- [x] Implement compression mode
|
|
27
27
|
- [x] Play
|
|
28
28
|
- [x] Implement Audio Engine
|
|
29
|
+
- [x] Implement debug mode
|
|
29
30
|
- [x] Implement loop mode
|
|
30
31
|
|
|
31
32
|
## Core components
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
bpm 120
|
|
2
|
+
|
|
3
|
+
group myLead:
|
|
4
|
+
let mySynth = synth sine
|
|
5
|
+
|
|
6
|
+
# This will automate all notes inside mySynth
|
|
7
|
+
# automate mySynth:
|
|
8
|
+
# param volume {
|
|
9
|
+
# 0% = 0.0
|
|
10
|
+
# 100% = 1.0
|
|
11
|
+
# }
|
|
12
|
+
# param pan {
|
|
13
|
+
# 0% = -1.0
|
|
14
|
+
# 100% = 1.0
|
|
15
|
+
# }
|
|
16
|
+
# param pitch {
|
|
17
|
+
# 0% = -12.0
|
|
18
|
+
# 100% = 12.0
|
|
19
|
+
# }
|
|
20
|
+
|
|
21
|
+
# This will automate only C4
|
|
22
|
+
mySynth -> note(C4, {
|
|
23
|
+
duration: 400,
|
|
24
|
+
automate: {
|
|
25
|
+
pitch: {
|
|
26
|
+
0%: -12.0
|
|
27
|
+
100%: 12.0
|
|
28
|
+
},
|
|
29
|
+
pan: {
|
|
30
|
+
0%: -1.0,
|
|
31
|
+
100%: 1.0
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
mySynth -> note(G4, { duration: 400 })
|
|
36
|
+
mySynth -> note(E4, { duration: 600 })
|
|
37
|
+
mySynth -> note(A4, { duration: 400 })
|
|
38
|
+
mySynth -> note(F4, { duration: 800 })
|
|
39
|
+
mySynth -> note(D4, { duration: 400 })
|
|
40
|
+
mySynth -> note(B3, { duration: 600 })
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
call myLead
|
package/examples/bank.deva
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file demonstrates the use of main features in Devalang.
|
|
2
|
+
bpm 135
|
|
3
|
+
|
|
4
|
+
bank 808
|
|
5
|
+
|
|
6
|
+
let entityTest1 = .808.kick auto
|
|
7
|
+
let entityTest2 = .808.clap auto
|
|
8
|
+
let entityTest3 = .808.snare auto
|
|
9
|
+
|
|
10
|
+
fn myFirstGroup(entity1, entity2, entity3):
|
|
11
|
+
.entity1
|
|
12
|
+
.entity2
|
|
13
|
+
.entity3
|
|
14
|
+
|
|
15
|
+
call myFirstGroup(entityTest1, entityTest2, entityTest3)
|
package/examples/index.deva
CHANGED
|
@@ -1,15 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
bpm 135
|
|
1
|
+
bpm 120
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
group main:
|
|
4
|
+
let lead = synth sine {
|
|
5
|
+
attack: 0,
|
|
6
|
+
decay: 100,
|
|
7
|
+
sustain: 100,
|
|
8
|
+
release: 100
|
|
9
|
+
}
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
# Global automation for this synth (applies to subsequent notes)
|
|
12
|
+
automate lead:
|
|
13
|
+
param volume {
|
|
14
|
+
0% = 0.0
|
|
15
|
+
100% = 1.0
|
|
16
|
+
}
|
|
17
|
+
param pan {
|
|
18
|
+
0% = -1.0
|
|
19
|
+
100% = 1.0
|
|
20
|
+
}
|
|
21
|
+
param pitch {
|
|
22
|
+
0% = -12.0
|
|
23
|
+
100% = 12.0
|
|
24
|
+
}
|
|
9
25
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
26
|
+
# Notes (per-note automation can override globals)
|
|
27
|
+
lead -> note(C4, {
|
|
28
|
+
duration: 400,
|
|
29
|
+
velocity: 0.8,
|
|
30
|
+
automate: {
|
|
31
|
+
pan: {
|
|
32
|
+
0%: -1.0
|
|
33
|
+
100%: 0.0
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
lead -> note(E4, { duration: 400 })
|
|
38
|
+
lead -> note(G4, { duration: 600, glide: true, target_freq: 659.25 })
|
|
39
|
+
lead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
|
|
14
40
|
|
|
15
|
-
|
|
41
|
+
# Simple looped fill
|
|
42
|
+
for i in [1, 2, 3]:
|
|
43
|
+
lead -> note(C5, { duration: 200 })
|
|
44
|
+
|
|
45
|
+
call main
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# NOTE: Available in next release
|
|
2
|
+
|
|
3
|
+
# @use devaloop.acid as acidPlugin
|
|
4
|
+
|
|
5
|
+
# let acidSynth = synth acidPlugin.synth {
|
|
6
|
+
# waveform: "saw",
|
|
7
|
+
# accent: 0.1,
|
|
8
|
+
# decay: 250
|
|
9
|
+
# }
|
|
10
|
+
|
|
11
|
+
# group mySynthGroup:
|
|
12
|
+
# acidSynth -> note(C4, { duration: 600 })
|
|
13
|
+
# acidSynth -> note(E4, { duration: 600 })
|
|
14
|
+
|
|
15
|
+
# call mySynthGroup
|
package/out-tsc/bin/devalang.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devaloop/devalang",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.15",
|
|
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
|
"bin": {
|
|
8
8
|
"devalang": "./out-tsc/bin/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"rust:dev:
|
|
13
|
-
"rust:dev:
|
|
14
|
-
"rust:dev:play": "cargo run play --entry examples --output output --repeat",
|
|
11
|
+
"rust:dev:build": "cargo run build --entry examples --output output --debug",
|
|
12
|
+
"rust:dev:check": "cargo run check --entry examples --output output --debug",
|
|
13
|
+
"rust:dev:play": "cargo run play --entry examples --output output --repeat --debug",
|
|
15
14
|
"rust:wasm:web": "wasm-pack build --target=web --no-default-features",
|
|
16
15
|
"rust:wasm:node": "wasm-pack build --target=nodejs --no-default-features",
|
|
17
16
|
"script:postbuild": "tsc && node out-tsc/scripts/postbuild.js",
|
|
18
|
-
"script:version:bump": "tsc && node out-tsc/scripts/version/index.js"
|
|
17
|
+
"script:version:bump": "tsc && node out-tsc/scripts/version/index.js",
|
|
18
|
+
"prepublish": "cargo build --release && npm run script:postbuild"
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://devalang.com",
|
|
21
21
|
"keywords": [
|
package/project-version.json
CHANGED