Package

de.sciss.synth

ugen

Permalink

package ugen

Visibility
  1. Public
  2. All

Type Members

  1. final case class ArrayMax(rate: Rate, in: GE) extends MultiOut with Product with Serializable

    Permalink

    A UGen that finds the largest value across the channels of its input signal, providing both the value and the index.

    A UGen that finds the largest value across the channels of its input signal, providing both the value and the index.

    in

    multi-channel signal to analyze

    See also

    BufMax

    ArrayMin

  2. final case class ArrayMin(rate: Rate, in: GE) extends MultiOut with Product with Serializable

    Permalink

    A UGen that finds the smallest value across the channels of its input signal, providing both the value and the index.

    A UGen that finds the smallest value across the channels of its input signal, providing both the value and the index.

    in

    multi-channel signal to analyze

    See also

    BufMin

    ArrayMax

  3. final case class BufMax(rate: Rate, buf: GE, gate: GE = 1) extends MultiOut with IsIndividual with Product with Serializable

    Permalink

    A UGen that finds the largest value in a buffer, providing both the value and the index.

    A UGen that finds the largest value in a buffer, providing both the value and the index.

    buf

    identifier of the buffer containing the values to analyze. It treats multi-channel buffers as monophonic, and indices will refer to the de-interleaved frames and channels.

    gate

    when closed (zero), holds the last output value.

    See also

    ArrayMax

    BufMin

  4. final case class BufMin(rate: Rate, buf: GE, gate: GE = 1) extends MultiOut with IsIndividual with Product with Serializable

    Permalink

    A UGen that finds the smallest value in a buffer, providing both the value and the index.

    A UGen that finds the smallest value in a buffer, providing both the value and the index.

    buf

    identifier of the buffer containing the values to analyze. It treats multi-channel buffers as monophonic, and indices will refer to the de-interleaved frames and channels.

    gate

    when closed (zero), holds the last output value.

    See also

    ArrayMin

    BufMax

  5. final case class CircleRamp(rate: MaybeRate, in: GE, dur: GE = 0.1f, lo: GE = 180, hi: GE = 180) extends SingleOut with Product with Serializable

    Permalink

    This is a UGen like Ramp , but it always takes the shortest way around a defined circle, wrapping values where appropriate.

    This is a UGen like Ramp , but it always takes the shortest way around a defined circle, wrapping values where appropriate. This can be useful when smoothing panning signals for speaker rings, for instance in Vector Base Amplitude Panning.

    in

    The signal to be smoothed.

    dur

    Ramp duration in seconds

    lo

    The lower wrap value

    hi

    The upper wrap value

    See also

    Lag

    Ramp

    VBAP

  6. final case class DFM1(rate: Rate, in: GE, freq: GE = 440, res: GE = 0.1f, gain: GE = 1.0f, mode: GE = 0, noise: GE = 3.0E-4f) extends SingleOut with Product with Serializable

    Permalink

    A digital filter UGen which aims at accurately modeling an analog filter.

    A digital filter UGen which aims at accurately modeling an analog filter. It provides low-pass and high-pass modes, and the filter can be overdriven and will self-oscillate at high resonances.

    in

    Input signal to filter.

    freq

    Cutoff frequency in Hertz.

    res

    Resonance of the filter. Resonance is minimal at 0.0 and high at 1.0 , above which the filter starts overdrive and sound saturated (e.g. 1.2 ).

    gain

    Linear gain applied to the input signal.

    mode

    The filter can be used in low-pass ( 0 ) or high-pass ( 1 ) mode.

    noise

    Amount (amplitude) of noise added to the model.

  7. final case class ListTrig(rate: Rate, buf: GE, size: GE, reset: GE = 0, delay: GE = 0) extends SingleOut with IsIndividual with Product with Serializable

    Permalink

    A UGen that produces a scheduled sequences of trigger impulses.

    A UGen that produces a scheduled sequences of trigger impulses. Trigger times are provided as a list (buffer) of absolute offsets from time zero. A trigger is output as a single control period of value 1 , after which output returns to zero.

    buf

    identifier of the buffer containing the offsets for the triggers in seconds. The offsets are taken against the start time of the synth or the last time a reset was received. They are not accumulative, and the behavior is undefined if the values are not sorted in ascending order. The buffer should be monophonic.

    size

    the number of values to use from the buffer. Typically, this should be BufFrames.kr(buf) .

    reset

    resets the timer and begins reading the time offsets again at the start of the buffer.

    delay

    this value is added to each of the buffer values. For example, to delay the list of values all by half a second, use a delay of 0.5 . This parameter is only updated at initialization or reset.

    Note

    The argument order is different from its sclang counterpart.

    See also

    Timer

    Dbufrd

    DemandEnvGen

    Logger

    ListTrig2

  8. final case class ListTrig2(rate: Rate, buf: GE, size: GE, reset: GE = 0) extends SingleOut with IsIndividual with Product with Serializable

    Permalink

    A UGen that produces a scheduled sequences of trigger impulses.

    A UGen that produces a scheduled sequences of trigger impulses. Trigger times are provided as a list (buffer) of relative durations between consecutive events. A trigger is output as a single control period of value 1 , after which output returns to zero.

    buf

    identifier of the buffer containing the durations for the triggers in seconds. A value represents a relative offsets with respect to its predecessor. The first value indicates the time between the start of the synth or last reset received and the first trigger. The buffer should be monophonic.

    size

    the number of values to use from the buffer. Typically, this should be BufFrames.kr(buf) .

    reset

    resets the timer and begins reading the time deltas again at the start of the buffer.

    Note

    The argument order is different from its sclang counterpart.

    See also

    ListTrig2

    Dbufrd

    DemandEnvGen

    Logger

    ListTrig

  9. final case class Logger(rate: Rate, buf: GE, in: GE, trig: GE, reset: GE = 0) extends SingleOut with HasSideEffect with IsIndividual with Product with Serializable

    Permalink

    A UGen to store values in a buffer upon receiving a trigger.

    A UGen to store values in a buffer upon receiving a trigger. When a trigger happens, the current input values are sampled and stored as the next consecutive frame of the buffer.

    Storage starts at the buffer beginning and increments the write position until the buffer is full. While the buffer is not yet full, the UGen outputs 1 , then it outputs 0 . The buffer position can be reset using the reset input.

    Note that the UGen zeroes the buffer upon first instantiation, to ensure that out-of-date data is not confused with new data.

    buf

    identifier of the buffer to write to. Its number of channels should match those of in .

    in

    (multi-channel) signal to write to the buffer. Its number of channels should match those of buf .

    trig

    a non-positive to positive transition causes the UGen to append the current input values to the buffer

    reset

    a non-positive to positive transition causes the write index into the buffer to be reset to zero. The contents of the buffer will also be filled with zeroes. If the buffer was full, the UGen output switches back to zero.

    Note

    The argument order is different from its sclang counterpart.

    See also

    ListTrig

  10. final case class VBAP(rate: MaybeRate, numChannels: Int, in: GE, buf: GE, azimuth: GE = 0, elevation: GE = 1, spread: GE = 0) extends MultiOut with Product with Serializable

    Permalink

    A UGen for Vector Base Amplitude Panning (VBAP).

    A UGen for Vector Base Amplitude Panning (VBAP). This allows for equal power panning of a source over an arbitrary array of equidistant speakers. Normally this would be a ring, a dome, or partial dome.

    VBAP was created by Ville Pulkki. For more information on VBAP see http://www.acoustics.hut.fi/research/cat/vbap/ This version of VBAP for SC was ported from the ver. 0.99 PD code by Scott Wilson.

    numChannels

    the number of output channels

    in

    the signal to be panned

    buf

    id of a buffer containing data calculated by VBAPSetup . Its number of channels must correspond to numChannels

    azimuth

    +/- 180° from the median plane (i.e. straight ahead)

    elevation

    +/- 90° from the azimuth plane

    spread

    A value from 0-100. When 0, if the signal is panned exactly to a speaker location the signal is only on that speaker. At values higher than 0, the signal will always be on more than one speaker. This can smooth the panning effect by making localisation blur more constant.

    See also

    CircleRamp

  11. trait VBAPSetup extends AnyRef

    Permalink

