@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.
Files changed (110) hide show
  1. package/.devalang +2 -3
  2. package/Cargo.toml +58 -54
  3. package/README.md +59 -27
  4. package/docs/CHANGELOG.md +99 -2
  5. package/docs/CONTRIBUTING.md +1 -0
  6. package/docs/ROADMAP.md +3 -3
  7. package/docs/TODO.md +5 -4
  8. package/examples/automation.deva +44 -0
  9. package/examples/bank.deva +2 -4
  10. package/examples/function.deva +15 -0
  11. package/examples/index.deva +41 -11
  12. package/examples/plugin.deva +15 -0
  13. package/out-tsc/bin/devalang.exe +0 -0
  14. package/package.json +6 -6
  15. package/project-version.json +3 -3
  16. package/rust/cli/bank.rs +16 -16
  17. package/rust/cli/build.rs +69 -30
  18. package/rust/cli/check.rs +46 -6
  19. package/rust/cli/driver.rs +40 -28
  20. package/rust/cli/install.rs +22 -7
  21. package/rust/cli/login.rs +134 -0
  22. package/rust/cli/mod.rs +2 -1
  23. package/rust/cli/play.rs +44 -19
  24. package/rust/cli/update.rs +1 -1
  25. package/rust/common/api.rs +5 -0
  26. package/rust/common/cdn.rs +3 -9
  27. package/rust/common/mod.rs +3 -1
  28. package/rust/common/sso.rs +5 -0
  29. package/rust/config/driver.rs +19 -1
  30. package/rust/config/loader.rs +56 -10
  31. package/rust/core/audio/engine.rs +314 -63
  32. package/rust/core/audio/evaluator.rs +101 -0
  33. package/rust/core/audio/interpreter/arrow_call.rs +60 -15
  34. package/rust/core/audio/interpreter/automate.rs +18 -0
  35. package/rust/core/audio/interpreter/call.rs +4 -4
  36. package/rust/core/audio/interpreter/condition.rs +3 -3
  37. package/rust/core/audio/interpreter/driver.rs +68 -30
  38. package/rust/core/audio/interpreter/let_.rs +14 -7
  39. package/rust/core/audio/interpreter/loop_.rs +39 -6
  40. package/rust/core/audio/interpreter/mod.rs +2 -1
  41. package/rust/core/audio/interpreter/sleep.rs +2 -4
  42. package/rust/core/audio/interpreter/spawn.rs +4 -4
  43. package/rust/core/audio/loader/trigger.rs +2 -5
  44. package/rust/core/audio/mod.rs +2 -1
  45. package/rust/core/audio/renderer.rs +1 -1
  46. package/rust/core/audio/special/easing.rs +120 -0
  47. package/rust/core/audio/special/env.rs +41 -0
  48. package/rust/core/audio/special/math.rs +92 -0
  49. package/rust/core/audio/special/mod.rs +9 -0
  50. package/rust/core/audio/special/modulator.rs +120 -0
  51. package/rust/core/builder/mod.rs +11 -6
  52. package/rust/core/debugger/store.rs +1 -1
  53. package/rust/core/error/mod.rs +4 -1
  54. package/rust/core/lexer/handler/arrow.rs +60 -9
  55. package/rust/core/lexer/handler/at.rs +4 -4
  56. package/rust/core/lexer/handler/brace.rs +8 -8
  57. package/rust/core/lexer/handler/colon.rs +4 -4
  58. package/rust/core/lexer/handler/comment.rs +2 -2
  59. package/rust/core/lexer/handler/dot.rs +4 -4
  60. package/rust/core/lexer/handler/driver.rs +42 -13
  61. package/rust/core/lexer/handler/identifier.rs +5 -4
  62. package/rust/core/lexer/handler/indent.rs +16 -2
  63. package/rust/core/lexer/handler/newline.rs +1 -1
  64. package/rust/core/lexer/handler/number.rs +3 -3
  65. package/rust/core/lexer/handler/operator.rs +3 -1
  66. package/rust/core/lexer/handler/parenthesis.rs +8 -8
  67. package/rust/core/lexer/handler/slash.rs +5 -5
  68. package/rust/core/lexer/handler/string.rs +1 -1
  69. package/rust/core/lexer/mod.rs +1 -1
  70. package/rust/core/lexer/token.rs +4 -0
  71. package/rust/core/mod.rs +2 -1
  72. package/rust/core/parser/driver.rs +134 -11
  73. package/rust/core/parser/handler/arrow_call.rs +141 -65
  74. package/rust/core/parser/handler/at.rs +1 -1
  75. package/rust/core/parser/handler/bank.rs +35 -7
  76. package/rust/core/parser/handler/dot.rs +43 -22
  77. package/rust/core/parser/handler/identifier/automate.rs +194 -0
  78. package/rust/core/parser/handler/identifier/function.rs +2 -3
  79. package/rust/core/parser/handler/identifier/let_.rs +16 -0
  80. package/rust/core/parser/handler/identifier/mod.rs +14 -10
  81. package/rust/core/parser/handler/identifier/print.rs +29 -0
  82. package/rust/core/parser/handler/identifier/sleep.rs +1 -1
  83. package/rust/core/parser/handler/identifier/synth.rs +7 -9
  84. package/rust/core/parser/handler/loop_.rs +60 -43
  85. package/rust/core/parser/statement.rs +5 -0
  86. package/rust/core/plugin/loader.rs +48 -0
  87. package/rust/core/plugin/mod.rs +1 -0
  88. package/rust/core/preprocessor/loader.rs +7 -5
  89. package/rust/core/preprocessor/processor.rs +4 -4
  90. package/rust/core/preprocessor/resolver/bank.rs +1 -2
  91. package/rust/core/preprocessor/resolver/call.rs +19 -18
  92. package/rust/core/preprocessor/resolver/driver.rs +7 -5
  93. package/rust/core/preprocessor/resolver/function.rs +3 -13
  94. package/rust/core/preprocessor/resolver/loop_.rs +31 -1
  95. package/rust/core/preprocessor/resolver/spawn.rs +3 -22
  96. package/rust/core/preprocessor/resolver/tempo.rs +1 -1
  97. package/rust/core/preprocessor/resolver/trigger.rs +2 -3
  98. package/rust/core/preprocessor/resolver/value.rs +6 -12
  99. package/rust/core/shared/bank.rs +1 -1
  100. package/rust/core/utils/path.rs +1 -1
  101. package/rust/core/utils/validation.rs +0 -1
  102. package/rust/installer/addon.rs +80 -0
  103. package/rust/installer/bank.rs +25 -15
  104. package/rust/installer/mod.rs +4 -1
  105. package/rust/installer/plugin.rs +55 -0
  106. package/rust/main.rs +32 -10
  107. package/rust/utils/error.rs +51 -0
  108. package/rust/utils/logger.rs +20 -0
  109. package/rust/utils/mod.rs +1 -44
  110. package/rust/utils/spinner.rs +3 -5
