SuperCollider CLASSES (extension)


Weakly Nonlinear Oscillator
Inherits from: UGen : AbstractFunction : Object

//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, 


Naive Euler ODE solver implementation of the Weakly Nonlinear Oscillator with external perturbation (see Strogatz, Steven H. (1994) Nonlinear Dynamics and Chaos. Addison-Wesley, Reading, MA. pp215 or Pikovsky, Arkady., Rosenblum, Michael., and Kurths, Jurgen. (2001). Synchronization. CUP: Cambridge. pp 189).

D2x +w0*w0*x = alpha*(x^xexponent*+beta)*y^yexponent + input

y= Dx

The nonlinear term is not calculated if alpha is zero. Otherwise it is generated at additional CPU cost.

All inputs can have .kr rate UGens plugged in.

NOTE: Due to an error of implementation this oscillator has an additional distortion component in it- which adds to the sound! WeaklyNonlinear2 is an implementation with this fixed, but this older version is retained for backwards compatibility and because it has an interesting roughness.

Class Methods

*ar (input, reset: 0, ratex: 1, ratey: 1, freq: 440, initx: 0, inity: 0, alpha: 0, xexponent: 0, beta: 0, yexponent: 0, mul: 1, add: 0)



audio rate input, acts as external force




update rate for x


update rate for y


The equation constant w0 (linear oscillator's frequency when alone * 2pi)


reset value for u


reset value for w

Inherited class methods

Instance Methods

Inherited instance methods


//Can be very noisy, high pitched and aliases badly- ie great fun, but watch out for your ears, filter, try out odd param settings. I've turned all the amplitudes down in the following

//defaults, high pitched! WARNING


//with reset

//MouseY controls input strength of forcing oscillator

//2 per second

//with non zero nonlinear term, van der Pol equation, acts to damp, so a rest is needed to hear many sounds

//Duffing equation

//make one up... will last for a while then be lost- needs a Trigger control in reset, very aliased

//highly aliased

//anything happening?