com.jsyn.unitgen
Class FilterStateVariable

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.UnitFilter
          extended by com.jsyn.unitgen.TunableFilter
              extended by com.jsyn.unitgen.FilterStateVariable
All Implemented Interfaces:
UnitSink, UnitSource

public class FilterStateVariable
extends TunableFilter

Create a "State Variable Filter" based on the filter described in Hal Chamberlain's "Musical Applications of MicroProcessors". It is convenient because its frequency and resonance can each be controlled by a single value. The "output" port of this filter is the "lowPass" output multiplied by the "amplitude"

See Also:
FilterLowPass, FilterHighPass

Field Summary
 UnitInputPort amplitude
          Amplitude of Output in the range of 0.0 to 1.0.
 UnitOutputPort bandPass
          Band pass filtered signal.
 UnitOutputPort highPass
          High pass filtered signal.
 UnitOutputPort lowPass
          Low pass filtered signal.
 UnitInputPort resonance
          Controls feedback that causes self oscillation.
 
Fields inherited from class com.jsyn.unitgen.TunableFilter
frequency
 
Fields inherited from class com.jsyn.unitgen.UnitFilter
input, output
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
FilterStateVariable()
          No-argument constructor instantiates the Biquad common and adds an amplitude port to this filter.
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 
Methods inherited from class com.jsyn.unitgen.UnitFilter
getInput, getOutput
 
Methods inherited from class com.jsyn.unitgen.UnitGenerator
addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, isEnabled, pullData, setCircuit, setFrameRate, setSynthesisEngine, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amplitude

public UnitInputPort amplitude
Amplitude of Output in the range of 0.0 to 1.0. SIGNAL_TYPE_RAW_SIGNED Defaults to 1.0

Note that the amplitude only affects the "output" port and not the lowPass, bandPass or highPass signals. Use a MultiplyUnit if you need to scale those signals.


resonance

public UnitInputPort resonance
Controls feedback that causes self oscillation. Actually 1/Q - SIGNAL_TYPE_RAW_SIGNED in the range of 0.0 to 1.0. Defaults to 0.125.


lowPass

public UnitOutputPort lowPass
Low pass filtered signal.

Note that this signal is not affected by the amplitude port.


bandPass

public UnitOutputPort bandPass
Band pass filtered signal.

Note that this signal is not affected by the amplitude port.


highPass

public UnitOutputPort highPass
High pass filtered signal.

Note that this signal is not affected by the amplitude port.

Constructor Detail

FilterStateVariable

public FilterStateVariable()
No-argument constructor instantiates the Biquad common and adds an amplitude port to this filter.

Method Detail

generate

public void generate(int start,
                     int limit)
Description copied from class: UnitGenerator
Perform essential synthesis function.

Specified by:
generate in class UnitGenerator
Parameters:
start - offset into port buffers
limit - limit offset into port buffers for loop