package/.devalang CHANGED
@@ -4,6 +4,5 @@ output = "./output"
4
4
  watch = false
5
5
 
6
6
  [[banks]]
7
- path = "devalang://bank/808"
8
- version = "0.0.1"
9
- author = "devaloop"
7
+ path = "devalang://bank/devaloop.808"
8
+ version = "0.0.2"
package/Cargo.toml CHANGED
@@ -1,54 +1,58 @@
1
- [package]
2
- name = "devalang"
3
- version = "0.0.1-alpha.13"
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
- license-file = "LICENSE"
14
- edition = "2024"
15
-
16
- [[bin]]
17
- name = "devalang"
18
- path = "rust/main.rs"
19
- required-features = ["cli"]
20
-
21
- [lib]
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-cyan.svg" alt="Devalang Logo" width="300" />
2
+ <img src="https://devalang.com/images/devalang-logo.svg" alt="Devalang Logo" width="300" />
3
3
  </div>
4
4
 
5
5
  ![Rust](https://img.shields.io/badge/Made%20with-Rust-orange?logo=rust)
@@ -7,7 +7,7 @@
7
7
  ![Node.js](https://img.shields.io/badge/Node.js-18%2B-brightgreen?logo=node.js)
8
8
 
9
9
  ![Project Status](https://img.shields.io/badge/status-alpha-red)
10
- ![Version](https://img.shields.io/badge/version-0.0.1-blue)
10
+ ![Version](https://img.shields.io/npm/v/@devaloop/devalang)
11
11
  ![License: MIT](https://img.shields.io/badge/license-MIT-green)
12
12
  ![Platform](https://img.shields.io/badge/platform-Windows-blue)
13
13
 
@@ -16,26 +16,20 @@
16
16
 
17
17
  [![VSCode Extension](https://img.shields.io/visual-studio-marketplace/v/devaloop.devalang-vscode?label=VSCode%20Extension)](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
18
18
 
19
- # 🎶 Devalang
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
- 🦊 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.
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
- > 🚧 **v0.0.1-alpha.13 Notice** 🚧
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
- ### You can also have a look at the [Playground](https://playground.devalang.com) to try Devalang directly in your browser
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 myLead:
71
- let mySynth = synth sine
72
-
73
- mySynth -> note(C4, { duration: 400 })
74
- mySynth -> note(G4, { duration: 600 })
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 myLead
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-cyan.svg" alt="Devalang Logo" width="300" />
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
- <img src="https://devalang.com/images/devalang-logo-cyan.svg" alt="Devalang Logo" width="300" />
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-cyan.svg" alt="Devalang Logo" width="300" />
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
- - [ ] Implement debug mode
20
+ - [x] Implement debug mode
21
21
  - [ ] Implement compilation mode
22
22
  - [x] Building
23
23
  - [x] Implement watch mode
24
- - [ ] Implement debug mode
24
+ - [x] Implement debug mode
25
25
  - [ ] Implement compilation mode
26
- - [ ] Implement compression mode
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
@@ -1,9 +1,7 @@
1
1
  # This file demonstrates the use of banks in Devalang.
2
2
 
3
- let default_bank = 808
4
-
5
- bank default_bank
3
+ bank devaloop.808
6
4
 
7
5
  .808.kick auto
8
6
  .808.snare auto
9
- .808.hat auto
7
+ .808.openhat auto
@@ -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)
@@ -1,15 +1,45 @@
1
- # This file demonstrates the use of main features in Devalang.
2
- bpm 135
1
+ bpm 120
3
2
 
4
- bank 808
3
+ group main:
4
+ let lead = synth sine {
5
+ attack: 0,
6
+ decay: 100,
7
+ sustain: 100,
8
+ release: 100
9
+ }
5
10
 
6
- let entityTest1 = .808.kick auto
7
- let entityTest2 = .808.clap auto
8
- let entityTest3 = .808.snare auto
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
- fn myFirstGroup(entity1, entity2, entity3):
11
- .entity1
12
- .entity2
13
- .entity3
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
- call myFirstGroup(entityTest1, entityTest2, entityTest3)
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
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.13",
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
- "prepublish": "cargo build --release && npm run script:postbuild",
12
- "rust:dev:build": "cargo run build --entry examples --output output",
13
- "rust:dev:check": "cargo run check --entry examples --output output",
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": [
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.0.1-alpha.13",
2
+ "version": "0.0.1-alpha.15",
3
3
  "channel": "alpha",
4
- "lastCommit": "f25a91c6efe3dca91cc8fa3bfa829d3fc2271855",
5
- "build": 12
4
+ "lastCommit": "31dad63ed5eb76bdb5ada9177685ccea2ae06bdc",
5
+ "build": 14
6
6
  }