Hi Benoit,

Since square is for alias-free oscillator usage.  I would recommend
lf_squarewavepos() for a modulated gate:

import("stdfaust.lib");

pulsedOsc = en.asr(0.35,1,0.35,gate) * os.oscrs(freq) * gain
with{
    freq = hslider("carrier freq",250,100,10000,1) : si.smooth(0.999);
    freqm = hslider("modulation freq",2.5,0,10,0.001);
    gain = hslider("gain",-10,-100,0,0.01): ba.db2linear(_) :si.smooth(0.999);
    gate = button("gate") * (os.lf_squarewavepos(freqm));
};

process = pulsedOsc;

- Julius


On Mon, Jul 1, 2019 at 1:47 PM Benoit Delemps
<benoitdelemps....@gmail.com> wrote:
>
> Hello everyone,
>
> I am trying to make a pulsed tone with the following caracteristics:
> - Attack time 35ms
> - Sustain time 200ms
> - Release time 35ms
> and the pattern has to repeat itself with a frequency of 2.5Hz.
> I've tried to use a square signal to generate the periodic signal but it 
> seems unstable at low frequency. this is what i've tried
>
> import("stdfaust.lib");
>
> pulsedOsc = os.oscrs(freq)*gain * en.asr(0.35,1,0.35,gate)
> with{
> freq = hslider("freq",250,100,10000,1) : si.smooth(0.999);
> gain = hslider("gain",-10,0,-100,0.01): ba.db2linear(_) :si.smooth(0.999);
> gate = button("gate")*(os.square(2.5)*0.5+0.5);
> };
>
> process = pulsedOsc;
>
> Is there another way?
>
> Thank you for your help
>
> Benoit
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



--

Julius O. Smith III <j...@ccrma.stanford.edu>
Professor of Music and, by courtesy, Electrical Engineering
CCRMA, Stanford University
http://ccrma.stanford.edu/~jos/


_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to