lfsrSignal Generators:Random (Noise) Generatorslfsrlfsr
Linear Feedback Shift Register (LFSR).
Description
Output is a series of pseudo-random positive integers. This is the technique
used in so-called "Turing machine" synth modules and is usually used to
generate melodic sequences. This implementation is adapted from the firmware
for the Ornament & Crime module, as used in the Quantermain and Meta-Q apps.
Syntaxknum lfsr ilen, iprob [, iseed]Initializationilen -- length of shift register, valid values are 1-31 (inclusive). The
larger the length, the larger the resulting integers in the output. You
can use this to constrain the output to a suitable range.
iprob -- probability, valid values 1-255 (inclusive). Controls the spread
of the output; larger values result in a wider spread of values.
iseed (optional, default -1) -- initial state of the shift register, as a
pattern of bits. The value is treated as an unsigned integer, so the default
of -1 is effectivly all bits on (0b11111111...).
Performanceknum -- integer output
Examples
Here is an example of the lfsr opcode. It uses the file lfsr.csd.
Example of the lfsr opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoRandom (Noise) GeneratorsCreditsBy: &namedave; 2020Based on code by Patrick Dowling in the Ornament & Crime firmware.New in version 6.16