de.sciss.jcollider
Class Synth

java.lang.Object
  extended by de.sciss.jcollider.Node
      extended by de.sciss.jcollider.Synth
All Implemented Interfaces:
Constants, javax.swing.tree.TreeNode

public class Synth
extends Node

Mimics SCLang's Synth class, that is, it's a client side representation of a synth in the synthesis graph

Version:
0.33, 12-Jul-08
Author:
Hanns Holger Rutz
Warning:
this is a quick direct translation from SClang which is largely untested. before all methods have been thoroughly verified, excepted some of them to be wrong or behave different than expected. what certainly works is instantiation and new-messages

Field Summary
 
Fields inherited from interface de.sciss.jcollider.Constants
kAddAfter, kAddBefore, kAddReplace, kAddToHead, kAddToTail, kAudioRate, kControlRate, kDemandRate, kDoneFree, kDoneFreeAll, kDoneFreeAllPred, kDoneFreeAllSucc, kDoneFreeGroup, kDoneFreePausePred, kDoneFreePauseSucc, kDoneFreePred, kDoneFreePredGroup, kDoneFreePredGroupDeep, kDoneFreeSucc, kDoneFreeSuccGroup, kDoneFreeSuccGroupDeep, kDoneNothing, kDonePause, kDumpBoth, kDumpHex, kDumpOff, kDumpText, kHeaderAIFF, kHeaderIRCAM, kHeaderNeXT, kHeaderRaw, kHeaderWAVE, kSampleALaw, kSampleDouble, kSampleFloat, kSampleInt16, kSampleInt24, kSampleInt32, kSampleInt8, kSampleMuLaw, kScalarRate
 
Constructor Summary
Synth(java.lang.String defName, Node target)
           
Synth(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target)
           
Synth(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target, int addAction)
           
 
Method Summary
 de.sciss.net.OSCMessage addAfterMsg(Node aNode, java.lang.String[] argNames, float[] argValues)
           
 de.sciss.net.OSCMessage addBeforeMsg(Node aNode, java.lang.String[] argNames, float[] argValues)
           
 de.sciss.net.OSCMessage addReplaceMsg(Node aNode, java.lang.String[] argNames, float[] argValues)
           
 de.sciss.net.OSCMessage addToHeadMsg(Group aGroup, java.lang.String[] argNames, float[] argValues)
           
 de.sciss.net.OSCMessage addToTailMsg(Group aGroup, java.lang.String[] argNames, float[] argValues)
           
static Synth after(Node aNode, java.lang.String defName)
           
static Synth after(Node aNode, java.lang.String defName, java.lang.String[] argNames, float[] argValues)
           
static Synth basicNew(java.lang.String defName, Server server)
           
static Synth basicNew(java.lang.String defName, Server server, int nodeID)
           
static Synth before(Node aNode, java.lang.String defName)
           
static Synth before(Node aNode, java.lang.String defName, java.lang.String[] argNames, float[] argValues)
           
 java.util.Enumeration children()
           
 float get(int index)
          Queries the current value of a synth control.
 float[] get(int[] indices)
          Queries different current values of a synth control.
 float get(java.lang.String name)
          Queries the current value of a synth control.
 float[] get(java.lang.String[] names)
          Queries different current values of a synth control.
 boolean getAllowsChildren()
           
 javax.swing.tree.TreeNode getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getDefName()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 de.sciss.net.OSCMessage getMsg(int index)
           
 de.sciss.net.OSCMessage getMsg(int[] indices)
           
 de.sciss.net.OSCMessage getMsg(java.lang.String name)
           
 de.sciss.net.OSCMessage getMsg(java.lang.String[] names)
           
 float[] getn(int[] indices, int[] counts)
          Queries different ranges of current values of the synth's controls.
 float[] getn(int index, int count)
          Queries a range of current values of the synth's controls.
 float[] getn(java.lang.String[] names, int[] counts)
          Queries different ranges of current values of the synth's controls.
 float[] getn(java.lang.String name, int count)
          Queries a range of current values of the synth's controls.
 de.sciss.net.OSCMessage getnMsg(int[] indices, int[] counts)
           
 de.sciss.net.OSCMessage getnMsg(int index, int count)
           
 de.sciss.net.OSCMessage getnMsg(java.lang.String[] names, int[] counts)
           
 de.sciss.net.OSCMessage getnMsg(java.lang.String name, int count)
           
static void grain(java.lang.String defName, Node target)
           
static void grain(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target)
           
static void grain(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target, int addAction)
           
static Synth head(Group aGroup, java.lang.String defName)
           
