Hello Jan,
discrete steps can be achieved via the control specification array, how to use these (as array indices) is outside the scope of VarGui itself. It could e.g. be done like this
(
p = Pbind(
\dur, Pfunc { ~dur },
\note, Pfunc { a[~index] }
);
a = [1.0, 1.4444, 1.777, 1.5, 2] * 5;
v = VarGui([
dur: [0.1, 1, \lin, 0, 0.1],
index: [0, 4, \lin, 1, 0],
],
stream: p
).gui;
)
This is a flexible approach, as arrays can be exchanged on the fly.
But note that VarGui plays in newly generated envirs, above you used an interpreter variable for the array, with an envir variable it would fail:
(
p = Pbind(
\dur, Pfunc { ~dur },
\note, Pfunc { ~array[~index] }
);
~array = [1.0, 1.4444, 1.777, 1.5, 2] * 5;
v = VarGui([
dur: [0.1, 1, \lin, 0, 0.1],
index: [0, 4, \lin, 1, 0],
],
stream: p
).gui;
)
If you want to use speaking variable names, you can define in a dedicated envir, e.g. the topEnvironment.
(
t = topEnvironment;
p = Pbind(
\dur, Pfunc { ~dur },
\note, Pfunc { t[\array][~index] }
);
t[\array] = [1.0, 1.4444, 1.777, 1.5, 2] * 5;
v = VarGui([
dur: [0.1, 1, \lin, 0, 0.1],
index: [0, 4, \lin, 1, 0],
],
stream: p
).gui;
)