@devaloop/devalang 0.0.1-alpha.16-hotfix.3 → 0.0.1-alpha.18
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/.cargo/config.toml +2 -0
- package/.devalang +10 -10
- package/.github/workflows/ci.yml +0 -1
- package/Cargo.toml +18 -2
- package/README.md +82 -34
- package/docs/CHANGELOG.md +91 -0
- package/docs/ROADMAP.md +7 -4
- package/docs/TODO.md +1 -1
- package/examples/index.deva +55 -35
- package/examples/pattern.deva +5 -5
- package/out-tsc/bin/index.d.ts +2 -0
- package/out-tsc/core/functions/index.d.ts +37 -0
- package/out-tsc/core/functions/index.js +76 -0
- package/out-tsc/core/index.d.ts +6 -0
- package/out-tsc/core/index.js +22 -0
- package/out-tsc/core/types/index.d.ts +4 -0
- package/out-tsc/core/types/index.js +20 -0
- package/out-tsc/core/types/plugin.d.ts +18 -0
- package/out-tsc/core/types/plugin.js +2 -0
- package/out-tsc/core/types/result.d.ts +27 -0
- package/out-tsc/core/types/result.js +2 -0
- package/out-tsc/core/types/statement.d.ts +106 -0
- package/out-tsc/core/types/statement.js +2 -0
- package/out-tsc/core/types/value.d.ts +43 -0
- package/out-tsc/core/types/value.js +2 -0
- package/out-tsc/index.d.ts +7 -0
- package/out-tsc/index.js +41 -2
- package/out-tsc/pkg/devalang_core.d.ts +7 -0
- package/out-tsc/pkg/devalang_core_bg.wasm.d.ts +33 -0
- package/out-tsc/scripts/copy-wasm-dts.d.ts +1 -0
- package/out-tsc/scripts/copy-wasm-dts.js +73 -0
- package/out-tsc/scripts/postinstall.d.ts +1 -0
- package/out-tsc/scripts/postinstall.js +33 -23
- package/out-tsc/scripts/version/bump.d.ts +1 -0
- package/out-tsc/scripts/version/fetch.d.ts +1 -0
- package/out-tsc/scripts/version/index.d.ts +1 -0
- package/out-tsc/scripts/version/sync.d.ts +1 -0
- package/package.json +16 -4
- package/project-version.json +3 -3
- package/rust/cli/bank/api.rs +122 -0
- package/rust/cli/bank/commands.rs +275 -0
- package/rust/cli/bank/mod.rs +29 -0
- package/rust/cli/build/commands.rs +107 -0
- package/rust/cli/build/mod.rs +2 -0
- package/rust/cli/build/process.rs +146 -0
- package/rust/cli/{check.rs → check/mod.rs} +18 -31
- package/rust/cli/discover/commands.rs +253 -0
- package/rust/cli/discover/config.rs +111 -0
- package/rust/cli/discover/fs.rs +19 -0
- package/rust/cli/discover/install.rs +103 -0
- package/rust/cli/discover/metadata.rs +48 -0
- package/rust/cli/discover/mod.rs +5 -0
- package/rust/cli/{init.rs → init/commands.rs} +88 -87
- package/rust/cli/init/mod.rs +1 -0
- package/rust/cli/install/addon.rs +126 -0
- package/rust/cli/install/bank.rs +53 -0
- package/rust/cli/{install.rs → install/commands.rs} +9 -9
- package/rust/{installer → cli/install}/mod.rs +2 -3
- package/rust/cli/install/plugin.rs +61 -0
- package/rust/cli/{login.rs → login/commands.rs} +8 -11
- package/rust/cli/login/mod.rs +1 -0
- package/rust/cli/mod.rs +2 -2
- package/rust/cli/{driver.rs → parser.rs} +7 -2
- package/rust/cli/play/commands.rs +324 -0
- package/rust/cli/play/io.rs +17 -0
- package/rust/cli/play/mod.rs +5 -0
- package/rust/cli/play/process.rs +150 -0
- package/rust/cli/play/realtime.rs +91 -0
- package/rust/cli/play/utils.rs +23 -0
- package/rust/cli/{telemetry.rs → telemetry/commands.rs} +4 -4
- package/rust/cli/telemetry/event_creator.rs +80 -0
- package/rust/cli/telemetry/mod.rs +3 -0
- package/rust/cli/telemetry/send.rs +51 -0
- package/rust/cli/{template.rs → template/commands.rs} +1 -1
- package/rust/cli/template/mod.rs +1 -0
- package/rust/cli/{update.rs → update/commands.rs} +6 -6
- package/rust/cli/update/mod.rs +1 -0
- package/rust/config/driver.rs +57 -72
- package/rust/config/mod.rs +1 -2
- package/rust/config/ops.rs +26 -0
- package/rust/config/settings.rs +40 -42
- package/rust/core/audio/engine/helpers.rs +158 -0
- package/rust/core/audio/engine/mod.rs +7 -0
- package/rust/core/audio/engine/sample.rs +359 -0
- package/rust/core/audio/engine/synth.rs +325 -0
- package/rust/core/audio/evaluator.rs +68 -27
- package/rust/core/audio/interpreter/arrow_call.rs +113 -33
- package/rust/core/audio/interpreter/call.rs +232 -56
- package/rust/core/audio/interpreter/condition.rs +3 -2
- package/rust/core/audio/interpreter/driver.rs +206 -151
- package/rust/core/audio/interpreter/let_.rs +1 -1
- package/rust/core/audio/interpreter/load.rs +2 -1
- package/rust/core/audio/interpreter/loop_.rs +7 -6
- package/rust/core/audio/interpreter/sleep.rs +2 -1
- package/rust/core/audio/interpreter/spawn.rs +186 -54
- package/rust/core/audio/interpreter/tempo.rs +31 -10
- package/rust/core/audio/interpreter/trigger.rs +2 -2
- package/rust/core/audio/loader/trigger.rs +4 -7
- package/rust/core/audio/player.rs +6 -0
- package/rust/core/audio/renderer.rs +5 -7
- package/rust/core/audio/special/env.rs +3 -1
- package/rust/core/audio/special/math.rs +26 -6
- package/rust/core/audio/special/modulator.rs +2 -2
- package/rust/core/builder/mod.rs +9 -3
- package/rust/core/debugger/lexer.rs +1 -1
- package/rust/core/debugger/mod.rs +6 -0
- package/rust/core/debugger/module.rs +4 -4
- package/rust/core/debugger/preprocessor.rs +1 -1
- package/rust/core/debugger/store.rs +2 -2
- package/rust/core/error/mod.rs +189 -0
- package/rust/core/lexer/driver.rs +61 -0
- package/rust/core/lexer/handler/arrow.rs +1 -1
- package/rust/core/lexer/handler/at.rs +1 -1
- package/rust/core/lexer/handler/brace.rs +2 -2
- package/rust/core/lexer/handler/colon.rs +1 -1
- package/rust/core/lexer/handler/comment.rs +1 -1
- package/rust/core/lexer/handler/dot.rs +1 -1
- package/rust/core/lexer/handler/driver.rs +1 -1
- package/rust/core/lexer/handler/identifier.rs +4 -3
- package/rust/core/lexer/handler/mod.rs +1 -2
- package/rust/core/lexer/handler/number.rs +1 -1
- package/rust/core/lexer/handler/operator.rs +1 -1
- package/rust/core/lexer/handler/parenthesis.rs +2 -2
- package/rust/core/lexer/handler/slash.rs +1 -1
- package/rust/core/lexer/handler/string.rs +1 -1
- package/rust/core/lexer/mod.rs +1 -52
- package/rust/core/lexer/token.rs +91 -97
- package/rust/core/mod.rs +0 -1
- package/rust/core/parser/driver.rs +78 -22
- package/rust/core/parser/handler/arrow_call.rs +28 -8
- package/rust/core/parser/handler/at.rs +55 -21
- package/rust/core/parser/handler/bank.rs +14 -4
- package/rust/core/parser/handler/condition.rs +6 -3
- package/rust/core/parser/handler/dot.rs +5 -3
- package/rust/core/parser/handler/identifier/automate.rs +13 -16
- package/rust/core/parser/handler/identifier/call.rs +4 -4
- package/rust/core/parser/handler/identifier/emit.rs +9 -5
- package/rust/core/parser/handler/identifier/function.rs +20 -7
- package/rust/core/parser/handler/identifier/group.rs +11 -7
- package/rust/core/parser/handler/identifier/let_.rs +24 -9
- package/rust/core/parser/handler/identifier/mod.rs +6 -5
- package/rust/core/parser/handler/identifier/on.rs +16 -7
- package/rust/core/parser/handler/identifier/print.rs +6 -9
- package/rust/core/parser/handler/identifier/sleep.rs +12 -5
- package/rust/core/parser/handler/identifier/spawn.rs +4 -4
- package/rust/core/parser/handler/identifier/synth.rs +79 -9
- package/rust/core/parser/handler/loop_.rs +38 -13
- package/rust/core/parser/handler/mod.rs +1 -0
- package/rust/core/parser/handler/pattern.rs +74 -0
- package/rust/core/parser/handler/tempo.rs +9 -5
- package/rust/core/parser/mod.rs +0 -1
- package/rust/core/parser/statement.rs +6 -137
- package/rust/core/plugin/loader.rs +41 -27
- package/rust/core/plugin/runner.rs +68 -17
- package/rust/core/preprocessor/loader.rs +181 -99
- package/rust/core/preprocessor/processor.rs +9 -9
- package/rust/core/preprocessor/resolver/bank.rs +6 -8
- package/rust/core/preprocessor/resolver/call.rs +47 -23
- package/rust/core/preprocessor/resolver/condition.rs +6 -8
- package/rust/core/preprocessor/resolver/driver.rs +28 -28
- package/rust/core/preprocessor/resolver/function.rs +6 -6
- package/rust/core/preprocessor/resolver/group.rs +6 -8
- package/rust/core/preprocessor/resolver/loop_.rs +8 -10
- package/rust/core/preprocessor/resolver/mod.rs +1 -0
- package/rust/core/preprocessor/resolver/pattern.rs +75 -0
- package/rust/core/preprocessor/resolver/spawn.rs +45 -22
- package/rust/core/preprocessor/resolver/synth.rs +6 -8
- package/rust/core/preprocessor/resolver/tempo.rs +6 -8
- package/rust/core/preprocessor/resolver/trigger.rs +22 -19
- package/rust/core/preprocessor/resolver/value.rs +99 -4
- package/rust/core/store/export.rs +28 -28
- package/rust/core/store/function.rs +6 -0
- package/rust/core/store/global.rs +7 -1
- package/rust/core/store/import.rs +28 -28
- package/rust/core/store/variable.rs +16 -2
- package/rust/core/utils/mod.rs +0 -1
- package/rust/lib.rs +102 -9
- package/rust/main.rs +159 -45
- package/rust/types/Cargo.toml +11 -0
- package/rust/types/src/addons.rs +55 -0
- package/rust/types/src/ast.rs +202 -0
- package/rust/types/src/config.rs +74 -0
- package/rust/types/src/lib.rs +12 -0
- package/rust/types/src/telemetry.rs +85 -0
- package/rust/utils/Cargo.toml +26 -0
- package/rust/utils/{error.rs → src/error.rs} +186 -200
- package/rust/utils/src/file.rs +94 -0
- package/rust/utils/src/first_usage.rs +97 -0
- package/rust/utils/{mod.rs → src/lib.rs} +1 -1
- package/rust/utils/{logger.rs → src/logger.rs} +17 -12
- package/rust/utils/src/path.rs +88 -0
- package/rust/utils/src/signature.rs +41 -0
- package/rust/utils/{spinner.rs → src/spinner.rs} +3 -5
- package/rust/utils/src/version.rs +27 -0
- package/rust/utils/{watcher.rs → src/watcher.rs} +13 -1
- package/rust/web/cdn.rs +34 -0
- package/templates/minimal/README.md +98 -54
- package/templates/welcome/README.md +98 -54
- package/templates/welcome/src/index.deva +56 -8
- package/templates/welcome/src/variables.deva +2 -4
- package/tests/rust/TODO.md +0 -0
- package/tests/typescript/index.spec.ts +136 -0
- package/tests/typescript/playhead.spec.ts +36 -0
- package/tests/typescript/render_e2e.spec.ts +77 -0
- package/tsconfig.json +1 -1
- package/typescript/core/functions/index.ts +83 -0
- package/typescript/core/index.ts +6 -0
- package/typescript/core/types/index.ts +4 -0
- package/typescript/core/types/plugin.ts +19 -0
- package/typescript/core/types/result.ts +29 -0
- package/typescript/core/types/statement.ts +47 -0
- package/typescript/core/types/value.ts +29 -0
- package/typescript/index.ts +7 -2
- package/typescript/pkg/devalang_core.d.ts +4 -0
- package/typescript/scripts/copy-wasm-dts.ts +41 -0
- package/rust/cli/bank.rs +0 -462
- package/rust/cli/build.rs +0 -252
- package/rust/cli/play.rs +0 -1123
- package/rust/common/cdn.rs +0 -5
- package/rust/config/loader.rs +0 -165
- package/rust/config/stats.rs +0 -257
- package/rust/core/audio/engine.rs +0 -696
- package/rust/core/shared/bank.rs +0 -21
- package/rust/core/shared/duration.rs +0 -9
- package/rust/core/shared/mod.rs +0 -3
- package/rust/core/shared/value.rs +0 -35
- package/rust/core/utils/validation.rs +0 -35
- package/rust/installer/addon.rs +0 -84
- package/rust/installer/bank.rs +0 -62
- package/rust/installer/plugin.rs +0 -54
- package/rust/installer/utils.rs +0 -56
- package/rust/utils/file.rs +0 -38
- package/rust/utils/first_usage.rs +0 -83
- package/rust/utils/signature.rs +0 -19
- package/rust/utils/telemetry.rs +0 -292
- package/rust/utils/version.rs +0 -15
- /package/rust/{common → web}/api.rs +0 -0
- /package/rust/{common → web}/mod.rs +0 -0
- /package/rust/{common → web}/sso.rs +0 -0
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
12
|
-
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
13
16
|
|
|
14
17
|

