Re: [Faudiostream-users] random value

2021-05-07 Thread Bob Bobsled
re: random value These are all great solutions. I didn't expect to see such good answers to this problem. I tried various other approaches too, such as writing the output of noise to a table, and then accessing the table values using a phasor but I couldn't quite figure out how to write the rand

Re: [Faudiostream-users] random value

2021-05-06 Thread James Mckernon
Hi Dario, On 5/6/21, Dario Sanfilippo wrote: > Even if calling an external random function, don't you always have the > problem of calling it with a different seed each time to get a different > stream at each run? Attached is my code relating to this. There's a c++ function, which takes a dummy

Re: [Faudiostream-users] random value

2021-05-06 Thread James Mckernon
Hi Dario, On 5/6/21, Dario Sanfilippo wrote: > Even if calling an external random function, don't you always have the > problem of calling it with a different seed each time to get a different > stream at each run? No, this isn't a problem - I have working code which gives different random value

Re: [Faudiostream-users] random value

2021-05-06 Thread Dario Sanfilippo
Hi, James. Even if calling an external random function, don't you always have the problem of calling it with a different seed each time to get a different stream at each run? If the external function uses, for example, time() to set a different seed, I feel that it would be easier to have a primi

Re: [Faudiostream-users] random value

2021-05-06 Thread riluan perfile
Thanks everybody. Looking forward to the new random addition in stdfaust.lb On Thu, 6 May 2021 at 11:33, Stéphane Letz wrote: > > > > > The foreign function approach works well, but only for compiling to c > > targets; I believe that when compiling to llvm, foreign functions are > > not availabl

Re: [Faudiostream-users] random value

2021-05-06 Thread Stéphane Letz
> > The foreign function approach works well, but only for compiling to c > targets; I believe that when compiling to llvm, foreign functions are > not available. (Perhaps someone could correct me if I'm wrong.) This > includes faustlive, and perhaps the faust IDE (does this use llvm? I > know it

Re: [Faudiostream-users] random value

2021-05-06 Thread James Mckernon
This is a bit of a limitation of faust for generative-type work. Faust's no.noise gives part of what one wants from randomness: the values in its sequence are uncorrelated with each other. However, it fails to give you the other thing one would want: it is deterministic, i.e. it gives the same seq

Re: [Faudiostream-users] random value

2021-05-06 Thread riluan perfile
I'm glad this question has been asked, was wondering myself how to do more generative work with Faust. Has anybody some more 'generative' examples to study ? Thanks On Thu, 6 May 2021 at 03:00, Julius Smith wrote: > Hi Bob, > > You could use latch to sample the random number stream. However,

Re: [Faudiostream-users] random value

2021-05-05 Thread Julius Smith
Hi Bob, You could use latch to sample the random number stream. However, it's more efficient to do something that can be completed at compile time, e.g., rtz = (*(1103515245) + 12345) & mask; rt(i) = seq(j,i+1,rtz) / RANDMAX; process = 1 <: par(i,N,*(rt(i))); On Wed, May 5, 2021 at 5:19 PM Bob

Re: [Faudiostream-users] random value

2021-05-05 Thread Dario Sanfilippo
Hi, Bob. You could reduce the rate of a process by using sample-and-hold functions as in the example below: import("stdfaust.lib"); mynoise(seed, period) = random / RANDMAX with { mask = 4294967295; // 2^32-1 random = +(seed) ~ ba.sAndH(clock, *(1103515245) & mask); // "linear congruential" clock

[Faudiostream-users] random value

2021-05-05 Thread Bob Bobsled
Hi, I've pondered this code for a while, and am failing to understand how to declare a variable which has a single random value. Of course this code creates random values at the sample rate. How would you get just one value instead of a constant stream of values? mynoise = random / RANDMAX with{