de.sciss.synth.ugen

PartConv

object PartConv extends Serializable

A UGen for partitioned convolution. Its advantage over non-partitioning UGens such as Convolution2 is that the impulse response can be arbitrarily large amortization is used to spread processing and avoid CPU spikes.

The impulse response buffer must be specially prepared, using a /b_gen command that transforms an existing regularly formatted buffer to a new partitioned convolution ready buffer.

Examples
// Dan Stowell's reverb
// synthesize impulse response
val ir = (1f +: Vector.fill(100)(0f)) ++ (1f to 0f by -0.00002f).map { f =>
  if (math.random < 0.5)
    0f
  else
    f.pow(8) * (math.random - 0.5).signum * 0.1f
}

// ir.plot()

// send the IR to a regular buffer
val irBuf = Buffer(s)
irBuf.alloc(ir.size)
irBuf.setData(ir)

// calculate the partitioning parameters
val fftSize  = 2048
val numPart  = (ir.size * 2.0 / fftSize).ceil.toInt  // 49
val partSize = fftSize * numPart  // 100352

// create the specially formatted partitioned buffer
val partBuf  = Buffer(s)
partBuf.alloc(partSize)
// currently no predefined method for this command!
s ! osc.Message("/b_gen", partBuf.id, "PreparePartConv", irBuf.id, fftSize)

// now we can forget about the input buffer
irBuf.free()

val x = play {
  // trigger IR every 4 seconds
  val in = Impulse.ar(0.25) * 0.5
  PartConv.ar(in, fftSize, partBuf.id)
}

// do not forget to free the buffer eventually
x.free(); partBuf.free()
See also

Convolution2

Convolution

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PartConv
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def ar(in: GE, fftSize: GE, buf: GE): PartConv

    in

    the realtime input to be convolved

    fftSize

    FFT size which is twice the input signal partition size. This must be a multiple of the control-block size, and there must be at least two blocks per partition (to allow for amortization)

    buf

    buffer identifier for the fixed kernel (init-time only).

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  19. def toString(): String

    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped