com.cycling74.msp
Class MSPSignal

java.lang.Object
  extended by com.cycling74.msp.MSPSignal

public class MSPSignal
extends java.lang.Object

MSPSignal is the Java object representation of the sample vector used by MSP processing data at audio rate. It also contains meta data about the current MSP siganl processing context as well


Field Summary
 short cc
          In your dsp and perform routines you are passed an array of MSPSiganl instances corresponding to the SIGNAL inlets and outlets you declared in your constructor.
 boolean connected
          In your dsp and perform routines you are passed an array of MSPSiganl instances corresponding to the SIGNAL inlets and outlets you declared in your constructor.
 int n
          Size of sample vectors in the current MSP dsp context.This is currently equivalent to vec.length.
 double sr
          Sampling rate of the current MSP dsp context.
 float[] vec
          The current vector sample data.
 
Constructor Summary
MSPSignal(float[] vec_, double sr_, int n_, short cc_)
          Constructor for creating your own MSPSignal instances.
 
Method Summary
 MSPSignal alias()
          Return a unique instance of this MSPSignal pointing to the same sample vector and having identical sample rate, vector size, connection count etc.
 MSPSignal dup()
          Return an exact and unique copy of this instance of MSPSignal.
 MSPSignal dupclean()
          Return an exact and unique copy of this instance of MSPSignal with a zeroed out sample vector.
 java.lang.String toString()
          Get a printable representation of this MSPSignal instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vec

public final float[] vec
The current vector sample data.


sr

public double sr
Sampling rate of the current MSP dsp context.


n

public int n
Size of sample vectors in the current MSP dsp context.This is currently equivalent to vec.length.


cc

public short cc
In your dsp and perform routines you are passed an array of MSPSiganl instances corresponding to the SIGNAL inlets and outlets you declared in your constructor. This field contains the number of signals currently connected to that inlet/outlet.


connected

public boolean connected
In your dsp and perform routines you are passed an array of MSPSiganl instances corresponding to the SIGNAL inlets and outlets you declared in your constructor. This field is true if any signals are connected to that inlet/outlet and false if the inlet/outlet has no signal connected to it.

Constructor Detail

MSPSignal

public MSPSignal(float[] vec_,
                 double sr_,
                 int n_,
                 short cc_)
Constructor for creating your own MSPSignal instances. This can be useful when you wish to pass an MSPPerformer or MSPObject sample vectors that you are generating programatically in java or otherwise call MaxObject and MSPPerformer dsp or perform routines in an arbitrary context.

Method Detail

dup

public MSPSignal dup()
Return an exact and unique copy of this instance of MSPSignal.


dupclean

public MSPSignal dupclean()
Return an exact and unique copy of this instance of MSPSignal with a zeroed out sample vector.


alias

public MSPSignal alias()
Return a unique instance of this MSPSignal pointing to the same sample vector and having identical sample rate, vector size, connection count etc.


toString

public java.lang.String toString()
Get a printable representation of this MSPSignal instance.

Overrides:
toString in class java.lang.Object