@devaloop/devalang 0.0.1-alpha.1 → 0.0.1-alpha.11
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 +9 -0
- package/Cargo.toml +15 -6
- package/README.md +79 -81
- package/docs/CHANGELOG.md +213 -0
- package/docs/ROADMAP.md +11 -8
- package/docs/TODO.md +32 -29
- package/examples/bank.deva +9 -0
- package/examples/condition.deva +20 -0
- package/examples/duration.deva +9 -0
- package/examples/group.deva +12 -0
- package/examples/index.deva +12 -5
- package/examples/loop.deva +16 -0
- package/examples/samples/hat-808.wav +0 -0
- package/examples/synth.deva +14 -0
- package/examples/variables.deva +9 -0
- package/out-tsc/bin/devalang.exe +0 -0
- package/out-tsc/scripts/version/fetch.js +1 -5
- package/package.json +5 -4
- package/project-version.json +3 -3
- package/rust/cli/bank.rs +455 -0
- package/rust/cli/build.rs +114 -28
- package/rust/cli/check.rs +96 -103
- package/rust/cli/driver.rs +280 -0
- package/rust/cli/init.rs +79 -0
- package/rust/cli/install.rs +17 -0
- package/rust/cli/mod.rs +8 -1
- package/rust/cli/play.rs +193 -0
- package/rust/cli/template.rs +57 -0
- package/rust/cli/update.rs +4 -0
- package/rust/common/cdn.rs +11 -0
- package/rust/common/mod.rs +1 -0
- package/rust/config/driver.rs +76 -0
- package/rust/config/loader.rs +110 -0
- package/rust/config/mod.rs +2 -0
- package/rust/core/audio/engine.rs +242 -0
- package/rust/core/audio/evaluator.rs +31 -0
- package/rust/core/audio/interpreter/arrow_call.rs +142 -0
- package/rust/core/audio/interpreter/call.rs +70 -0
- package/rust/core/audio/interpreter/condition.rs +69 -0
- package/rust/core/audio/interpreter/driver.rs +236 -0
- package/rust/core/audio/interpreter/let_.rs +19 -0
- package/rust/core/audio/interpreter/load.rs +18 -0
- package/rust/core/audio/interpreter/loop_.rs +67 -0
- package/rust/core/audio/interpreter/mod.rs +12 -0
- package/rust/core/audio/interpreter/sleep.rs +36 -0
- package/rust/core/audio/interpreter/spawn.rs +84 -0
- package/rust/core/audio/interpreter/tempo.rs +16 -0
- package/rust/core/audio/interpreter/trigger.rs +102 -0
- package/rust/core/audio/loader/mod.rs +1 -0
- package/rust/core/audio/loader/trigger.rs +64 -0
- package/rust/core/audio/mod.rs +6 -0
- package/rust/core/audio/player.rs +54 -0
- package/rust/core/audio/renderer.rs +54 -0
- package/rust/core/builder/mod.rs +70 -27
- package/rust/core/debugger/lexer.rs +27 -0
- package/rust/core/debugger/mod.rs +13 -49
- package/rust/core/debugger/preprocessor.rs +27 -0
- package/rust/core/debugger/store.rs +25 -0
- package/rust/core/error/mod.rs +60 -0
- package/rust/core/lexer/handler/arrow.rs +31 -0
- package/rust/core/lexer/handler/at.rs +21 -0
- package/rust/core/lexer/handler/brace.rs +41 -0
- package/rust/core/lexer/handler/colon.rs +21 -0
- package/rust/core/lexer/handler/comment.rs +30 -0
- package/rust/core/lexer/handler/dot.rs +21 -0
- package/rust/core/lexer/handler/driver.rs +241 -0
- package/rust/core/lexer/handler/identifier.rs +41 -0
- package/rust/core/lexer/handler/indent.rs +52 -0
- package/rust/core/lexer/handler/mod.rs +15 -0
- package/rust/core/lexer/handler/newline.rs +23 -0
- package/rust/core/lexer/handler/number.rs +31 -0
- package/rust/core/lexer/handler/operator.rs +44 -0
- package/rust/core/lexer/handler/slash.rs +21 -0
- package/rust/core/lexer/handler/string.rs +63 -0
- package/rust/core/lexer/mod.rs +37 -319
- package/rust/core/lexer/token.rs +87 -0
- package/rust/core/mod.rs +6 -2
- package/rust/core/parser/driver.rs +339 -0
- package/rust/core/parser/handler/arrow_call.rs +151 -0
- package/rust/core/parser/handler/at.rs +162 -0
- package/rust/core/parser/handler/bank.rs +41 -0
- package/rust/core/parser/handler/condition.rs +74 -0
- package/rust/core/parser/handler/dot.rs +178 -0
- package/rust/core/parser/handler/identifier/call.rs +41 -0
- package/rust/core/parser/handler/identifier/group.rs +75 -0
- package/rust/core/parser/handler/identifier/let_.rs +133 -0
- package/rust/core/parser/handler/identifier/mod.rs +51 -0
- package/rust/core/parser/handler/identifier/sleep.rs +33 -0
- package/rust/core/parser/handler/identifier/spawn.rs +41 -0
- package/rust/core/parser/handler/identifier/synth.rs +65 -0
- package/rust/core/parser/handler/loop_.rs +72 -0
- package/rust/core/parser/handler/mod.rs +8 -0
- package/rust/core/parser/handler/tempo.rs +47 -0
- package/rust/core/parser/mod.rs +3 -200
- package/rust/core/parser/statement.rs +96 -0
- package/rust/core/preprocessor/loader.rs +308 -0
- package/rust/core/preprocessor/mod.rs +2 -24
- package/rust/core/preprocessor/module.rs +42 -56
- package/rust/core/preprocessor/processor.rs +76 -0
- package/rust/core/preprocessor/resolver/bank.rs +41 -51
- package/rust/core/preprocessor/resolver/call.rs +123 -0
- package/rust/core/preprocessor/resolver/condition.rs +92 -0
- package/rust/core/preprocessor/resolver/driver.rs +232 -0
- package/rust/core/preprocessor/resolver/group.rs +61 -0
- package/rust/core/preprocessor/resolver/let_.rs +31 -0
- package/rust/core/preprocessor/resolver/loop_.rs +76 -67
- package/rust/core/preprocessor/resolver/mod.rs +12 -111
- package/rust/core/preprocessor/resolver/spawn.rs +58 -0
- package/rust/core/preprocessor/resolver/synth.rs +50 -0
- package/rust/core/preprocessor/resolver/tempo.rs +40 -61
- package/rust/core/preprocessor/resolver/trigger.rs +90 -154
- package/rust/core/preprocessor/resolver/value.rs +78 -0
- package/rust/core/shared/bank.rs +21 -0
- package/rust/core/shared/duration.rs +9 -0
- package/rust/core/shared/mod.rs +3 -0
- package/rust/core/shared/value.rs +29 -0
- package/rust/core/store/export.rs +28 -0
- package/rust/core/store/global.rs +39 -0
- package/rust/core/store/import.rs +28 -0
- package/rust/core/store/mod.rs +4 -0
- package/rust/core/store/variable.rs +28 -0
- package/rust/core/utils/mod.rs +2 -0
- package/rust/core/utils/path.rs +31 -0
- package/rust/core/utils/validation.rs +37 -0
- package/rust/installer/bank.rs +55 -0
- package/rust/installer/mod.rs +1 -0
- package/rust/lib.rs +162 -1
- package/rust/main.rs +104 -31
- package/rust/utils/file.rs +35 -0
- package/rust/utils/installer.rs +56 -0
- package/rust/utils/logger.rs +108 -34
- package/rust/utils/mod.rs +5 -3
- package/rust/utils/{loader.rs → spinner.rs} +2 -0
- package/rust/utils/watcher.rs +33 -0
- package/templates/minimal/.devalang +5 -0
- package/templates/minimal/README.md +202 -0
- package/templates/minimal/src/index.deva +2 -0
- package/templates/welcome/.devalang +5 -0
- package/templates/welcome/README.md +202 -0
- package/templates/welcome/samples/kick-808.wav +0 -0
- package/templates/welcome/src/index.deva +13 -0
- package/templates/welcome/src/variables.deva +5 -0
- package/typescript/scripts/version/fetch.ts +1 -6
- package/docs/COMMANDS.md +0 -31
- package/docs/SYNTAX.md +0 -148
- package/examples/exported.deva +0 -7
- package/rust/audio/mod.rs +0 -1
- package/rust/cli/new.rs +0 -1
- package/rust/core/parser/at.rs +0 -142
- package/rust/core/parser/bank.rs +0 -42
- package/rust/core/parser/dot.rs +0 -107
- package/rust/core/parser/identifer.rs +0 -91
- package/rust/core/parser/loop_.rs +0 -62
- package/rust/core/parser/tempo.rs +0 -42
- package/rust/core/parser/variable.rs +0 -129
- package/rust/core/preprocessor/dependencies.rs +0 -54
- package/rust/core/preprocessor/resolver/at.rs +0 -24
- package/rust/core/types/cli.rs +0 -160
- package/rust/core/types/mod.rs +0 -7
- package/rust/core/types/module.rs +0 -41
- package/rust/core/types/parser.rs +0 -73
- package/rust/core/types/statement.rs +0 -105
- package/rust/core/types/store.rs +0 -116
- package/rust/core/types/token.rs +0 -83
- package/rust/core/types/variable.rs +0 -32
- package/rust/runner/executer.rs +0 -44
- package/rust/runner/mod.rs +0 -1
- package/rust/utils/path.rs +0 -46
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## 🎼 Devalang, by **Devaloop Labs**
|
|
18
|
+
|
|
19
|
+
🎶 Compose music with code — simple, structured, sonic.
|
|
20
|
+
|
|
21
|
+
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers.
|
|
22
|
+
Compose loops, control samples, render and play audio — all in clean, readable text.
|
|
23
|
+
|
|
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.
|
|
25
|
+
|
|
26
|
+
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
27
|
+
|
|
28
|
+
> 🚧 **v0.0.1-alpha.5 Notice** 🚧
|
|
29
|
+
>
|
|
30
|
+
> Currently, Devalang CLI is only available for **Windows**.
|
|
31
|
+
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📚 Quick Access
|
|
36
|
+
|
|
37
|
+
- [📖 Documentation](./docs/)
|
|
38
|
+
- [💡 Examples](./examples/)
|
|
39
|
+
- [🌐 Project Website](https://devalang.com)
|
|
40
|
+
|
|
41
|
+
## 🚀 Features
|
|
42
|
+
|
|
43
|
+
- 🎵 **Audio Engine**: Integrated audio playback and rendering
|
|
44
|
+
- 🧩 **Module system** for importing and exporting variables between files
|
|
45
|
+
- 📜 **Structured AST** generation for debugging and future compilation
|
|
46
|
+
- 🔢 **Basic data types**: strings, numbers, booleans, maps, arrays
|
|
47
|
+
- 👁️ **Watch mode** for `build`, `check` and `play` commands
|
|
48
|
+
- 📂 **Project templates** for quick setup
|
|
49
|
+
|
|
50
|
+
## 📆 Installation
|
|
51
|
+
|
|
52
|
+
### For users
|
|
53
|
+
|
|
54
|
+
> - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
55
|
+
|
|
56
|
+
Install the package globally (NPM)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g @devaloop/devalang
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Usage without install (NPX)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx @devaloop/devalang <command>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### For contributors
|
|
69
|
+
|
|
70
|
+
> - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
71
|
+
> - ⚠️ Requires [Rust 1.70+](https://www.rust-lang.org/learn/get-started#installing-rust)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
> git clone https://github.com/devaloop-labs/devalang.git
|
|
75
|
+
> cd devalang
|
|
76
|
+
> npm install
|
|
77
|
+
> cargo install --path .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Development usage (you can customize arguments in package.json)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# For syntax checking test
|
|
84
|
+
npm run rust:dev:check
|
|
85
|
+
# For building test
|
|
86
|
+
npm run rust:dev:build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## ❔ Usage
|
|
90
|
+
|
|
91
|
+
NOTE: Commands are available via `devalang` or `npx @devaloop/devalang`.
|
|
92
|
+
|
|
93
|
+
NOTE: Arguments can be passed to commands using `--<argument>` syntax. You can also use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
94
|
+
|
|
95
|
+
NOTE: Some commands require a mandatory `--entry` argument to specify the input folder, and a `--output` argument to specify the output folder. If not specified, they default to `./src` and `./output` respectively.
|
|
96
|
+
|
|
97
|
+
For more examples, see [docs/COMMANDS.md](./docs/COMMANDS.md)
|
|
98
|
+
|
|
99
|
+
### Initialize a new project
|
|
100
|
+
|
|
101
|
+
In the current directory
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
devalang init
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or use optional arguments to specify a directory name and a template
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
devalang init --name <project-name> --template <template-name>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Checking syntax only
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
devalang check --watch
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Building output files
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
devalang build --watch
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Playing audio files (once by file change)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
devalang play --watch
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Playing audio files (continuous playback, even without file changes)
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
devalang play --repeat
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## ⚙️ Configuration
|
|
138
|
+
|
|
139
|
+
You can use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
140
|
+
|
|
141
|
+
To do this, create a `.devalang` file in the root of your project directory.
|
|
142
|
+
|
|
143
|
+
See [docs/CONFIG.md](./docs/CONFIG.md) for more information.
|
|
144
|
+
|
|
145
|
+
## 📄 Syntax example
|
|
146
|
+
|
|
147
|
+
For more examples, see [docs/SYNTAX.md](./docs/SYNTAX.md)
|
|
148
|
+
|
|
149
|
+
```deva
|
|
150
|
+
# index.deva
|
|
151
|
+
|
|
152
|
+
@import { globalBpm, globalBank, kickDuration } from "global.deva"
|
|
153
|
+
|
|
154
|
+
@load "./examples/samples/kick-808.wav" as customKick
|
|
155
|
+
|
|
156
|
+
bpm globalBpm
|
|
157
|
+
# Will declare the tempo at the globalBpm variable beats per minute
|
|
158
|
+
|
|
159
|
+
bank globalBank
|
|
160
|
+
# Will declare a custom instrument bank using the globalBank variable
|
|
161
|
+
|
|
162
|
+
loop 5:
|
|
163
|
+
.customKick kickDuration {reverb=50, drive=25}
|
|
164
|
+
# Will play 5 times a kick for the duration of the kickDuration variable with reverb and drive effects
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```deva
|
|
168
|
+
# global.deva
|
|
169
|
+
|
|
170
|
+
let globalBpm = 120
|
|
171
|
+
let globalBank = 808
|
|
172
|
+
let kickDuration = 500
|
|
173
|
+
|
|
174
|
+
@export { globalBpm, globalBank, kickDuration }
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## 🧯 Known issues
|
|
178
|
+
|
|
179
|
+
- No support yet for `if`, `else`, `else if` statements
|
|
180
|
+
- No support yet for `@group`, `@pattern`, `@function` statements
|
|
181
|
+
- No support yet for cross-platform builds (Linux, macOS)
|
|
182
|
+
|
|
183
|
+
## 🧪 Roadmap Highlights
|
|
184
|
+
|
|
185
|
+
For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
|
|
186
|
+
|
|
187
|
+
- ⏳ Other statements (e.g `if`, `@group`, ...)
|
|
188
|
+
- ⏳ Cross-platform support (Linux, macOS)
|
|
189
|
+
- ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
|
|
190
|
+
|
|
191
|
+
## 🛡️ License
|
|
192
|
+
|
|
193
|
+
MIT — see [LICENSE](./LICENSE)
|
|
194
|
+
|
|
195
|
+
## 🤝 Contributing
|
|
196
|
+
|
|
197
|
+
Contributions, bug reports and suggestions are welcome !
|
|
198
|
+
Feel free to open an issue or submit a pull request.
|
|
199
|
+
|
|
200
|
+
## 📢 Contact
|
|
201
|
+
|
|
202
|
+
📧 [contact@devaloop.com](mailto:contact@devaloop.com)
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## 🎼 Devalang, by **Devaloop Labs**
|
|
18
|
+
|
|
19
|
+
🎶 Compose music with code — simple, structured, sonic.
|
|
20
|
+
|
|
21
|
+
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers.
|
|
22
|
+
Compose loops, control samples, render and play audio — all in clean, readable text.
|
|
23
|
+
|
|
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.
|
|
25
|
+
|
|
26
|
+
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
27
|
+
|
|
28
|
+
> 🚧 **v0.0.1-alpha.5 Notice** 🚧
|
|
29
|
+
>
|
|
30
|
+
> Currently, Devalang CLI is only available for **Windows**.
|
|
31
|
+
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📚 Quick Access
|
|
36
|
+
|
|
37
|
+
- [📖 Documentation](./docs/)
|
|
38
|
+
- [💡 Examples](./examples/)
|
|
39
|
+
- [🌐 Project Website](https://devalang.com)
|
|
40
|
+
|
|
41
|
+
## 🚀 Features
|
|
42
|
+
|
|
43
|
+
- 🎵 **Audio Engine**: Integrated audio playback and rendering
|
|
44
|
+
- 🧩 **Module system** for importing and exporting variables between files
|
|
45
|
+
- 📜 **Structured AST** generation for debugging and future compilation
|
|
46
|
+
- 🔢 **Basic data types**: strings, numbers, booleans, maps, arrays
|
|
47
|
+
- 👁️ **Watch mode** for `build`, `check` and `play` commands
|
|
48
|
+
- 📂 **Project templates** for quick setup
|
|
49
|
+
|
|
50
|
+
## 📆 Installation
|
|
51
|
+
|
|
52
|
+
### For users
|
|
53
|
+
|
|
54
|
+
> - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
55
|
+
|
|
56
|
+
Install the package globally (NPM)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g @devaloop/devalang
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Usage without install (NPX)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx @devaloop/devalang <command>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### For contributors
|
|
69
|
+
|
|
70
|
+
> - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
71
|
+
> - ⚠️ Requires [Rust 1.70+](https://www.rust-lang.org/learn/get-started#installing-rust)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
> git clone https://github.com/devaloop-labs/devalang.git
|
|
75
|
+
> cd devalang
|
|
76
|
+
> npm install
|
|
77
|
+
> cargo install --path .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Development usage (you can customize arguments in package.json)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# For syntax checking test
|
|
84
|
+
npm run rust:dev:check
|
|
85
|
+
# For building test
|
|
86
|
+
npm run rust:dev:build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## ❔ Usage
|
|
90
|
+
|
|
91
|
+
NOTE: Commands are available via `devalang` or `npx @devaloop/devalang`.
|
|
92
|
+
|
|
93
|
+
NOTE: Arguments can be passed to commands using `--<argument>` syntax. You can also use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
94
|
+
|
|
95
|
+
NOTE: Some commands require a mandatory `--entry` argument to specify the input folder, and a `--output` argument to specify the output folder. If not specified, they default to `./src` and `./output` respectively.
|
|
96
|
+
|
|
97
|
+
For more examples, see [docs/COMMANDS.md](./docs/COMMANDS.md)
|
|
98
|
+
|
|
99
|
+
### Initialize a new project
|
|
100
|
+
|
|
101
|
+
In the current directory
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
devalang init
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or use optional arguments to specify a directory name and a template
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
devalang init --name <project-name> --template <template-name>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Checking syntax only
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
devalang check --watch
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Building output files
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
devalang build --watch
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Playing audio files (once by file change)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
devalang play --watch
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Playing audio files (continuous playback, even without file changes)
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
devalang play --repeat
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## ⚙️ Configuration
|
|
138
|
+
|
|
139
|
+
You can use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
140
|
+
|
|
141
|
+
To do this, create a `.devalang` file in the root of your project directory.
|
|
142
|
+
|
|
143
|
+
See [docs/CONFIG.md](./docs/CONFIG.md) for more information.
|
|
144
|
+
|
|
145
|
+
## 📄 Syntax example
|
|
146
|
+
|
|
147
|
+
For more examples, see [docs/SYNTAX.md](./docs/SYNTAX.md)
|
|
148
|
+
|
|
149
|
+
```deva
|
|
150
|
+
# index.deva
|
|
151
|
+
|
|
152
|
+
@import { globalBpm, globalBank, kickDuration } from "global.deva"
|
|
153
|
+
|
|
154
|
+
@load "./examples/samples/kick-808.wav" as customKick
|
|
155
|
+
|
|
156
|
+
bpm globalBpm
|
|
157
|
+
# Will declare the tempo at the globalBpm variable beats per minute
|
|
158
|
+
|
|
159
|
+
bank globalBank
|
|
160
|
+
# Will declare a custom instrument bank using the globalBank variable
|
|
161
|
+
|
|
162
|
+
loop 5:
|
|
163
|
+
.customKick kickDuration {reverb=50, drive=25}
|
|
164
|
+
# Will play 5 times a kick for the duration of the kickDuration variable with reverb and drive effects
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```deva
|
|
168
|
+
# global.deva
|
|
169
|
+
|
|
170
|
+
let globalBpm = 120
|
|
171
|
+
let globalBank = 808
|
|
172
|
+
let kickDuration = 500
|
|
173
|
+
|
|
174
|
+
@export { globalBpm, globalBank, kickDuration }
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## 🧯 Known issues
|
|
178
|
+
|
|
179
|
+
- No support yet for `if`, `else`, `else if` statements
|
|
180
|
+
- No support yet for `@group`, `@pattern`, `@function` statements
|
|
181
|
+
- No support yet for cross-platform builds (Linux, macOS)
|
|
182
|
+
|
|
183
|
+
## 🧪 Roadmap Highlights
|
|
184
|
+
|
|
185
|
+
For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
|
|
186
|
+
|
|
187
|
+
- ⏳ Other statements (e.g `if`, `@group`, ...)
|
|
188
|
+
- ⏳ Cross-platform support (Linux, macOS)
|
|
189
|
+
- ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
|
|
190
|
+
|
|
191
|
+
## 🛡️ License
|
|
192
|
+
|
|
193
|
+
MIT — see [LICENSE](./LICENSE)
|
|
194
|
+
|
|
195
|
+
## 🤝 Contributing
|
|
196
|
+
|
|
197
|
+
Contributions, bug reports and suggestions are welcome !
|
|
198
|
+
Feel free to open an issue or submit a pull request.
|
|
199
|
+
|
|
200
|
+
## 📢 Contact
|
|
201
|
+
|
|
202
|
+
📧 [contact@devaloop.com](mailto:contact@devaloop.com)
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 🦊 Welcome to Devalang !
|
|
2
|
+
# This is your first Devalang program ?
|
|
3
|
+
# Let's start with a simple example that plays a sample in a loop.
|
|
4
|
+
|
|
5
|
+
@import { bpmVar, bankVar, loopVar } from './variables.deva'
|
|
6
|
+
@load "../samples/kick-808.wav" as sample
|
|
7
|
+
|
|
8
|
+
bpm bpmVar
|
|
9
|
+
|
|
10
|
+
bank bankVar
|
|
11
|
+
|
|
12
|
+
loop loopVar:
|
|
13
|
+
.sample auto
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
2
|
import { execSync } from "child_process";
|
|
4
3
|
|
|
5
4
|
export const fetchVersion = async (projectVersionPath: string) => {
|
|
6
|
-
// Lire le fichier
|
|
7
5
|
const data = JSON.parse(fs.readFileSync(projectVersionPath, "utf-8"));
|
|
8
6
|
|
|
9
|
-
// Incrémenter le numéro de build
|
|
10
7
|
data.build = (data.build || 0) + 1;
|
|
11
8
|
|
|
12
|
-
// Récupérer le dernier hash git
|
|
13
9
|
try {
|
|
14
10
|
const commit = execSync("git rev-parse HEAD").toString().trim();
|
|
15
11
|
data.lastCommit = commit;
|
|
16
12
|
} catch (err) {
|
|
17
|
-
console.warn("⚠️
|
|
13
|
+
console.warn("⚠️ Unable to fetch git commit hash. Ensure you are in a git repository.");
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
// Écrire la mise à jour
|
|
21
16
|
fs.writeFileSync(projectVersionPath, JSON.stringify(data, null, 2));
|
|
22
17
|
}
|
|
23
18
|
|
package/docs/COMMANDS.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
# Devalang Commands Guide
|
|
6
|
-
|
|
7
|
-
## Checking
|
|
8
|
-
|
|
9
|
-
Checking syntax of .deva file(s)
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
devalang check --entry ./examples --output ./output
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Available arguments :
|
|
16
|
-
|
|
17
|
-
- `entry`: The input folder (default to `./src`)
|
|
18
|
-
- `output`: The output folder (default to `./output`)
|
|
19
|
-
|
|
20
|
-
## Building
|
|
21
|
-
|
|
22
|
-
Building AST of .deva file(s)
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
devalang build --entry ./examples --output ./output
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Available arguments :
|
|
29
|
-
|
|
30
|
-
- `entry`: The input folder (default to `./src`)
|
|
31
|
-
- `output`: The output folder (default to `./output`)
|
package/docs/SYNTAX.md
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
# Devalang Syntax Guide
|
|
6
|
-
|
|
7
|
-
Devalang supports a simple and intuitive syntax for composing music and sound design. Below is a guide to the basic syntax elements, types, and usage examples.
|
|
8
|
-
|
|
9
|
-
The engine is designed to be easy to read and write, allowing you to focus on your music rather than the code.
|
|
10
|
-
|
|
11
|
-
The engine uses indentation to define blocks, similar to Python. Each block must be indented consistently.
|
|
12
|
-
|
|
13
|
-
➡️ For full examples, check the `examples/` folder of the repository.
|
|
14
|
-
|
|
15
|
-
## Types
|
|
16
|
-
|
|
17
|
-
<details>
|
|
18
|
-
<summary>Show available types</summary>
|
|
19
|
-
|
|
20
|
-
### String
|
|
21
|
-
|
|
22
|
-
Strings are defined using double quotes.
|
|
23
|
-
|
|
24
|
-
```deva
|
|
25
|
-
let string = "myValue"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Number
|
|
29
|
-
|
|
30
|
-
Numbers can be integers or floating-point values. They do not require quotes.
|
|
31
|
-
|
|
32
|
-
```deva
|
|
33
|
-
let number = 99
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Boolean
|
|
37
|
-
|
|
38
|
-
Booleans can be either `true` or `false` without quotes.
|
|
39
|
-
|
|
40
|
-
```deva
|
|
41
|
-
let boolean = false
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Map
|
|
45
|
-
|
|
46
|
-
Maps are key-value pairs defined using curly braces. Keys are strings, and values can be of any type (string, number, boolean, map, or array).
|
|
47
|
-
|
|
48
|
-
```deva
|
|
49
|
-
let map = {myKey: 99}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Array
|
|
53
|
-
|
|
54
|
-
Arrays are ordered lists of values defined using square brackets. Values can be of any type (string, number, boolean, map, or array).
|
|
55
|
-
|
|
56
|
-
```deva
|
|
57
|
-
let array = [3, 4]
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
</details>
|
|
61
|
-
|
|
62
|
-
## Syntax usage
|
|
63
|
-
|
|
64
|
-
### Beats Per Minute
|
|
65
|
-
|
|
66
|
-
BPM is used to set the global tempo of the music.
|
|
67
|
-
|
|
68
|
-
```deva
|
|
69
|
-
bpm 125
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Sound Bank
|
|
73
|
-
|
|
74
|
-
Bank is used to select a sound bank for the audio engine.
|
|
75
|
-
|
|
76
|
-
```deva
|
|
77
|
-
bank 808
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Importing / Exporting Modules
|
|
81
|
-
|
|
82
|
-
Modules can be imported and exported to share variables between different files.
|
|
83
|
-
|
|
84
|
-
Exporting variables from a module :
|
|
85
|
-
|
|
86
|
-
```deva
|
|
87
|
-
# exported.deva
|
|
88
|
-
|
|
89
|
-
let exportedIterator = 10
|
|
90
|
-
let exportedParams = {drive: 50, decay: 30}
|
|
91
|
-
|
|
92
|
-
@export { exportedIterator, exportedParams }
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Importing and using the exported variables in another module :
|
|
96
|
-
|
|
97
|
-
```deva
|
|
98
|
-
# index.deva
|
|
99
|
-
|
|
100
|
-
@import { exportedIterator, exportedParams } "./exported.deva"
|
|
101
|
-
|
|
102
|
-
loop exportedIterator:
|
|
103
|
-
.kick auto exportedParams
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Built-in triggers
|
|
107
|
-
|
|
108
|
-
Usage : `.<trigger-name> <duration> <effects-map>`
|
|
109
|
-
|
|
110
|
-
Other triggers will be added in future releases (e.g. `.snare`, `.hihat`, `.tom`, `.clap`, `.crash`, `.ride`, `.synth`, `.bass`, `.pad`).
|
|
111
|
-
You can also create custom triggers using the `@load` directive.
|
|
112
|
-
|
|
113
|
-
```deva
|
|
114
|
-
.kick
|
|
115
|
-
.kick 1/4
|
|
116
|
-
.kick auto {reverb: 50, decay: 30}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Custom triggers
|
|
120
|
-
|
|
121
|
-
Same usage as built-in triggers, but with custom audio files or effects.
|
|
122
|
-
|
|
123
|
-
```deva
|
|
124
|
-
@load "./path/to/instrument.mp3" as mySample
|
|
125
|
-
|
|
126
|
-
.mySample auto {reverb: 50, drive: 25}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Let variables
|
|
130
|
-
|
|
131
|
-
Variables are defined using the `let` keyword, followed by the variable name and its value. The value can be of any type (string, number, boolean, map, or array).
|
|
132
|
-
|
|
133
|
-
```deva
|
|
134
|
-
let number = 0
|
|
135
|
-
let boolean = true
|
|
136
|
-
let string = "string"
|
|
137
|
-
let map = {myKey: 200}
|
|
138
|
-
let array = [0, 1, 2]
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Basic loops
|
|
142
|
-
|
|
143
|
-
Loops are defined using the `loop` keyword, followed by the number of iterations. The body of the loop is indented.
|
|
144
|
-
|
|
145
|
-
```deva
|
|
146
|
-
loop 10:
|
|
147
|
-
# ...
|
|
148
|
-
```
|
package/examples/exported.deva
DELETED
package/rust/audio/mod.rs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// TODO Audio engine
|
package/rust/cli/new.rs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// TODO Implement the new command to create a new project with a template
|