Random Piecewise Linear

This plugin generates a tone with a pseudorandom timbre at a specified frequency.

The tone consists of a series of pseudorandom piecewise linear functions applied to one of five wavetables specified by the “Table type” parameter: “Fundamental”, a sine wave, “Fifth”, a sine wave plus another sine wave at 1.5 times the frequency, “Saw”, a sawtooth wave, “Triangle”, a triangle wave, and “Random”, a pseudorandom piecewise linear wavetable. The resulting series of wavetables are then smoothly interpolated.
The “Maximum breakpoints per table” parameter specifies the maximum number of linear pieces in each function. Raising this may make the tone brighter.
Setting “Variable breakpoints per table” to “yes” will ensure every piecewise linear function has the maximum breakpoints per table. Otherwise, some tables will have fewer breakpoints. The precise number of breakpoints is determined pseudorandomly in that case.
The “Locks” parameter is a list of pairs of numbers. “(n x)” will cause the nth wavetable to continue to play for a duration of x seconds.
The “Random Seed” parameter seeds the pseudorandom number generator, an LCG.
The “Number of Tables” parameter specifies how many timbres the different piecewise linear functions will be used. Raising this number will cause the timbre to shift faster.
The “Frequency (Hz)” and “Length (Seconds)” parameters specify the frequency and length of the tone, respectively. If the “Locks” parameter is nonempty, the tone will remain the same length, and some of the latter wavetables will be omitted.

Note that I haven’t written any validation for the “Locks” parameter. The plugin does not check whether the user has correctly entered a series of pairs of the form (int float) (int float) (int float), and may behave unexpectedly otherwise.

Is it possible to include a high-pass filter to make the waveform more manageable ? …

high pass + inverted A weighting.gif

Right, couple of minor fixes now:

  • Output is now high-pass filtered (highpass8 at 25Hz)
  • “Random” table was really random, instead of pseudorandom.
  • Some validation for user input.
  • UI changes. Duration is now a time widget. Input affecting the wavetables are grouped together as “Timbral Parameters”.
  • Cleaned up a couple of functions. wav-list is still pretty hard to read.
    RANDOM-WAVES.ny (4.3 KB)