[PD] brown/grey noise in pd

Matt Barber brbrofsvl at gmail.com
Sun Nov 15 00:15:52 CET 2015


​The nice thing about supercollider is that you have the code available, so
you can try to replicate it. See code and attached patches below. Looks
like SC's GrayNoise is not about color but rather generates something akin
to a random Gray code.
https://en.wikipedia.org/wiki/Gray_code

void BrownNoise_next(BrownNoise *unit, int inNumSamples)
{
​    ​
float *out = ZOUT(0);
​    ​
RGET
​    ​
f
​​
loat z = unit->mLevel;
​    ​
LOOP1(inNumSamples,
​        ​
z += frand8(s1, s2, s3);
​ // random sample between -0.125 and +0.124999​

​        ​
if (z > 1.f) z = 2.f - z;
​        ​
else if (z < -1.f) z = -2.f - z;
​        ​
ZXP(out) = z;
​    ​
);
​    ​
unit->mLevel = z;
​    ​
RPUT
}

void BrownNoise_Ctor(BrownNoise* unit)
{
​    ​
SETCALC(BrownNoise_next);
​    ​
unit->mLevel = unit->mParent->mRGen->frand2();
​    ​
ZOUT0(0) = unit->mLevel;
}

On Sat, Nov 14, 2015 at 4:53 PM, Dan Wilcox <danomatika at gmail.com> wrote:

> There is also s_pinknoise in rjlib which uses rpole filters. Not sure how
> accurate it is, but then again, I’ve never really needed that much accuracy
> for what I do :)
>
> --------
> Dan Wilcox
> @danomatika <https://twitter.com/danomatika>
> danomatika.com
> robotcowboy.com
>
> On Nov 14, 2015, at 2:38 PM, pd-list-request at lists.iem.at wrote:
>
> *From: *Alexandre Torres Porres <porres at gmail.com>
> *Date: *November 14, 2015 at 2:09:54 PM MST
> *To: *Matt Barber <brbrofsvl at gmail.com>
> *Cc: *"pd-list at lists.iem.at" <pd-list at lists.iem.at>
> *Subject: **Re: [PD] brown/grey noise in pd*
>
>
> was looking for a substitute/parallel object to BrownNoise  in Sc, which
> is described just as "Generates noise whose spectrum falls off in power by
> 6 dB per octave."
>
> Another one would be GreyNoise, described as "Generates noise which
> results from flipping random bits in a word. This type of noise has a high
> RMS level relative to its peak to peak level. The spectrum is emphasized
> towards lower frequencies."
>
>
> thanks
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151114/a984b5a4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: brown~-help.pd
Type: application/octet-stream
Size: 435 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151114/a984b5a4/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: brown~.pd
Type: application/octet-stream
Size: 454 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151114/a984b5a4/attachment-0003.obj>


More information about the Pd-list mailing list