static Synth head(Node aGroup, java.lang.String defName, java.lang.String[] argNames, float[] argValues)
           
 boolean isLeaf()
           
 de.sciss.net.OSCMessage newMsg()
           
 de.sciss.net.OSCMessage newMsg(Node target)
           
 de.sciss.net.OSCMessage newMsg(Node target, java.lang.String[] argNames, float[] argValues)
           
 de.sciss.net.OSCMessage newMsg(Node target, java.lang.String[] argNames, float[] argValues, int addAction)
           
static Synth newPaused(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target)
           
static Synth newPaused(java.lang.String defName, java.lang.String[] argNames, float[] argValues, Node target, int addAction)
           
static Synth replace(Node nodeToReplace, java.lang.String defName)
           
static Synth replace(Node nodeToReplace, java.lang.String defName, java.lang.String[] argNames, float[] argValues)
           
static Synth tail(Group aGroup, java.lang.String defName)
           
static Synth tail(Node aGroup, java.lang.String defName, java.lang.String[] argNames, float[] argValues)
           
 java.lang.String toString()
           
 
Methods inherited from class de.sciss.jcollider.Node
equals, fill, fill, fillMsg, fillMsg, free, freeMsg, getGroup, getName, getNodeID, getParent, getPredNode, getServer, getSuccNode, hashCode, isPlaying, isRunning, map, map, map, map, map, mapMsg, mapMsg, mapMsg, mapMsg, mapMsg, mapn, mapn, mapn, mapn, mapnMsg, mapnMsg, mapnMsg, mapnMsg, moveAfter, moveAfterMsg, moveBefore, moveBeforeMsg, moveToHead, moveToHeadMsg, moveToTail, moveToTailMsg, printOn, query, query, queryMsg, register, register, release, release, releaseMsg, releaseMsg, run, run, runMsg, runMsg, set, set, set, set, setGroup, setMsg, setMsg, setMsg, setMsg, setn, setn, setName, setnMsg, setnMsg, setPlaying, setPredNode, setRunning, setSuccNode, trace, traceMsg
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Synth

public Synth(java.lang.String defName,
             Node target)
      throws java.io.IOException
Throws:
java.io.IOException

Synth

public Synth(java.lang.String defName,
             java.lang.String[] argNames,
             float[] argValues,
             Node target)
      throws java.io.IOException
Throws:
java.io.IOException

Synth

public Synth(java.lang.String defName,
             java.lang.String[] argNames,
             float[] argValues,
             Node target,
             int addAction)
      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

grain

public static void grain(java.lang.String defName,
                         Node target)
                  throws java.io.IOException
Throws:
java.io.IOException

grain

public static void grain(java.lang.String defName,
                         java.lang.String[] argNames,
                         float[] argValues,
                         Node target)
                  throws java.io.IOException
Throws:
java.io.IOException

grain

public static void grain(java.lang.String defName,
                         java.lang.String[] argNames,
                         float[] argValues,
                         Node target,
                         int addAction)
                  throws java.io.IOException
Throws:
java.io.IOException

getDefName

public java.lang.String getDefName()

newMsg

public de.sciss.net.OSCMessage newMsg()

newMsg

public de.sciss.net.OSCMessage newMsg(Node target)

newMsg

public de.sciss.net.OSCMessage newMsg(Node target,
                                      java.lang.String[] argNames,
                                      float[] argValues)

newMsg

public de.sciss.net.OSCMessage newMsg(Node target,
                                      java.lang.String[] argNames,
                                      float[] argValues,
                                      int addAction)

newPaused

public static Synth newPaused(java.lang.String defName,
                              java.lang.String[] argNames,
                              float[] argValues,
                              Node target)
                       throws java.io.IOException
Throws:
java.io.IOException

newPaused

public static Synth newPaused(java.lang.String defName,
                              java.lang.String[] argNames,
                              float[] argValues,
                              Node target,
                              int addAction)
                       throws java.io.IOException
Throws:
java.io.IOException

basicNew

public static Synth basicNew(java.lang.String defName,
                             Server server)

basicNew

public static Synth basicNew(java.lang.String defName,
                             Server server,
                             int nodeID)

after

public static Synth after(Node aNode,
                          java.lang.String defName)
                   throws java.io.IOException
Throws:
java.io.IOException

after

public static Synth after(Node aNode,
                          java.lang.String defName,
                          java.lang.String[] argNames,
                          float[] argValues)
                   throws java.io.IOException
Throws:
java.io.IOException

before

public static Synth before(Node aNode,
                           java.lang.String defName)
                    throws java.io.IOException
Throws:
java.io.IOException

before

public static Synth before(Node aNode,
                           java.lang.String defName,
                           java.lang.String[] argNames,
                           float[] argValues)
                    throws java.io.IOException
Throws:
java.io.IOException

head

public static Synth head(Group aGroup,
                         java.lang.String defName)
                  throws java.io.IOException
Throws:
java.io.IOException

head

public static Synth head(Node aGroup,
                         java.lang.String defName,
                         java.lang.String[] argNames,
                         float[] argValues)
                  throws java.io.IOException