Value Members

  1. object ArrayMax extends Serializable

    Permalink

    A UGen that finds the largest value across the channels of its input signal, providing both the value and the index.

    A UGen that finds the largest value across the channels of its input signal, providing both the value and the index.

    Examples
    // randomly changing array of three numbers
    play {
      val tr  = Impulse.kr(1)
      val sig = Vector.fill(3)(TIRand.kr(0, 100, tr))
      sig.zipWithIndex.foreach { case (n, i) => n.poll(tr, s"sig[$i]") }
      val m   = ArrayMax.kr(sig)
      m.value.poll(tr, "max-value")
      m.index.poll(tr, "max-index")
      ()
    }
    See also

    BufMax

    ArrayMin

  2. object ArrayMin extends Serializable

    Permalink

    A UGen that finds the smallest value across the channels of its input signal, providing both the value and the index.

    A UGen that finds the smallest value across the channels of its input signal, providing both the value and the index.

    Examples
    // randomly changing array of three numbers
    play {
      val tr  = Impulse.kr(1)
      val sig = Vector.fill(3)(TIRand.kr(0, 100, tr))
      sig.zipWithIndex.foreach { case (n, i) => n.poll(tr, s"sig[$i]") }
      val m   = ArrayMin.kr(sig)
      m.value.poll(tr, "min-value")
      m.index.poll(tr, "min-index")
      ()
    }
    See also

    BufMin

    ArrayMax

  3. object BufMax extends Serializable

    Permalink

    A UGen that finds the largest value in a buffer, providing both the value and the index.

    A UGen that finds the largest value in a buffer, providing both the value and the index.

    Examples
    // simple test
    val b = Buffer(s)
    b.alloc(100)
    b.zero()
    b.set(33 -> 1.034)
    
    // verify that the 33rd value is detected...
    val x = play {
      val m  = BufMax.kr(b.id)
      val tr = "poll".tr(1)
      m.value.poll(tr, "max-value")
      m.index.poll(tr, "max-index")
      ()
    }
    
    // ...until we set a new maximum...
    b.set(74 -> 1.038); x.set("poll" -> 1)
    
    x.free(); b.free()
    See also

    ArrayMax

    BufMin

  4. object BufMin extends Serializable

    Permalink

    A UGen that finds the smallest value in a buffer, providing both the value and the index.

    A UGen that finds the smallest value in a buffer, providing both the value and the index.

    Examples
    // simple test
    val b = Buffer(s)
    b.alloc(100)
    b.zero()
    b.set(33 -> -1.034)
    
    // verify that the 33rd value is detected...
    val x = play {
      val m  = BufMin.kr(b.id)
      val tr = "poll".tr(1)
      m.value.poll(tr, "min-value")
      m.index.poll(tr, "min-index")
      ()
    }
    
    // ...until we set a new minimum...
    b.set(74 -> -1.038); x.set("poll" -> 1)
    
    x.free(); b.free()
    See also

    ArrayMin

    BufMax

  5. object CircleRamp extends Serializable

    Permalink

    This is a UGen like Ramp , but it always takes the shortest way around a defined circle, wrapping values where appropriate.

    This is a UGen like Ramp , but it always takes the shortest way around a defined circle, wrapping values where appropriate. This can be useful when smoothing panning signals for speaker rings, for instance in Vector Base Amplitude Panning.

    See also

    Lag

    Ramp

    VBAP

  6. object DFM1 extends Serializable

    Permalink

    A digital filter UGen which aims at accurately modeling an analog filter.

    A digital filter UGen which aims at accurately modeling an analog filter. It provides low-pass and high-pass modes, and the filter can be overdriven and will self-oscillate at high resonances.

  7. object ListTrig extends Serializable

    Permalink

    A UGen that produces a scheduled sequences of trigger impulses.

    A UGen that produces a scheduled sequences of trigger impulses. Trigger times are provided as a list (buffer) of absolute offsets from time zero. A trigger is output as a single control period of value 1 , after which output returns to zero.

    Examples
    // trigger grains
    val b = Buffer(s)
    b.alloc(10)
    b.setData(Vector(1, 2, 3, 5, 8, 13, 21, 34, 55, 89).map(_ * 0.1f)) // quasi Fibonacci
    
    val x = play {
      val reset = "reset".tr
      val tr  = ListTrig.kr(b.id, BufFrames.kr(b.id), reset)
      Timer.kr(tr).poll(tr, "timer")
      val env = EnvGen.ar(Env.perc(0.01, 0.1), gate = tr)
      SinOsc.ar(Seq(440, 460)) * env * 0.2
    }
    
    x.set("reset" -> 1)  // start anew
    x.free(); b.free()
    Note

    The argument order is different from its sclang counterpart.

    See also

    Timer

    Dbufrd

    DemandEnvGen

    Logger

    ListTrig2

  8. object ListTrig2 extends Serializable

    Permalink

    A UGen that produces a scheduled sequences of trigger impulses.

    A UGen that produces a scheduled sequences of trigger impulses. Trigger times are provided as a list (buffer) of relative durations between consecutive events. A trigger is output as a single control period of value 1 , after which output returns to zero.

    Examples
    // trigger grains
    val b = Buffer(s)
    b.alloc(11)
    b.setData(Vector(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89).map(_ * 0.1f)) // Fibonacci
    
    val x = play {
      val reset = "reset".tr
      val tr  = ListTrig2.kr(b.id, BufFrames.kr(b.id), reset)
      Timer.kr(tr).poll(tr, "timer")
      val env = EnvGen.ar(Env.perc(0.01, 0.1), gate = tr)
      SinOsc.ar(Seq(440, 460)) * env * 0.2
    }
    
    x.set("reset" -> 1)  // start anew
    x.free(); b.free()
    Note

    The argument order is different from its sclang counterpart.

    See also

    ListTrig2

    Dbufrd

    DemandEnvGen

    Logger

    ListTrig

  9. object Logger extends Serializable

    Permalink

    A UGen to store values in a buffer upon receiving a trigger.

    A UGen to store values in a buffer upon receiving a trigger. When a trigger happens, the current input values are sampled and stored as the next consecutive frame of the buffer.

    Storage starts at the buffer beginning and increments the write position until the buffer is full. While the buffer is not yet full, the UGen outputs 1 , then it outputs 0 . The buffer position can be reset using the reset input.

    Note that the UGen zeroes the buffer upon first instantiation, to ensure that out-of-date data is not confused with new data.

    Examples
    // fill buffer and plot on client side
    val b = Buffer(s)
    b.alloc(100)
    
    val x = play {
      val z = LFCub.kr(10) * EnvGen.kr(Env.linen(1, 2, 1), doneAction = freeSelf)
      Logger.kr(b.id, z, Impulse.kr(49), reset = 0)
    }
    
    // after synth has completed:
    b.getData(num = 100).foreach(_.plot())
    
    x.free(); b.free()
    Note

    The argument order is different from its sclang counterpart.

    See also

    ListTrig

  10. object VBAP extends Serializable

    Permalink

    A UGen for Vector Base Amplitude Panning (VBAP).

    A UGen for Vector Base Amplitude Panning (VBAP). This allows for equal power panning of a source over an arbitrary array of equidistant speakers. Normally this would be a ring, a dome, or partial dome.

    VBAP was created by Ville Pulkki. For more information on VBAP see http://www.acoustics.hut.fi/research/cat/vbap/ This version of VBAP for SC was ported from the ver. 0.99 PD code by Scott Wilson.

    Examples
    // two-dimensional
    val a = VBAPSetup(2, Seq(0, 45, 90, 135, 180, -135, -90, -45)) // 8 channel ring
    
    val b = Buffer.alloc(s, a.bufferData.size)
    b.setn(a.bufferData)
    
    val x = play {
      val azi = "azi".kr(0)
      val ele = "ele".kr(0)
      val spr = "spr".kr(0)
      VBAP.ar(8, PinkNoise.ar(0.2), b.id, azi, ele, spr)
    }
    
    // test them out
    x.set("azi" -> a.directions(1).azi)
    x.set("azi" -> a.directions(2).azi)
    x.set("azi" -> a.directions(3).azi)
    // ...
    x.set("azi" -> a.directions(7).azi)
    x.set("azi" -> a.directions(0).azi)
    
    // try the spread
    x.set("spr" ->  20)
    x.set("spr" -> 100) // all speakers
    
    x.free(); b.free();
    See also

    CircleRamp

  11. object VBAPSetup

    Permalink

Ungrouped