csound-expression-0.0.2: Csound combinator library

CsoundExpr.Opcodes.Sigmod.Wavshape

Description

Waveshaping and Phase Distortion

Synopsis

Documentation

chebyshevpoly :: K k0 => Arate -> [k0] -> ArateSource

  • opcode : chebyshevpoly
  • syntax :
   aout chebyshevpoly ain, k0 [, k1 [, k2 [...]]]
  • description :

The chebyshevpoly opcode calculates the value of a polynomial expression with a single a-rate input variable that is made up of a linear combination of the first N Chebyshev polynomials of the first kind. Each Chebyshev polynomial, Tn(x), is weighted by a k-rate coefficient, kn, so that the opcode is calculating a sum of any number of terms in the form kn*Tn(x). Thus, the chebyshevpoly opcode allows for the waveshaping of an audio signal with a dynamic transfer function that gives precise control over the harmonic content of the output.

polynomial :: K k0 => Arate -> [k0] -> ArateSource

  • opcode : polynomial
  • syntax :
   aout polynomial ain, k0 [, k1 [, k2 [...]]]
  • description :

The polynomial opcode calculates a polynomial with a single a-rate input variable. The polynomial is a sum of any number of terms in the form kn*x^n where kn is the nth coefficient of the expression. These coefficients are k-rate values.

powershape :: K k0 => [Irate] -> Arate -> k0 -> ArateSource

  • opcode : powershape
  • syntax :
   aout powershape ain, kShapeAmount [, ifullscale]
  • description :

The powershape opcode raises an input signal to a power with pre- and post-scaling of the signal so that the output will be in a predictable range. It also processes negative inputs in a symmetrical way to positive inputs, calculating a dynamic transfer function that is useful for waveshaping.

pdclip :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> ArateSource

  • opcode : pdclip
  • syntax :
   aout pdclip ain, kWidth, kCenter [, ibipolar [, ifullscale]]
  • description :

The pdclip opcode allows a percentage of the input range of a signal to be clipped to fullscale. It is similar to simply multiplying the signal and limiting the range of the result, but pdclip allows you to think about how much of the signal range is being distorted instead of the scalar factor and has a offset parameter for assymetric clipping of the signal range. pdclip is also useful for remapping phasors for phase distortion synthesis.

pdhalf :: K k0 => [Irate] -> Arate -> k0 -> ArateSource

  • opcode : pdhalf
  • syntax :
   aout pdhalf ain, kShapeAmount [, ibipolar [, ifullscale]]
  • description :

The pdhalf opcode is designed to emulate the classic phase distortion synthesis method of the Casio CZ-series of synthesizers from the mid-1980's. This technique reads the first and second halves of a function table at different rates in order to warp the waveform. For example, pdhalf can smoothly transform a sine wave into something approximating the shape of a saw wave.

pdhalfy :: K k0 => [Irate] -> Arate -> k0 -> ArateSource

  • opcode : pdhalfy
  • syntax :
   aout pdhalfy ain, kShapeAmount [, ibipolar [, ifullscale]]
  • description :

The pdhalfy opcode is a variation on the phase distortion synthesis method of the pdhalf opcode. It is useful for distorting a phasor in order to read two unequal portions of a table in the same number of samples.