Throws:
java.io.IOException

tail

public static Synth tail(Group aGroup,
                         java.lang.String defName)
                  throws java.io.IOException
Throws:
java.io.IOException

tail

public static Synth tail(Node aGroup,
                         java.lang.String defName,
                         java.lang.String[] argNames,
                         float[] argValues)
                  throws java.io.IOException
Throws:
java.io.IOException

replace

public static Synth replace(Node nodeToReplace,
                            java.lang.String defName)
                     throws java.io.IOException
Throws:
java.io.IOException

replace

public static Synth replace(Node nodeToReplace,
                            java.lang.String defName,
                            java.lang.String[] argNames,
                            float[] argValues)
                     throws java.io.IOException
Throws:
java.io.IOException

addToHeadMsg

public de.sciss.net.OSCMessage addToHeadMsg(Group aGroup,
                                            java.lang.String[] argNames,
                                            float[] argValues)

addToTailMsg

public de.sciss.net.OSCMessage addToTailMsg(Group aGroup,
                                            java.lang.String[] argNames,
                                            float[] argValues)

addAfterMsg

public de.sciss.net.OSCMessage addAfterMsg(Node aNode,
                                           java.lang.String[] argNames,
                                           float[] argValues)

addBeforeMsg

public de.sciss.net.OSCMessage addBeforeMsg(Node aNode,
                                            java.lang.String[] argNames,
                                            float[] argValues)

addReplaceMsg

public de.sciss.net.OSCMessage addReplaceMsg(Node aNode,
                                             java.lang.String[] argNames,
                                             float[] argValues)

get

public float get(int index)
          throws java.io.IOException
Queries the current value of a synth control.

Parameters:
index - the index of the control to query
Returns:
the curresponding control value
Throws:
java.io.IOException - when an error occurs sending the message, or when a timeout or failure occurs with scsynth processing the message

get

public float[] get(int[] indices)
            throws java.io.IOException
Queries different current values of a synth control.

Parameters:
indices - the indices of the controls to query
Returns:
the curresponding control values, or null if a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

get

public float get(java.lang.String name)
          throws java.io.IOException
Queries the current value of a synth control.

Parameters:
name - the name of the control to query
Returns:
the curresponding control value
Throws:
java.io.IOException - when an error occurs sending the message, or when a timeout or failure occurs with scsynth processing the message

get

public float[] get(java.lang.String[] names)
            throws java.io.IOException
Queries different current values of a synth control.

Parameters:
names - the names of the controls to query
Returns:
the curresponding control values, or null if a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

getMsg

public de.sciss.net.OSCMessage getMsg(int index)

getMsg

public de.sciss.net.OSCMessage getMsg(int[] indices)

getMsg

public de.sciss.net.OSCMessage getMsg(java.lang.String name)

getMsg

public de.sciss.net.OSCMessage getMsg(java.lang.String[] names)

getn

public float[] getn(int index,
                    int count)
             throws java.io.IOException
Queries a range of current values of the synth's controls.

Parameters:
index - the start index of the controls to query
count - the number of successive controls to query
Returns:
the curresponding control values or null, when a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

getn

public float[] getn(java.lang.String name,
                    int count)
             throws java.io.IOException
Queries a range of current values of the synth's controls.

Parameters:
name - the name of the first control to query
count - the number of successive controls to query
Returns:
the curresponding control values or null, when a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

getn

public float[] getn(int[] indices,
                    int[] counts)
             throws java.io.IOException
Queries different ranges of current values of the synth's controls.

Parameters:
indices - the start indices of the controls to query
counts - for each start index, the number of successive controls to query
Returns:
the curresponding control values, or null if a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

getn

public float[] getn(java.lang.String[] names,
                    int[] counts)
             throws java.io.IOException
Queries different ranges of current values of the synth's controls.

Parameters:
names - the start names of the controls to query
counts - for each start name, the number of successive controls to query
Returns:
the curresponding control values, or null if a timeout or failure occurs with scsynth processing the message
Throws:
java.io.IOException - when an error occurs sending the message

getnMsg

public de.sciss.net.OSCMessage getnMsg(int index,
                                       int count)

getnMsg

public de.sciss.net.OSCMessage getnMsg(int[] indices,
                                       int[] counts)

getnMsg

public de.sciss.net.OSCMessage getnMsg(java.lang.String name,
                                       int count)

getnMsg

public de.sciss.net.OSCMessage getnMsg(java.lang.String[] names,
                                       int[] counts)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)

getChildCount

public int getChildCount()

getIndex

public int getIndex(javax.swing.tree.TreeNode node)

getAllowsChildren

public boolean getAllowsChildren()

isLeaf

public boolean isLeaf()

children

public java.util.Enumeration children()