Thanks for the pointers.  I had some success with selectn().

I don't have access to the code I used yesterday, but it went something
like this:

sinewave = os.osc(freq);
triwave = os.triangle(freq);
sawwave = os.sawtooth(freq);
pulsewave = os.lf_pulsetrainpos(freq,duty);
waveselect = hslider("Waveform", 0,0,1,1);
waveform = sinewave, triwave, sawwave, pulsewave : selectn(4, waveselect);

My question is, with the code structured like this, will the CPU calculate
all of these waveforms simultaneously, or one at a time as selected by the
slider?

Thanks again,

Steve

On Mon, Jul 24, 2017 at 10:16 PM, Julius Smith <[email protected]>
wrote:

> There is also ba.selectn() (in basics.lib):
>
> // selectn(N,i)
> // _,_,_,_ : selectn(4,2) : _  // selects the 3rd input among 4
>
>
> On Mon, Jul 24, 2017 at 8:46 PM, Hermann Meyer <[email protected]> wrote:
>
>> Hi
>>
>>
>> We've a tremolo with waveform select in guitarix, using select3()
>>
>> here is the source file, Note that it is written for faust 0.9.73, so
>> you've to port it to the new library structure in faust.
>>
>> As well we using our own GUI, so we could translate checkbox to our
>> needs, you should replace it with a slider or a knob in order to use the
>> generic faust UI.
>>
>> https://sourceforge.net/p/guitarix/git/ci/master/tree/trunk/
>> src/faust/tremolo.dsp
>>
>>
>> regards
>> hermann
>>
>>
>> Am 24.07.2017 um 19:28 schrieb Steve Duell:
>>
>>> Hello,
>>>
>>> Would someone be so kind as to give me some pointers?
>>>
>>> The application I'm developing is essentially a tremolo modified from
>>> the example in Romain's workshop.  I'm trying to replace the sine
>>> oscillator with a choice of oscillators running various waveforms to give
>>> different shapes to the amplitude modulation.  This is where I'm stuck.
>>>
>>> Below is some pseudocode which hopefully illustrates what I'm trying to
>>> achieve. What I'm missing is the user control that actually SELECTS the
>>> source to use for the 'signal' variable:
>>>
>>>     tremolo = *(1-depth*((signal) : si.smooth(smoother)))
>>>     with{
>>>         depth = vslider("Depth[style:knob]",1,0,1,0.01) : si.smoo;
>>>         duty = vslider("P/W[style:knob]",0.5,0,1,0.01) : si.smoo;
>>>         smoother =
>>>     vslider("De-click[style:knob]",0.95,0.5,0.999,0.001) : si.smoo;
>>>         signal =  os.oscsin(freq) or;
>>>                   os.triangle(freq) or;
>>>                   os.sawtooth(freq) or;
>>>                   os.lf_pulsetrainpos(freq,duty) or;
>>>     };
>>>
>>>
>>> Thanks a ton for any tips you can give me.
>>>
>>> -Steve Duell
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>
>>>
>>> _______________________________________________
>>> Faudiostream-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Faudiostream-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>
>>
>>
>
>
> --
>
> Julius O. Smith III <[email protected]>
> Professor of Music and, by courtesy, Electrical Engineering
> CCRMA, Stanford University
> http://ccrma.stanford.edu/~jos/ <http://ccrma.stanford.edu/>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to