com.softsynth.jsyn
Class SynthChannelData
java.lang.Object
java.util.Observable
com.softsynth.jsyn.SynthObject
com.softsynth.jsyn.SynthChannelData
- Direct Known Subclasses:
- SynthEnvelope, SynthSample
public class SynthChannelData
- extends SynthObject
The SynthChannelData class is a container for digital audio data. The actual data may need to reside in memory that is accessible to
DMA or to a DSP so we cannot assume that it is in main memory. We also need to maintain cache coherence if the data is
going to be read or written by hardware other than the CPU. For this reason, Envelopes cannot use memory allocated by, or
accessable to the application.
- Version:
- JSyn Version 005
- Author:
- (C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
- See Also:
Synth
,
SynthSample
,
SynthEnvelope
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 |
cuePoints
public java.util.Vector cuePoints
SynthChannelData
public SynthChannelData()
SynthChannelData
public SynthChannelData(int maxFrames)
SynthChannelData
public SynthChannelData(SynthContext synthContext,
int maxFrames)
getNumFrames
public int getNumFrames()
- Returns:
- Current number of frames of data.
getMaxFrames
public int getMaxFrames()
- Returns:
- Maximum number of frames of data.
setNumFrames
public void setNumFrames(int numFrames)
- Set number of frames of data.
Input will be clipped to maxFrames.
This is useful when changing the contents of a sample or envelope.
setSustainLoop
public void setSustainLoop(int startFrame,
int endFrame)
- Set location of Sustain Loop in units of Frames. Set SustainBegin to -1 if no Sustain Loop.
SustainEnd value is the frame index of the frame just past the end of the loop.
The number of frames included in the loop is (SustainEnd - SustainBegin).
getSustainBegin
public int getSustainBegin()
- Returns:
- Beginning of sustain loop or -1 if no loop.
getSustainEnd
public int getSustainEnd()
- Returns:
- End of sustain loop or -1 if no loop.
getSustainSize
public int getSustainSize()
- Returns:
- Size of sustain loop in frames, 0 if no loop.
setReleaseLoop
public void setReleaseLoop(int startFrame,
int endFrame)
- Set location of Release Loop in units of Frames. Set ReleaseBegin to -1 if no ReleaseLoop.
ReleaseEnd value is the frame index of the frame just past the end of the loop.
The number of frames included in the loop is (ReleaseEnd - ReleaseBegin).
Why would anyone use a Release Loop?
Imagine that you want to build a circuit with a complex LFO type filter
modulation that starts when a "note" is released and continues as the sound
dies away. To do this, hook a regular envelope with no release loop up to the
circuit's amplitude. Then hook another envelope with a release loop up to the circuit's
filter cutoff. Also put a sustain point or loop before it so that it doesn't
modulate before the note off occurs. Then when you call queueOff() for the
two envelopes the sound will fade away because of the first envelope, while
being complex modulated by the second envelope with the release loop.
getReleaseBegin
public int getReleaseBegin()
- Returns:
- Beginning of release loop or -1 if no loop.
getReleaseEnd
public int getReleaseEnd()
- Returns:
- End of release loop or -1 if no loop.
getReleaseSize
public int getReleaseSize()
- Returns:
- Size of release loop in frames, 0 if no loop.
insertSortedCue
public void insertSortedCue(CuePoint cuePoint)
findCuePoint
public CuePoint findCuePoint(int uniqueID)
findCuePosition
public int findCuePosition(int uniqueID)
- FIXME - document findCuePosition(), add query for numCues, or add Iterater