jass.patches
Class LowPassComb

java.lang.Object
  extended by jass.engine.Out
      extended by jass.engine.InOut
          extended by jass.patches.LowPassComb
All Implemented Interfaces:
Sink, Source

public class LowPassComb
extends InOut

Delay line with a one pole low-pass. Used in Moorers reverb. See e.g.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
protected  float del
           
protected  Delay delay
           
protected  float g
           
protected  OnePoleLowPass lowpass
           
protected  Mixer mixer
           
protected  float R
           
protected  float srate
           
 
Fields inherited from class jass.engine.InOut
sourceContainer, sourcePassivity, srcBuffers
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
LowPassComb(int bufferSize)
          Create.
LowPassComb(int bufferSize, float srate)
          Create.
 
Method Summary
 java.lang.Object addSource(Source s)
          Add source to Sink.
protected  void computeBuffer()
          Compute the next buffer and store in member float[] buf.
protected  void init()
          Init and allocate.
 void setG(float g)
          Set low-pass parameter g.
 void setL(float del)
          Set delay del.
 void setR(float R)
          Set feedback R.
 
Methods inherited from class jass.engine.InOut
addSource, getBuffer, getSources, removeSource, resetTime
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srate

protected float srate

R

protected float R

g

protected float g

del

protected float del

mixer

protected Mixer mixer

delay

protected Delay delay

lowpass

protected OnePoleLowPass lowpass
Constructor Detail

LowPassComb

public LowPassComb(int bufferSize)
Create. For derived classes.

Parameters:
bufferSize - Buffer size used for real-time rendering.

LowPassComb

public LowPassComb(int bufferSize,
                   float srate)
Create. For derived classes.

Parameters:
bufferSize - Buffer size used for real-time rendering.
srate - sampling rate in Hz
Method Detail

init

protected void init()
Init and allocate.


addSource

public java.lang.Object addSource(Source s)
                           throws SinkIsFullException
Add source to Sink. Override to allow one input only and add to mixer

Specified by:
addSource in interface Sink
Overrides:
addSource in class InOut
Parameters:
s - Source to add.
Returns:
object representing Source in Sink (may be null).
Throws:
SinkIsFullException

setL

public void setL(float del)
          throws java.lang.IllegalArgumentException
Set delay del. (=L/srate)

Parameters:
del - delay in seconds
Throws:
java.lang.IllegalArgumentException

setR

public void setR(float R)
Set feedback R.

Parameters:
R - feedback

setG

public void setG(float g)
Set low-pass parameter g.

Parameters:
g - low-pass parameter g.

computeBuffer

protected void computeBuffer()
Compute the next buffer and store in member float[] buf.

Specified by:
computeBuffer in class Out