Hello everyone,
I am trying to link the EZPopMenu value with a variable length slider.
Each item from the PopMenu points to a different buffer length which I assign it to a global variable ~lastStartPosition.
Then I would like to set the “maxval” from the EZSlider with this value.
The issue is that everytime I select the item in the EZPopMenu, I have to re-evaluate the ~tremDurSlider object to assign the new value. Otherwise, it keeps the early one.
I believe that it is a kind of order of execuction issue but I am not able to set this right.
Anyone, please, could help me ?
any tips?
Thank you guys for everything!
~btnSelectLoop = EZPopUpMenu.new(w.view, Rect.new(1250,40,110,30),
"",
[
\Select_Patch ->{|a| ~testN = a.value-1; ("this is an empty Buffer").postln},
\Patch_1 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_2 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_3 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_4 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_5 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_6 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_7 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_8 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_9 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
\Patch_10 ->{|a| ~testN = a.value-1; ("this is Buffer " ++ a.value).postln},
],
globalAction: {
y.free;
(~looper[~testN].set(\trigSend, 1)).value;
y = OSCFunc({ arg msg, time; // receive trigger
~lastStartPosition = (msg[3]/48000).postln;
},'/the_answer', s.addr);
},
initVal: 0,
initAction: true;
);
~tremDurSlider = EZSlider(w.view, Rect.new(950,120,285,25), nil, ControlSpec(0.01, ~lastStartPosition, \lin, 0.01), initVal: 0.0, unitWidth:0, numberWidth:60,layout:\horz);