randomhSignal Generators:Random (Noise) Generatorsrandomhrandomh
Generates random numbers with a user-defined limit and holds them for a period of time.
Description
Generates random numbers with a user-defined limit and holds them for a period of time.
Syntaxares randomh kmin, kmax, xcps [,imode] [,ifirstval]kres randomh kmin, kmax, kcps [,imode] [,ifirstval]Initializationimode (optional, default=0) -- generation mode of the
first output value (see below)
ifirstval (optional, default=0) -- first output value
Performancekmin -- minimum range limit
kmax -- maximum range limit
kcps, xcps -- rate of random break-point generation
The randomh opcode is similar to randh but allows the user to set arbitrary minimum and maximum values.
When imode = 0 (the default), the kmin
argument value is outputted during 1/kcps (resp.
1/xcps) seconds at the beginning of the note. Then,
the normal process takes place with a new random number generated and held
every 1/kcps (resp. 1/xcps) seconds.
When imode = 2, the ifirstval
argument value is outputted during 1/kcps (resp.
1/xcps) seconds at the beginning of the note. Then,
the normal process takes place with a new random number generated and held
every 1/kcps (resp. 1/xcps) seconds.
When imode = 3, the generation process begins with a
random value from the initialization time.
Examples
Here is an example of the randomh opcode. It uses the file randomh.csd.
Example of the randomh opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
Its output should include lines like this:
Mode: 0
i1 220.00000
i1 396.26079
i1 240.75446
i1 364.24577
...
Mode: 2
i1 330.00000
i1 416.50935
i1 356.11619
i1 433.59324
...
Mode: 3
i1 261.17741
i1 402.00891
i1 393.86592
i1 307.19839
...
Two musical examples featuring the randomh opcode:
FtmorfRandomh_Cucchi.csd and
Ftmorf_Cucchi.csd,
both by Stefano Cucchi.
See alsoRandom (Noise) GeneratorsCreditsAuthor: &namegabriel;Arguments imode and ifirstval
added by &namepinot;, Jan. 2011, after a discussion with Peiman Khosravi on
the csnd list.