You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from my current testing, for this real-time audio scripting, creating new variables, especially arrays should be avoided.
for now the script node provides outout, input (if there is one), sr and phase to the Scope of rhai, as well as variables from a to z. x0, x1, x2, y0, y1, y2.
I am still exploring the possibility to share a ringbuf in rhai Scope; some functions such as random can also be useful.
Add an example:
// a sawtooth osc chained with a onepole filter
a: meta `
f = 220.;
output.pad(128, 0.0);
if phase == 0 {
p = 0.0;
}
for i in 0..128 {
output[i] = p * 2. - 1.;
p += f / sr;
};
if p > 1.0 { p -= 1.0 };
output
` >> meta `
r = 1./2000.;
if phase == 0.0 {
z = 0.0
}
output.pad(128, 0.0);
b = (-2.0 * PI() * r).exp();
a = 1.0 - b;
for i in 0..128 {
y = input[i] * a + b * z;
output[i] = y;
z = y;
};
output
`
TODOs:
Solve the popping during update
Improve the performance
The text was updated successfully, but these errors were encountered:
chaosprint
changed the title
Missing the mechanism to add large scales of oscillators at once
Dynamic node manipulation
Feb 15, 2022
chaosprint
changed the title
Dynamic node manipulation
Possibility for dynamic node manipulation
Feb 15, 2022
It would also be great to support
dynamic node
.grame-cncm/faust#685 (comment)
Edit:
I have been looking for options for this embedding language and finally landed on
rhai
.the syntax of
rhai
is really intuitive and I think it has merged the syntax sugar ofjs
andrust
.embedding Rhai in Glicol is a very straightforward experience thanks to its well-designed api and docs (rhai.rs)
now, users can write:
see the interactive example on https://glicol.org/guide#rhai2
from my current testing, for this real-time audio scripting, creating new variables, especially arrays should be avoided.
for now the
script
node providesoutout
,input
(if there is one),sr
andphase
to theScope
of rhai, as well as variables froma
toz
.x0
,x1
,x2
,y0
,y1
,y2
.I am still exploring the possibility to share a
ringbuf
in rhaiScope
; some functions such as random can also be useful.Add an example:
TODOs:
The text was updated successfully, but these errors were encountered: