« Return to Thread: 1/f noise pattern?

Re: 1/f noise pattern?

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View in Thread

>Do we already have a 1/f noise pattern that I overlooked?
>
>If not, how about this?


nice.

note that according to the post reform pattern paradigm, lo, hi
should be able to be patterns, and length should be sent the value
message.

also you may want to use newCopyArgs for a simpler and faster init.


>hjh
>
>// McCartney-Voss 1/f noise
>
>Pmcvoss : Pattern {
> var <>lo, <>hi, <>generators, <>length;
> *new { |lo = 0, hi = 1, generators = 8, length = inf|
>
> ^super.new.lo_(lo).hi_(hi).generators_(generators).length_(length)
> }
>
> embedInStream { |inval|
> var counter = 1,
> maxCounter = 1 << (generators-1),
> gens = { 1.0.rand } ! generators,
> total = gens.sum,
> i, new;
>
> length.do {
> inval = ((total / generators) * (hi-lo) + lo).yield;
>
> i = counter.trailingZeroes;
> new = 1.0.rand;
> total = total - gens[i] + new;
> gens[i] = new;
>
>
> counter = (counter + 1).wrap(1, maxCounter);
> }
> ^inval
> }
>}
>
>
>
>: H. James Harkins
>
>: <mailto:jamshark70@...>jamshark70@...
>
>: <http://www.dewdrop-world.net>http://www.dewdrop-world.net
>
>.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
>
>
>"Come said the Muse,
>
>Sing me a song no poet has yet chanted,
>
>Sing me the universal."  -- Whitman


--





.

_______________________________________________
sc-dev mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

 « Return to Thread: 1/f noise pattern?

LightInTheBox - Buy quality products at wholesale price!