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
- Alphabetic
- By Inheritance
- PartConv
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )