Synth2

A selectable oscillator attached to an Attack / Decay envelope and a filter. The attack decay envelope modulates the amplitude of the oscillator and the cutoff frequency of the filter. The filterMult property determines how much the envelope raises the base cutoff for the filter over the course of the envelope. For example, if a synth2 has a base cutoff of .1 and a filterMult of .2, the modulated filter cutoff will be .3 when the envelope is at its peak.

Inherits from Ugen.

Example:

a = Synth2({ maxVoices:4, waveform:'PWM', filterMult:0, resonance:4 })

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

a.cutoff = Add( .2, Sine(.1, .15)._ )

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
  • decay : Int. Default range { 23, 44100 }. default value: 22050
  • 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.
  • cutoff : Float. Default range {0, .7}. The cutoff of the filter in normalized frequency values. The particular filter algorithm used is not particularly stable past .7.
  • resonance : Float. Default range {0, 5.5}. Resonance values higher than 5 will likely blow up to some extent depending on the source material. Be careful!
  • filterMult : Float. This property determines the amount the envelope will modulate the cutoff frequency by, normalized between {0,1}.

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.