mimium-web 2.4.2-alpha → 3.0.0-alpha
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/README.md +30 -10
- package/mimium_web.d.ts +2 -2
- package/mimium_web.js +9 -9
- package/mimium_web_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,12 @@ fn dsp(){
|
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
## Unique Features
|
|
32
|
+
|
|
33
|
+
### Functional Approach
|
|
34
|
+
|
|
31
35
|
A special keyword `self` can be used in function, which is a last return value of the function.
|
|
32
|
-
This enables an easy and clean expression of feedback connection of signal chain.
|
|
36
|
+
This enables an easy and clean expression of feedback connection of signal chain as a function pipe.
|
|
33
37
|
|
|
34
38
|
```rust
|
|
35
39
|
fn lpf(input,fb){
|
|
@@ -37,29 +41,45 @@ fn lpf(input,fb){
|
|
|
37
41
|
}
|
|
38
42
|
```
|
|
39
43
|
|
|
40
|
-
Also, the language design is based on the call by value lambda calculus
|
|
44
|
+
Also, the language design is based on the call by value lambda calculus with multi-stage computation and the higher-order functions are supported to express generative signal graph like replicatiing multiple oscillators.
|
|
41
45
|
|
|
42
46
|
```rust
|
|
43
|
-
|
|
47
|
+
//Sequentially connected oscillators
|
|
48
|
+
#stage(macro)
|
|
49
|
+
fn cascade(n,gen){
|
|
44
50
|
if (n>0.0){
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
let multiplier = 1.0-(1.0/(n*3)) |> lift_f
|
|
52
|
+
`|rate| rate + ($gen)(rate/3)* 0.5 * rate* $multiplier
|
|
53
|
+
|> cascade!(n - 1.0 ,gen)
|
|
48
54
|
}else{
|
|
49
|
-
|
|
|
55
|
+
`|rate| ($gen)(rate)
|
|
50
56
|
}
|
|
51
57
|
}
|
|
58
|
+
#stage(main)
|
|
59
|
+
let osc = ...
|
|
60
|
+
fn dsp(){
|
|
61
|
+
let out = 50 |> cascade!(1000.0,`osc)
|
|
62
|
+
(out,out)
|
|
63
|
+
}
|
|
52
64
|
```
|
|
53
65
|
|
|
54
66
|
mimium is a statically typed language but the most of type annotations can be omitted by the type inference system. If you are interested in the theoritical background of mimium, see [the paper about mimium](https://matsuuratomoya.com/en/research/lambdammm-ifc-2024/).
|
|
55
67
|
|
|
56
|
-
|
|
68
|
+
### Live Coding
|
|
69
|
+
|
|
70
|
+
mimium can describe digital signal processing algorithm from very low-level, like Faust. Moreover, mimium can update source code without audio interruption, which enables **full-scratch dsp livecoding** performance.
|
|
71
|
+
|
|
72
|
+
### Extensibility
|
|
73
|
+
|
|
74
|
+
mimium's VM design is inspired by Lua, that can be easily embedded on Rust application through the plugin system. External functions(closures) defined in Rust can be easily called from mimium.
|
|
57
75
|
|
|
58
76
|
## Installation
|
|
59
77
|
|
|
60
|
-
|
|
78
|
+
The easiest way to start mimium is using [Visual Studio Code Extension](https://github.com/mimium-org/mimium-language). The extention will automatically download CLI tool `mimium-cli` and language server (support for syntactic highlight and error reporting) when installed.
|
|
79
|
+
|
|
80
|
+
You can run `.mmm` file from the command palette.
|
|
61
81
|
|
|
62
|
-
Also you can download the latest CLI tool [mimium-cli](https://github.com/tomoyanonymous/mimium-rs/releases) from GitHub Release.
|
|
82
|
+
Also you can download the latest CLI tool [mimium-cli](https://github.com/tomoyanonymous/mimium-rs/releases) from GitHub Release through shell script.
|
|
63
83
|
|
|
64
84
|
## Development
|
|
65
85
|
|
package/mimium_web.d.ts
CHANGED
|
@@ -52,9 +52,9 @@ export interface InitOutput {
|
|
|
52
52
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
53
53
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
54
54
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
55
|
+
readonly closure62_externref_shim: (a: number, b: number, c: any) => void;
|
|
55
56
|
readonly closure71_externref_shim: (a: number, b: number, c: any) => void;
|
|
56
|
-
readonly
|
|
57
|
-
readonly closure92_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
57
|
+
readonly closure88_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
58
58
|
readonly __wbindgen_start: () => void;
|
|
59
59
|
}
|
|
60
60
|
|
package/mimium_web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { read_file } from './snippets/mimium-lang-
|
|
1
|
+
import { read_file } from './snippets/mimium-lang-26dcaacbe296fcc0/src/utils/fileloader.cjs';
|
|
2
2
|
|
|
3
3
|
let wasm;
|
|
4
4
|
|
|
@@ -234,15 +234,15 @@ function passArrayF32ToWasm0(arg, malloc) {
|
|
|
234
234
|
return ptr;
|
|
235
235
|
}
|
|
236
236
|
function __wbg_adapter_18(arg0, arg1, arg2) {
|
|
237
|
-
wasm.
|
|
237
|
+
wasm.closure62_externref_shim(arg0, arg1, arg2);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
function __wbg_adapter_21(arg0, arg1, arg2) {
|
|
241
|
-
wasm.
|
|
241
|
+
wasm.closure71_externref_shim(arg0, arg1, arg2);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
function __wbg_adapter_72(arg0, arg1, arg2, arg3) {
|
|
245
|
-
wasm.
|
|
245
|
+
wasm.closure88_externref_shim(arg0, arg1, arg2, arg3);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
const ConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -542,7 +542,7 @@ function __wbg_get_imports() {
|
|
|
542
542
|
const ret = arg0.open();
|
|
543
543
|
return ret;
|
|
544
544
|
};
|
|
545
|
-
imports.wbg.
|
|
545
|
+
imports.wbg.__wbg_readfile_4315899bb6081982 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
546
546
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
547
547
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
548
548
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -599,12 +599,12 @@ function __wbg_get_imports() {
|
|
|
599
599
|
const ret = false;
|
|
600
600
|
return ret;
|
|
601
601
|
};
|
|
602
|
-
imports.wbg.
|
|
603
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
602
|
+
imports.wbg.__wbindgen_closure_wrapper167 = function(arg0, arg1, arg2) {
|
|
603
|
+
const ret = makeMutClosure(arg0, arg1, 63, __wbg_adapter_18);
|
|
604
604
|
return ret;
|
|
605
605
|
};
|
|
606
|
-
imports.wbg.
|
|
607
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
606
|
+
imports.wbg.__wbindgen_closure_wrapper183 = function(arg0, arg1, arg2) {
|
|
607
|
+
const ret = makeMutClosure(arg0, arg1, 72, __wbg_adapter_21);
|
|
608
608
|
return ret;
|
|
609
609
|
};
|
|
610
610
|
imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {
|
package/mimium_web_bg.wasm
CHANGED
|
Binary file
|