Hi Alex,

The sampling rate in Hz (samples/sec) divided by frequency in Hz
(cycles/sec) yields samples per cycle, which sounds like what you are
asking for.  This is called "units analysis":
(samples/sec) / (cycles/sec) = (samples/cycle)

However, the argument to lfnoise is a frequency ("rate") in Hz, not a
period in samples.  I don't think you want to multiply frequency by ma.SR
to get rate.  Just pass frequency directly.

Cheers,
- Julius

On Thu, Jul 30, 2020 at 1:20 AM Alex Lucas <alexmluca...@gmail.com> wrote:

> Hi all,
>
> I'm new to Faust and have a fairly basic question.
>
> I'm looking to create a simple sample and hold LFO. It seems like
> no.lfnoise is what I need. From what I understand, it takes a 'rate'
> parameter - i.e. an interval in samples at which a random value is
> generated. My question is, how do I convert from frequency to a number of
> samples?
>
> Here's my attempt:
>
> import("stdfaust.lib");
>
> lfoRate = frequency * ma.SR
> with {
> frequency = hslider("frequency", 1, 1, 20, 0.1);
> };
>
> // new random value every X number of samples
> process = no.lfnoise(lfoRate) <: _,_;
>
> Thanks in advance.
> Alex
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>


-- 
"Anybody who knows all about nothing knows everything" -- Leonard Susskind
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to