com.cycling74.msp
Class MSPPerformer

java.lang.Object
  extended by com.cycling74.max.MaxObject
      extended by com.cycling74.msp.MSPObject
          extended by com.cycling74.msp.MSPPerformer
All Implemented Interfaces:
MSPPerformable

public abstract class MSPPerformer
extends MSPObject
implements MSPPerformable

Alternative base class for a Java signal processing object.Subclassing MSPPerformer is somewhat simpler than subclassing MSPObject directly. Subclass this directly or indirectly to create your own Java signal processing objects for use in Max. See the mxj~ examples directory in the java-doc directory of your Max install for more sample code. See also 'WritingMaxExternalsInJava.pdf' for a more detailed discussion about writing Max signal processing classes in Java.


Field Summary
 
Fields inherited from class com.cycling74.msp.MSPObject
MSP_SIGNAL_ARRAY_CLZ, SIGNAL
 
Fields inherited from class com.cycling74.max.MaxObject
EMPTY_STRING_ARRAY, NO_INLETS, NO_OUTLETS
 
Constructor Summary
MSPPerformer()
           
 
Method Summary
 java.lang.reflect.Method dsp(MSPSignal[] in, MSPSignal[] out)
          Since it is abstract, the dsp method must be implemented by your MSPObject subclass.
 void dspsetup(MSPSignal[] sigs_in, MSPSignal[] sigs_out)
          The dspsetup method is called once when the MSP signal compiler is building the dsp chain for the patch which contains your MSPPerformer instance.
abstract  void perform(MSPSignal[] sigs_in, MSPSignal[] sigs_out)
          The perform method is called continuosly as part of the MSP dsp chain to process sample vectors after the dspsetup method is called and until the MSP dsp chain is stopped.This is the workhorse of your signal processing class.
 
Methods inherited from class com.cycling74.msp.MSPObject
dspstate, getPerformMethod, setNoInPlace
 
Methods inherited from class com.cycling74.max.MaxObject
anything, bail, bang, createInfoOutlet, dblclick, declareAttribute, declareAttribute, declareInlets, declareIO, declareOutlets, declareReadOnlyAttribute, declareReadOnlyAttribute, declareTypedIO, embedMessage, error, gc, getAttr, getAttrAtomArray, getAttrBool, getAttrBoolArray, getAttrByte, getAttrByteArray, getAttrChar, getAttrCharArray, getAttrDouble, getAttrDoubleArray, getAttrFloat, getAttrFloatArray, getAttributeInfo, getAttrInt, getAttrIntArray, getAttrLongArray, getAttrShort, getAttrShortArray, getAttrString, getAttrStringArray, getCodeSourcePath, getContext, getErrorStream, getInfoIdx, getInlet, getInletAssist, getInletType, getLongAttr, getMaxBox, getName, getNumInlets, getNumOutlets, getOutletAssist, getOutletType, getParentPatcher, getPostStream, inlet, inlet, list, list, list, loadbang, notifyDeleted, ouch, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outlet, outletBang, outletBangHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, outletHigh, post, postCodePath, save, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setInletAssist, setInletAssist, setName, setOutletAssist, setOutletAssist, showException, showException, toString, viewsource, zap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MSPPerformer

public MSPPerformer()
Method Detail

dsp

public java.lang.reflect.Method dsp(MSPSignal[] in,
                                    MSPSignal[] out)
Description copied from class: MSPObject
Since it is abstract, the dsp method must be implemented by your MSPObject subclass. It provides the mechanism to notify the mxj~ object which class method it should be calling to process sample vectors. The Method object it returns must have the signature:
                private void myPerformMethod(MSPSignal[] inlets, MSPSignal[] outlets)
 
The dsp method is called once when the MSP signal compiler is building the dsp chain for the patch which contains your MSPObject instance. You are passed two arrays of MSPSiganl objects corresponding to the SIGNAL inlets/outlets you declared in your declareInlets/decalreOutlets calls in your constructor. You can interrogate any of these MSPSiganl instances for meta information about the current dsp context including sampling rate, sample vector size etc.

Specified by:
dsp in class MSPObject
Parameters:
in - array of MSPSiganl objects corresponding to the type SIGNAL inlets declared in your constructor.
out - array of MSPSiganl objects corresponding to the type SIGNAL outlets declared in your constructor.
Returns:
instance of java.lang.reflect.Method specifying which method you would like to be called to process samples in the current MSP siganl processing context.
See Also:
com.cycling74.msp

dspsetup

public void dspsetup(MSPSignal[] sigs_in,
                     MSPSignal[] sigs_out)
The dspsetup method is called once when the MSP signal compiler is building the dsp chain for the patch which contains your MSPPerformer instance. You are passed two arrays of MSPSiganl objects corresponding to the SIGNAL inlets/outlets you declared in your declareInlets/decalreOutlets calls in your constructor. You can interrogate any of these MSPSiganl instances for meta information about the current dsp context including sampling rate, sample vector size etc. By default this method does nothing.

Specified by:
dspsetup in interface MSPPerformable
Parameters:
sigs_in - array of MSPSiganl objects corresponding to the type SIGNAL inlets declared in your constructor.
sigs_out - array of MSPSiganl objects corresponding to the type SIGNAL outlets declared in your constructor.
See Also:
com.cycling74.msp

perform

public abstract void perform(MSPSignal[] sigs_in,
                             MSPSignal[] sigs_out)
The perform method is called continuosly as part of the MSP dsp chain to process sample vectors after the dspsetup method is called and until the MSP dsp chain is stopped.This is the workhorse of your signal processing class.

Specified by:
perform in interface MSPPerformable
Parameters:
sigs_in - array of MSPSiganl objects corresponding to the type SIGNAL inlets declared in your constructor.
sigs_out - array of MSPSiganl objects corresponding to the type SIGNAL outlets declared in your constructor.