Synth

A selectable oscillator attached to an Attack / Decay envelope. The attack decay envelope modulates the amplitude of the oscillator.
Inherits from Ugen.

Example:

a = Synth({ maxVoices:4, waveform:'PWM', attack:ms(1), decay:ms(1000) })

a.play( [440, 880, 1320], 1/4 )

Properties

  • frequency : Hz. default range { 50, 3200 }. default value 440.
  • amp : Float. default range { 0, 1 }. default value: .25.
  • pulsewidth : Float. default range { 0, 1 }. default value: .5
  • attack : Int. Default range { 23, 44100 }. default value: 22050. Measured in samples.
  • decay : Int. Default range { 23, 44100 }. default value: 22050. Measured in samples.
  • maxVoices: Int. Default value: 1. The maximum number of frequencies the synthesizer can play simultaneously. This value can only be set during initialization.
  • glide: Float. Default range { 0, 1 }. Default value: .15. This property creates glissandi as the synthesizer moves from one note to the next. The closer the value is to one the longer the glissandi will be.
  • pan: Float. Default range { -1, 1 }. Default value: 0. The position in the stereo spectrum of the Synth output.
  • waveform : String. The name of an oscillator for the synth to use.

Methods

  • chord( Array:frequencies, Float:amp(optional) ) : Playback multiple notes at a provided amplitude. The maxVoices property have been set to a value higher than 1 during intialization for this function to work.
  • note( Float:frequency, Float:amp(optional) ) : This method tells the synthesizer to play a single note at a particular volume.
  • play( Array:frequencies, Array:durations ) : This method accepts arrays of frequencies and durations as arguments to create and start a sequencer targeting the oscillator.
  • stop() : This method stops the sequencer that is built into the oscillator if it has been started.
  • kill() : Disconnect the oscillator from whatever bus it is connected to.