Packages

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

Convolution

Convolution2

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
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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) (init-time only)

    buf

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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped