com.softsynth.jsyn
Class SynthSound

java.lang.Object
  extended by java.util.Observable
      extended by com.softsynth.jsyn.SynthObject
          extended by com.softsynth.jsyn.SynthSound
Direct Known Subclasses:
SynthCircuit, SynthUnit

public class SynthSound
extends SynthObject

SynthSound is an interface that is used for the elemental SynthSounds or for collections of units called SynthCircuits

Version:
JSyn Version 005
Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
Synth, SynthChannelData

Constructor Summary
SynthSound()
           
SynthSound(SynthContext synthContext)
           
 
Method Summary
 void addPort(SynthPort port)
           
 void addPort(SynthPort port, java.lang.String alias)
          Add a port to a vector that contains all ports for a sound.
 SynthPort findNamedPort(java.lang.String name)
           
 java.lang.String getName()
          Returns name.
 int getNumPorts()
           
 SynthPort getPortAt(int index)
           
 int getPriority()
          Get the priority of a sound.
 void setPriority(int priority)
          Set the priority of a unit.
 void setStage(int stage)
           
 void setStage(int time, int stage)
          Set stage of multi-stage sound.
 void start()
          Start execution of this instrument immediately.
 void start(int time)
          Start execution of this instrument by the synthesis process at the specified time in ticks.
 void stop()
          Stop execution of this instrument immediately.
 void stop(int time)
          Stop execution of this instrument by the synthesis process at the specified time in ticks.
 
Methods inherited from class com.softsynth.jsyn.SynthObject
delete, deleteAll, enableDeletionByGarbageCollector, enableTracking, getPeer, getSynthContext, isTrackingEnabled, toString, track
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynthSound

public SynthSound()

SynthSound

public SynthSound(SynthContext synthContext)
Method Detail

addPort

public void addPort(SynthPort port,
                    java.lang.String alias)
Add a port to a vector that contains all ports for a sound. The vector can be used by inspectors, and automated sound editors.


addPort

public void addPort(SynthPort port)

getNumPorts

public int getNumPorts()
Returns:
Number of ports belonging to this sound.

getPortAt

public SynthPort getPortAt(int index)
Returns:
indexed SynthPort belonging to this sound.

findNamedPort

public SynthPort findNamedPort(java.lang.String name)
Returns:
named SynthPort belonging to this sound.

start

public void start(int time)
           throws SynthException
Start execution of this instrument by the synthesis process at the specified time in ticks. If we are already past that time then start immediately. When a unit is started, it begins consuming CPU cycles. If you run out of CPU cycles, then you should stop() units that no longer need to run.

Throws:
SynthException - If peer is invalid.

start

public void start()
           throws SynthException
Start execution of this instrument immediately.

Throws:
SynthException - If peer is invalid.

stop

public void stop(int time)
          throws SynthException
Stop execution of this instrument by the synthesis process at the specified time in ticks. If we are already past that time then stop immediately. When a unit is stopped, it no longer consumes CPU cycles.

Throws:
SynthException - If token is invalid.

stop

public void stop()
          throws SynthException
Stop execution of this instrument immediately.

Throws:
SynthException - If token is invalid.

setPriority

public void setPriority(int priority)
                 throws SynthException
Set the priority of a unit. High priority units will execute before lower priority units.

Throws:
SynthException - If priority is out of range..

getPriority

public int getPriority()
                throws SynthException
Get the priority of a sound.

Throws:
SynthException - If unit token is invalid.

setStage

public void setStage(int time,
                     int stage)
              throws SynthException
Set stage of multi-stage sound. Typically noteOn will be stage 0, off will be 1.

Throws:
SynthException - If an error occurs.

setStage

public void setStage(int stage)
              throws SynthException
Throws:
SynthException

getName

public java.lang.String getName()
Returns name.