@grame/faustwasm 0.0.39 → 0.0.41
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/assets/standalone/faust-ui/index.js +0 -2
- package/assets/standalone/faust-ui/index.js.map +1 -1
- package/dist/cjs-bundle/index.js +1 -1
- package/dist/esm-bundle/index.js +1 -1
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +2 -2
- package/test/compost_library.lib +630 -0
- package/test/compost_networks.dsp +104 -0
- package/test/faustlive-wasm/faust-ui/index.js +0 -2
- package/test/faustlive-wasm/faust-ui/index.js.map +1 -1
- package/test/prime_numbers.dsp +198 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
declare name "WKR Compost Networks";
|
|
2
|
+
declare author "Luca Spanedda";
|
|
3
|
+
declare author "Dario Sanfilippo";
|
|
4
|
+
declare version "1.0";
|
|
5
|
+
declare description "2023";
|
|
6
|
+
declare copyright "Copyright (C) 2023 Luca Spanedda <lucaspanedda1995@gmail.com>";
|
|
7
|
+
declare license "MIT license";
|
|
8
|
+
// Import the WKR Library
|
|
9
|
+
import("compost_library.lib");
|
|
10
|
+
// N = voices, M = network inputs.
|
|
11
|
+
N = 4; M = 3;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/************************************************************************
|
|
15
|
+
************************************************************************
|
|
16
|
+
- AGENTS NETWORKS -
|
|
17
|
+
************************************************************************
|
|
18
|
+
************************************************************************/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
AgentCulture(N, M, S) =
|
|
22
|
+
(netINPeaks : delays(S) : gains : netLimt : hgroup("ControlSignals", cntrlSignal) <:
|
|
23
|
+
(hgroup("Agents", Agent(S)), (si.block(N), MapDynaComp)) : routeSig : hgroup("DynamicCompressors", netdynComp) : netStability) ~
|
|
24
|
+
(matrix) <: (netEnergy, si.bus(N)) : ro.crossNM(N, N)
|
|
25
|
+
with{
|
|
26
|
+
routeSig = ro.crossNM(N, N) : ro.interleave(N, N / 2);
|
|
27
|
+
// Agents Network
|
|
28
|
+
gains = vecOp((si.bus(N) , par(i, N, 16)), *);
|
|
29
|
+
matrix = vecOp((hadamard(N) , par(i, N, 1.0 / sqrt(N))), *);
|
|
30
|
+
//netInsx = vecOp((si.bus(N) , si.bus(N)), +);
|
|
31
|
+
netINPeaks = si.bus(N), (si.bus(N) <: si.bus(N * 2)) :
|
|
32
|
+
vecOp((vecOp((si.bus(N), par(i, N, 1 - peakenvelope(10))), *), si.bus(N)), +);
|
|
33
|
+
netdynComp = par(i, N, si.bus(2) : dynamiComp(S, i, .5, 100));
|
|
34
|
+
netLimt = par(i, N, LookaheadLimiter(1.0, .002, 10));
|
|
35
|
+
netStability = par(i, N, HPTPT(40) : LPTPT(15000));
|
|
36
|
+
delays(T) = vecOp((si.bus(N) , par(i, N, (ba.take((i + 1 + T) * 10, primesThousands) : MS2T))), @);
|
|
37
|
+
netEnergy = par(i, N, energy(100, 200));
|
|
38
|
+
cntrlSignal = si.bus(N) <: (si.bus(N), par(i, N, controlSignalProcessing(S, i, 48, 10)));
|
|
39
|
+
// Mapping
|
|
40
|
+
MapDynaComp = par(i, N, 48 ^ _ );
|
|
41
|
+
MapBP = par(i, N, vgroup("FC", MapBPf(i)), MapBPx(i))
|
|
42
|
+
with{
|
|
43
|
+
MapBPf(i) = 640 * 2 ^ (4 * _) : info(i, 0, 20000);
|
|
44
|
+
MapBPx(i) = _;
|
|
45
|
+
};
|
|
46
|
+
MapAP = par(i, N, MapOut(i), MapAPx(i))
|
|
47
|
+
with{
|
|
48
|
+
MapOut(i) = _ <: vgroup("Time", MapAPt(i)), vgroup("Gain", MapAPg(i));
|
|
49
|
+
MapAPt(i) = 10 ^ (2 * _ - 1) : infoScale(i, 0, 10) : _ * ma.SR;
|
|
50
|
+
MapAPg(i) = _ : biToUni : map(-0.999, 0.999) : infoScale(i, -1, 1);
|
|
51
|
+
MapAPx(i) = _;
|
|
52
|
+
};
|
|
53
|
+
MapGN = par(i, N, vgroup("Jit", MapGNj(i)), vgroup("Pitch", MapGNp(i)), MapGNx(i))
|
|
54
|
+
with{
|
|
55
|
+
MapGNj(i) = 1;
|
|
56
|
+
MapGNp(i) = 4 ^ _ : infoScale(i, -1, 4);
|
|
57
|
+
MapGNx(i) = _;
|
|
58
|
+
};
|
|
59
|
+
// Agents
|
|
60
|
+
Agent(0) = hgroup("0 BP Agent", routeSig : MapBP : par(i, N, BPSVF(1)));
|
|
61
|
+
Agent(1) = hgroup("1 AP Agent", routeSig : MapAP : par(i, N, AllpassWernerCascade(8, 192000, 60 * ma.SR)));
|
|
62
|
+
Agent(2) = hgroup("2 GN Agent", routeSig : MapGN : par(i, N, Stretcher(30, 30, 1, 1, 1, 0, 10, i)));
|
|
63
|
+
};
|
|
64
|
+
// Populations
|
|
65
|
+
Populations = par(i, M, AgentCulture(4, 3, i));
|
|
66
|
+
|
|
67
|
+
// Populations influences (Matrix Of Influences)
|
|
68
|
+
// Populations Influences: (Int Populations, Ext Populations) in Percent
|
|
69
|
+
MatrixOfInfluences(Int, Ext) = si.bus(N * M) <: par(i, M, W(i) : si.bus(N * M) :> si.bus(N))
|
|
70
|
+
with{
|
|
71
|
+
percent(P) = (1 / 100) * P;
|
|
72
|
+
W(0) = si.vecOp((si.bus(N * M), par(i, N * M, ba.if((i >= 0) & (i < N), percent(Int), percent(Ext/2) ))), *);
|
|
73
|
+
W(1) = si.vecOp((si.bus(N * M), par(i, N * M, ba.if((i >= N) & (i < (N * 2)), percent(Int), percent(Ext/2)))), *);
|
|
74
|
+
W(2) = si.vecOp((si.bus(N * M), par(i, N * M, ba.if((i >= (N * 2)) & (i < (N * 3)), percent(Int), percent(Ext/2)))), *);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Organisms live population growth
|
|
78
|
+
GrowthModel(E) = hgroup("Growth Model", par(i, M, vgroup("Population %i", populationGrowth(i, 24, E))));
|
|
79
|
+
// Listening points of the network
|
|
80
|
+
ListeningPoints = si.bus(N * M) <: (
|
|
81
|
+
lerpMulti(12, hslider("Listening Point 1", 0, 0, 1, .001)),
|
|
82
|
+
lerpMulti(12, hslider("Listening Point 2", 0, 0, 1, .001))
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/************************************************************************
|
|
87
|
+
************************************************************************
|
|
88
|
+
- COMPOST SYSTEM NETWORK (Main) -
|
|
89
|
+
************************************************************************
|
|
90
|
+
************************************************************************/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// Main Compost Network
|
|
94
|
+
WKR_Network = vgroup("Waste_Kompost_System",
|
|
95
|
+
(
|
|
96
|
+
vecOp((MatrixOfInfluences(95, 5), si.bus(N * M)), +) :
|
|
97
|
+
Populations : (par(i, M, (si.bus(N)), (si.bus(N) :> _)) <:
|
|
98
|
+
(par(i, M, si.block(N), _) :> _/(N * M)),
|
|
99
|
+
(par(i, M, si.bus(N), !)))
|
|
100
|
+
: (!, si.bus(N * M)) // : GrowthModel //
|
|
101
|
+
) ~ si.bus(N * M)
|
|
102
|
+
) :> (_/(N * M / 2)), (_/(N * M / 2)); // : ListeningPoints; //
|
|
103
|
+
// outs
|
|
104
|
+
process = si.bus(2) <: WKR_Network;
|
|
@@ -2719,7 +2719,6 @@ class HGroup extends _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2719
2719
|
}
|
|
2720
2720
|
item.expand(dX$, dY$);
|
|
2721
2721
|
});
|
|
2722
|
-
this.layout.width += dX;
|
|
2723
2722
|
return this;
|
|
2724
2723
|
}
|
|
2725
2724
|
offset() {
|
|
@@ -3166,7 +3165,6 @@ class VGroup extends _AbstractGroup__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
3166
3165
|
}
|
|
3167
3166
|
item.expand(dX$, dY$);
|
|
3168
3167
|
});
|
|
3169
|
-
this.layout.height += dY;
|
|
3170
3168
|
return this;
|
|
3171
3169
|
}
|
|
3172
3170
|
offset() {
|