Hello Faust-Team,

I have a problem getting a simple source selector to work.
The faust code is the following:

switcher(channels,1) =_ , par(i, channels-1,!);
switcher(channels, channels) = par(i, channels-1,!),_;
switcher(channels, pos)=par(i, pos-1, !), _ , par(i, channels-pos, !);

srces = 3;
position = 2

process= par(i,srces_): switcher(srces,position);

This works, however, if I want to control the position with a slider, e.g. like

process = ...switcher(srces, sel_osci);

it fails with "the node of the tree is not an int nor a float": I tried already the following things, but all were unsuccessful:

sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1));
sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)): int;
sel_osci = 1:*(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)): int;
sel_osci = int(hslider("oscisrc [style:knob]", 1 , 1, 3 , 1)));


Another method, though no ideal (because of the merging :>), I tried was

switch(k, srces) = *(k == pos);
switcher(srces, position) = par(i, srces, _) : par(i, srces, switch(i, position)):>_;

This worked, but I got weird some audio artefacts (sometimes two oscillators could be heard at once or the knob was very sensitive to slight movements, and e.g. no giving me the first src at exactly position 1 but at a small "off-1"-position). Is there a simple way to get the first example to work or an easy alternative?

Thanks in advance!

Simon
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to