|
|
15
18
|

|
|
16
19
|
|
|
17
|
-
|
|
20
|
+

|
|
18
21
|
|
|
19
22
|
# 🦊 Devalang (CORE) — Compose music with code
|
|
20
23
|
|
|
@@ -25,12 +28,13 @@ Whether you're building a track, shaping textures, or performing live, Devalang
|
|
|
25
28
|
|
|
26
29
|
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
27
30
|
|
|
28
|
-
>
|
|
31
|
+
> **🚧 Notice 🚧**
|
|
32
|
+
>
|
|
33
|
+
> Includes synthesis, playback, and rendering features, but is still in early development, and breaking changes may occur.
|
|
29
34
|
>
|
|
30
|
-
>
|
|
35
|
+
> **NEW**: [Devaforge is now available for creating addons](https://github.com/devaloop-labs/devaforge).
|
|
31
36
|
>
|
|
32
|
-
>
|
|
33
|
-
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
37
|
+
> **NEW**: Now available for Windows, Linux, and macOS.
|
|
34
38
|
|
|
35
39
|
## 📚 Quick Access
|
|
36
40
|
|
|
@@ -41,81 +45,113 @@ From studio sketches to live sets, Devalang gives you rhythmic control — with
|
|
|
41
45
|
- [📜 Changelog](./docs/CHANGELOG.md)
|
|
42
46
|
- [💡 Examples](./examples/)
|
|
43
47
|
- [🌐 Project Website](https://devalang.com)
|
|
44
|
-
- [📦
|
|
48
|
+
- [📦 Devaforge on npm](https://www.npmjs.com/package/@devaloop/devaforge)
|
|
49
|
+
- [📦 Devalang on npm](https://www.npmjs.com/package/@devaloop/devalang)
|
|
45
50
|
|
|
46
51
|
## ⏱️ Try it now !
|
|
47
52
|
|
|
48
53
|
### Try Devalang in your browser
|
|
49
54
|
|
|
50
|
-
> Have a look at the
|
|
55
|
+
> [Have a look at the Playground to try Devalang directly in your browser](https://playground.devalang.com)
|
|
51
56
|
|
|
52
|
-
### Try Devalang
|
|
57
|
+
### Try Devalang in your terminal
|
|
58
|
+
|
|
59
|
+
#### With Node.js
|
|
53
60
|
|
|
54
61
|
```bash
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
npm install -g @devaloop/devalang@latest
|
|
63
|
+
```
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
#### With Rust
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
cargo install devalang
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Initialize a new project (current directory)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
59
74
|
devalang init --name my-project --template minimal
|
|
60
|
-
cd my-project
|
|
61
75
|
```
|
|
62
76
|
|
|
77
|
+
#### Write your first script
|
|
78
|
+
|
|
63
79
|
Create a new Devalang file `src/index.deva` in the project directory:
|
|
64
80
|
|
|
65
81
|
```deva
|
|
66
82
|
# src/index.deva
|
|
67
83
|
|
|
68
|
-
|
|
69
|
-
|
|
84
|
+
# BPM definition
|
|
85
|
+
bpm 125
|
|
86
|
+
|
|
87
|
+
# Bank picking (make sure you installed it)
|
|
88
|
+
bank devaloop.808 as my808Bank
|
|
89
|
+
|
|
90
|
+
group myGroup:
|
|
91
|
+
# Rhythmic (each beat playing a kick)
|
|
92
|
+
on beat:
|
|
93
|
+
.my808Bank.kick 1/4
|
|
94
|
+
|
|
95
|
+
# Synth definition with ADSR
|
|
96
|
+
let myLead = synth sine {
|
|
70
97
|
attack: 0,
|
|
71
98
|
decay: 100,
|
|
72
99
|
sustain: 100,
|
|
73
100
|
release: 100
|
|
74
101
|
}
|
|
75
102
|
|
|
76
|
-
# Global automation
|
|
77
|
-
automate
|
|
103
|
+
# Global automation
|
|
104
|
+
automate myLead:
|
|
78
105
|
param volume {
|
|
79
106
|
0% = 0.0
|
|
80
|
-
100% =
|
|
81
|
-
}
|
|
82
|
-
param pan {
|
|
83
|
-
0% = -1.0
|
|
84
|
-
100% = 1.0
|
|
107
|
+
100% = 0.5
|
|
85
108
|
}
|
|
86
109
|
param pitch {
|
|
87
110
|
0% = -12.0
|
|
88
111
|
100% = 12.0
|
|
89
112
|
}
|
|
90
113
|
|
|
91
|
-
|
|
114
|
+
# Notes in a loop with condition
|
|
115
|
+
for i in [1, 2, 3]:
|
|
116
|
+
if i == 3:
|
|
117
|
+
myLead -> note(C5, { duration: 200 })
|
|
118
|
+
print "Playing note C5 for " + i
|
|
119
|
+
|
|
120
|
+
# Pause runtime for 500ms
|
|
121
|
+
sleep 500
|
|
122
|
+
|
|
123
|
+
# Note with automation
|
|
124
|
+
myLead -> note(C4, {
|
|
92
125
|
duration: 400,
|
|
93
126
|
velocity: 0.8,
|
|
94
|
-
automate: {
|
|
127
|
+
automate: {
|
|
128
|
+
pan: {
|
|
129
|
+
0%: -1.0,
|
|
130
|
+
100%: 0.0
|
|
131
|
+
}
|
|
132
|
+
}
|
|
95
133
|
})
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
135
|
+
# Notes with params
|
|
136
|
+
myLead -> note(E4, { duration: 400 })
|
|
137
|
+
myLead -> note(G4, { duration: 600, glide: true, target_freq: 659.25 })
|
|
138
|
+
myLead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
|
|
100
139
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# Play the lead
|
|
105
|
-
|
|
106
|
-
call main
|
|
140
|
+
# Calling the group to play it
|
|
141
|
+
call myGroup
|
|
107
142
|
```
|
|
108
143
|
|
|
109
144
|
### And the best part ? You can play it directly from the command line:
|
|
110
145
|
|
|
146
|
+
#### Play the script once
|
|
147
|
+
|
|
111
148
|
```bash
|
|
112
|
-
# Play the Devalang file
|
|
113
149
|
devalang play
|
|
150
|
+
```
|
|
114
151
|
|
|
115
|
-
|
|
116
|
-
devalang play --watch
|
|
152
|
+
#### **LIVE mode** (repeat the playback + watch mode)
|
|
117
153
|
|
|
118
|
-
|
|
154
|
+
```bash
|
|
119
155
|
devalang play --repeat
|
|
120
156
|
```
|
|
121
157
|
|
|
@@ -125,40 +161,48 @@ devalang play --repeat
|
|
|
125
161
|
|
|
126
162
|
## ❓ Why Devalang ?
|
|
127
163
|
|
|
128
|
-
- 🎹 Prototype audio ideas without opening a DAW, even VSCode
|
|
164
|
+
- 🎹 Prototype audio ideas without opening a DAW, even VSCode with our Playground
|
|
129
165
|
- 💻 Integrate sound into code-based workflows
|
|
130
166
|
- 🎛️ Control audio parameters through readable syntax
|
|
131
167
|
- 🧪 Build musical logic with variables and conditions
|
|
132
168
|
- 🔄 Create complex patterns with ease
|
|
169
|
+
- 🎚️ Automate everything
|
|
133
170
|
|
|
134
171
|
## 🚀 Features
|
|
135
172
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
173
|
+
- ⚡ **Fast Build & Hot Reload** — optimized build process for quicker iteration.
|
|
174
|
+
- 🎵 **Audio Engine & Real-time runner** — low-latency playback, render-to-file, and a realtime runner used by `devalang play` for live feedback.
|
|
175
|
+
- ▶️ **Live mode (watch + repeat)** — edit and hear changes instantly with `devalang play --repeat` and watch mode.
|
|
176
|
+
- 🧩 **Language primitives** — synths, notes, ADSR, maps, arrays, loops, conditionals and functions for expressive musical logic.
|
|
177
|
+
- 🎛️ **Per-note automation & modulators** — `automate` maps, `$mod.*`, `$easing.*` and `$math.*` helpers for envelopes and LFOs.
|
|
178
|
+
- 🧩 **Module system & structured AST** — import/export variables, stable AST output for debugging and tooling.
|
|
179
|
+
- 🧰 **Plugins & Addons (WASM-ready)** — install plugins/banks, `@use` directive, and WASM plugin integration so plugins can render or process audio at runtime.
|
|
180
|
+
- 📦 **Addon manager & Devaforge** — CLI commands to discover/install banks, plugins and templates; `devaforge` helps create addons.
|
|
181
|
+
- ⚙️ **CLI tooling** — `build`, `check`, `play`, `install`, `init`, `discover`, `telemetry` and more with consistent flags (`--watch`, `--debug`, `--compress`).
|
|
182
|
+
- 📂 **Project templates & examples** — quick-start templates and many example projects in `examples/`.
|
|
183
|
+
- 🧑💻 **TypeScript API & WASM distribution** — Node-friendly package with TypeScript bindings and a WASM build for browser/Node usage.
|
|
184
|
+
- 🧰 **Editor & formatting support** — VSCode extension and Prettier plugin to edit Devalang with syntax and formatting support.
|
|
185
|
+
- 🎵 **Custom samples & banks** — drop samples into `.deva` and reference them from code; banks of sounds for fast composition.
|
|
186
|
+
- 🔄 **Looping, grouping & scheduling** — precise beat-tied scheduling primitives for complex rhythmic patterns.
|
|
145
187
|
|
|
146
188
|
## 📄 Documentation
|
|
147
189
|
|
|
148
|
-
### Please refer to the
|
|
190
|
+
### [Please refer to the online documentation](https://docs.devalang.com) for detailed information on syntax, features, and usage examples
|
|
149
191
|
|
|
150
|
-
##
|
|
192
|
+
## 📰 What's new
|
|
151
193
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
194
|
+
- **Devaforge**: Introduced a new system for creating and managing addons, including a CLI for addon generation.
|
|
195
|
+
- **Documentation updates**: Improved documentation for clarity and completeness.
|
|
196
|
+
- **Discovering addons**: Introduced a new command to detect addons.
|
|
197
|
+
- **Public TypeScript API**: Added a public TypeScript API for easier integration.
|
|
198
|
+
- **Improved error messages**: Enhanced error messages for better debugging.
|
|
199
|
+
- **Bug fixes**: Various bug fixes and stability improvements.
|
|
154
200
|
|
|
155
201
|
## 🧪 Roadmap Highlights
|
|
156
202
|
|
|
157
203
|
For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
|
|
158
204
|
|
|
159
|
-
- ⏳
|
|
160
|
-
- ⏳ Cross-platform support (Linux, macOS)
|
|
161
|
-
- ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
|
|
205
|
+
- ⏳ Smart modules
|
|
162
206
|
|
|
163
207
|
## 🛡️ License
|
|
164
208
|
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
12
|
-
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
13
16
|
|
|
14
17
|

|
|
15
18
|

|
|
16
19
|
|
|
17
|
-
|
|
20
|
+

|
|
18
21
|
|
|
19
22
|
# 🦊 Devalang (CORE) — Compose music with code
|
|
20
23
|
|
|
@@ -25,12 +28,13 @@ Whether you're building a track, shaping textures, or performing live, Devalang
|
|
|
25
28
|
|
|
26
29
|
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
27
30
|
|
|
28
|
-
>
|
|
31
|
+
> **🚧 Notice 🚧**
|
|
32
|
+
>
|
|
33
|
+
> Includes synthesis, playback, and rendering features, but is still in early development, and breaking changes may occur.
|
|
29
34
|
>
|
|
30
|
-
>
|
|
35
|
+
> **NEW**: [Devaforge is now available for creating addons](https://github.com/devaloop-labs/devaforge).
|
|
31
36
|
>
|
|
32
|
-
>
|
|
33
|
-
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
37
|
+
> **NEW**: Now available for Windows, Linux, and macOS.
|
|
34
38
|
|
|
35
39
|
## 📚 Quick Access
|
|
36
40
|
|
|
@@ -41,81 +45,113 @@ From studio sketches to live sets, Devalang gives you rhythmic control — with
|
|
|
41
45
|
- [📜 Changelog](./docs/CHANGELOG.md)
|
|
42
46
|
- [💡 Examples](./examples/)
|
|
43
47
|
- [🌐 Project Website](https://devalang.com)
|
|
44
|
-
- [📦
|
|
48
|
+
- [📦 Devaforge on npm](https://www.npmjs.com/package/@devaloop/devaforge)
|
|
49
|
+
- [📦 Devalang on npm](https://www.npmjs.com/package/@devaloop/devalang)
|
|
45
50
|
|
|
46
51
|
## ⏱️ Try it now !
|
|
47
52
|
|
|
48
53
|
### Try Devalang in your browser
|
|
49
54
|
|
|
50
|
-
> Have a look at the
|
|
55
|
+
> [Have a look at the Playground to try Devalang directly in your browser](https://playground.devalang.com)
|
|
51
56
|
|
|
52
|
-
### Try Devalang
|
|
57
|
+
### Try Devalang in your terminal
|
|
58
|
+
|
|
59
|
+
#### With Node.js
|
|
53
60
|
|
|
54
61
|
```bash
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
npm install -g @devaloop/devalang@latest
|
|
63
|
+
```
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
#### With Rust
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
cargo install devalang
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Initialize a new project (current directory)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
59
74
|
devalang init --name my-project --template minimal
|
|
60
|
-
cd my-project
|
|
61
75
|
```
|
|
62
76
|
|
|
77
|
+
#### Write your first script
|
|
78
|
+
|
|
63
79
|
Create a new Devalang file `src/index.deva` in the project directory:
|
|
64
80
|
|
|
65
81
|
```deva
|
|
66
82
|
# src/index.deva
|
|
67
83
|
|
|
68
|
-
|
|
69
|
-
|
|
84
|
+
# BPM definition
|
|
85
|
+
bpm 125
|
|
86
|
+
|
|
87
|
+
# Bank picking (make sure you installed it)
|
|
88
|
+
bank devaloop.808 as my808Bank
|
|
89
|
+
|
|
90
|
+
group myGroup:
|
|
91
|
+
# Rhythmic (each beat playing a kick)
|
|
92
|
+
on beat:
|
|
93
|
+
.my808Bank.kick 1/4
|
|
94
|
+
|
|
95
|
+
# Synth definition with ADSR
|
|
96
|
+
let myLead = synth sine {
|
|
70
97
|
attack: 0,
|
|
71
98
|
decay: 100,
|
|
72
99
|
sustain: 100,
|
|
73
100
|
release: 100
|
|
74
101
|
}
|
|
75
102
|
|
|
76
|
-
# Global automation
|
|
77
|
-
automate
|
|
103
|
+
# Global automation
|
|
104
|
+
automate myLead:
|
|
78
105
|
param volume {
|
|
79
106
|
0% = 0.0
|
|
80
|
-
100% =
|
|
81
|
-
}
|
|
82
|
-
param pan {
|
|
83
|
-
0% = -1.0
|
|
84
|
-
100% = 1.0
|
|
107
|
+
100% = 0.5
|
|
85
108
|
}
|
|
86
109
|
param pitch {
|
|
87
110
|
0% = -12.0
|
|
88
111
|
100% = 12.0
|
|
89
112
|
}
|
|
90
113
|
|
|
91
|
-
|
|
114
|
+
# Notes in a loop with condition
|
|
115
|
+
for i in [1, 2, 3]:
|
|
116
|
+
if i == 3:
|
|
117
|
+
myLead -> note(C5, { duration: 200 })
|
|
118
|
+
print "Playing note C5 for " + i
|
|
119
|
+
|
|
120
|
+
# Pause runtime for 500ms
|
|
121
|
+
sleep 500
|
|
122
|
+
|
|
123
|
+
# Note with automation
|
|
124
|
+
myLead -> note(C4, {
|
|
92
125
|
duration: 400,
|
|
93
126
|
velocity: 0.8,
|
|
94
|
-
automate: {
|
|
127
|
+
automate: {
|
|
128
|
+
pan: {
|
|
129
|
+
0%: -1.0,
|
|
130
|
+
100%: 0.0
|
|
131
|
+
}
|
|
132
|
+
}
|
|
95
133
|
})
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
135
|
+
# Notes with params
|
|
136
|
+
myLead -> note(E4, { duration: 400 })
|
|
137
|
+
myLead -> note(G4, { duration: 600, glide: true, target_freq: 659.25 })
|
|
138
|
+
myLead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
|
|
100
139
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# Play the lead
|
|
105
|
-
|
|
106
|
-
call main
|
|
140
|
+
# Calling the group to play it
|
|
141
|
+
call myGroup
|
|
107
142
|
```
|
|
108
143
|
|
|
109
144
|
### And the best part ? You can play it directly from the command line:
|
|
110
145
|
|
|
146
|
+
#### Play the script once
|
|
147
|
+
|
|
111
148
|
```bash
|
|
112
|
-
# Play the Devalang file
|
|
113
149
|
devalang play
|
|
150
|
+
```
|
|
114
151
|
|
|
115
|
-
|
|
116
|
-
devalang play --watch
|
|
152
|
+
#### **LIVE mode** (repeat the playback + watch mode)
|
|
117
153
|
|
|
118
|
-
|
|
154
|
+
```bash
|
|
119
155
|
devalang play --repeat
|
|
120
156
|
```
|
|
121
157
|
|
|
@@ -125,40 +161,48 @@ devalang play --repeat
|
|
|
125
161
|
|
|
126
162
|
## ❓ Why Devalang ?
|
|
127
163
|
|
|
128
|
-
- 🎹 Prototype audio ideas without opening a DAW, even VSCode
|
|
164
|
+
- 🎹 Prototype audio ideas without opening a DAW, even VSCode with our Playground
|
|
129
165
|
- 💻 Integrate sound into code-based workflows
|
|
130
166
|
- 🎛️ Control audio parameters through readable syntax
|
|
131
167
|
- 🧪 Build musical logic with variables and conditions
|
|
132
168
|
- 🔄 Create complex patterns with ease
|
|
169
|
+
- 🎚️ Automate everything
|
|
133
170
|
|
|
134
171
|
## 🚀 Features
|
|
135
172
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
173
|
+
- ⚡ **Fast Build & Hot Reload** — optimized build process for quicker iteration.
|
|
174
|
+
- 🎵 **Audio Engine & Real-time runner** — low-latency playback, render-to-file, and a realtime runner used by `devalang play` for live feedback.
|
|
175
|
+
- ▶️ **Live mode (watch + repeat)** — edit and hear changes instantly with `devalang play --repeat` and watch mode.
|
|
176
|
+
- 🧩 **Language primitives** — synths, notes, ADSR, maps, arrays, loops, conditionals and functions for expressive musical logic.
|
|
177
|
+
- 🎛️ **Per-note automation & modulators** — `automate` maps, `$mod.*`, `$easing.*` and `$math.*` helpers for envelopes and LFOs.
|
|
178
|
+
- 🧩 **Module system & structured AST** — import/export variables, stable AST output for debugging and tooling.
|
|
179
|
+
- 🧰 **Plugins & Addons (WASM-ready)** — install plugins/banks, `@use` directive, and WASM plugin integration so plugins can render or process audio at runtime.
|
|
180
|
+
- 📦 **Addon manager & Devaforge** — CLI commands to discover/install banks, plugins and templates; `devaforge` helps create addons.
|
|
181
|
+
- ⚙️ **CLI tooling** — `build`, `check`, `play`, `install`, `init`, `discover`, `telemetry` and more with consistent flags (`--watch`, `--debug`, `--compress`).
|
|
182
|
+
- 📂 **Project templates & examples** — quick-start templates and many example projects in `examples/`.
|
|
183
|
+
- 🧑💻 **TypeScript API & WASM distribution** — Node-friendly package with TypeScript bindings and a WASM build for browser/Node usage.
|
|
184
|
+
- 🧰 **Editor & formatting support** — VSCode extension and Prettier plugin to edit Devalang with syntax and formatting support.
|
|
185
|
+
- 🎵 **Custom samples & banks** — drop samples into `.deva` and reference them from code; banks of sounds for fast composition.
|
|
186
|
+
- 🔄 **Looping, grouping & scheduling** — precise beat-tied scheduling primitives for complex rhythmic patterns.
|
|
145
187
|
|
|
146
188
|
## 📄 Documentation
|
|
147
189
|
|
|
148
|
-
### Please refer to the
|
|
190
|
+
### [Please refer to the online documentation](https://docs.devalang.com) for detailed information on syntax, features, and usage examples
|
|
149
191
|
|
|
150
|
-
##
|
|
192
|
+
## 📰 What's new
|
|
151
193
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
194
|
+
- **Devaforge**: Introduced a new system for creating and managing addons, including a CLI for addon generation.
|
|
195
|
+
- **Documentation updates**: Improved documentation for clarity and completeness.
|
|
196
|
+
- **Discovering addons**: Introduced a new command to detect addons.
|
|
197
|
+
- **Public TypeScript API**: Added a public TypeScript API for easier integration.
|
|
198
|
+
- **Improved error messages**: Enhanced error messages for better debugging.
|
|
199
|
+
- **Bug fixes**: Various bug fixes and stability improvements.
|
|
154
200
|
|
|
155
201
|
## 🧪 Roadmap Highlights
|
|
156
202
|
|
|
157
203
|
For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
|
|
158
204
|
|
|
159
|
-
- ⏳
|
|
160
|
-
- ⏳ Cross-platform support (Linux, macOS)
|
|
161
|
-
- ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
|
|
205
|
+
- ⏳ Smart modules
|
|
162
206
|
|
|
163
207
|
## 🛡️ License
|
|
164
208
|
|
|
@@ -1,13 +1,61 @@
|
|
|
1
|
-
# 🦊 Welcome to Devalang
|
|
2
|
-
#
|
|
3
|
-
# Let's start with a simple example that plays a sample in a loop.
|
|
1
|
+
# 🦊 Welcome to Devalang
|
|
2
|
+
# Happy live-coding !
|
|
4
3
|
|
|
5
|
-
@import { bpmVar
|
|
6
|
-
@load "../samples/kick-808.wav" as
|
|
4
|
+
@import { bpmVar } from './variables.deva'
|
|
5
|
+
@load "../samples/kick-808.wav" as myKick
|
|
7
6
|
|
|
7
|
+
# BPM definition
|
|
8
8
|
bpm bpmVar
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
group myGroup:
|
|
11
|
+
# Rhythmic (each beat playing a kick)
|
|
12
|
+
on beat:
|
|
13
|
+
.myKick 1/4
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
# Synth definition with ADSR
|
|
16
|
+
let myLead = synth sine {
|
|
17
|
+
attack: 0,
|
|
18
|
+
decay: 100,
|
|
19
|
+
sustain: 100,
|
|
20
|
+
release: 100
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Global automation
|
|
24
|
+
automate myLead:
|
|
25
|
+
param volume {
|
|
26
|
+
0% = 0.0
|
|
27
|
+
100% = 0.5
|
|
28
|
+
}
|
|
29
|
+
param pitch {
|
|
30
|
+
0% = -12.0
|
|
31
|
+
100% = 12.0
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# Notes in a loop with condition
|
|
35
|
+
for i in [1, 2, 3]:
|
|
36
|
+
if i == 3:
|
|
37
|
+
myLead -> note(C5, { duration: 200 })
|
|
38
|
+
print "Playing note C5 for " + i
|
|
39
|
+
|
|
40
|
+
# Pause runtime for 500ms
|
|
41
|
+
sleep 500
|
|
42
|
+
|
|
43
|
+
# Note with automation
|
|
44
|
+
myLead -> note(C4, {
|
|
45
|
+
duration: 400,
|
|
46
|
+
velocity: 0.8,
|
|
47
|
+
automate: {
|
|
48
|
+
pan: {
|
|
49
|
+
0%: -1.0,
|
|
50
|
+
100%: 0.0
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
# Notes with params
|
|
56
|
+
myLead -> note(E4, { duration: 400 })
|
|
57
|
+
myLead -> note(G4, { duration: 600, glide: true, target_freq: 659.25 })
|
|
58
|
+
myLead -> note(B3, { duration: 400, slide: true, target_amp: 0.3 })
|
|
59
|
+
|
|
60
|
+
# Calling the group to play it
|
|
61
|
+
call myGroup
|
|
File without changes
|