1

Given a Pseq similar to the following:

Pseq([1, 2, 3, 4, 5, 6, 7, 8], inf)

How would I randomise the values slightly each time? That is, not just randomly alter the 8 values once at initialisation time, but have a random offset added each time a value is sent to the stream?

David
  • 15,750
  • 22
  • 90
  • 150

1 Answers1

1

Here's a neat way:

(Pseq([1, 2, 3, 4, 5, 6, 7, 8], inf) + Pgauss(0, 0.1))

First you need to know that Pgauss is just a pattern that generates gaussian random numbers. You can use any other kind of pattern such as Pwhite.

Then you need to know the really pleasant bit: performing basic math operations on Patterns (as above) composes the patterns (by wrapping them in Pbinop).

Dan Stowell
  • 4,618
  • 2
  • 20
  • 30