com.frinika.voiceserver
Class Voice

java.lang.Object
  extended by com.frinika.voiceserver.Voice
Direct Known Subclasses:
MasterVoice, Oscillator, SynchronizedVoice, SyncVoice

public abstract class Voice
extends java.lang.Object

Voice base class. A voice is producing raw audio data by filling floats into the buffer passed each time fillBuffer is called.

Author:
Peter Johan Salomonsen

Field Summary
 java.util.Vector<VoiceInterrupt> interrupts
           
 Voice nextVoice
          For process ordering you'll set nextVoice to be the voice to be processed after this voice.
 long startFramePos
           
 
Constructor Summary
Voice()
           
 
Method Summary
abstract  void fillBuffer(int startBufferPos, int endBufferPos, float[] buffer)
          This is where the raw audio data should be produced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startFramePos

public long startFramePos

nextVoice

public Voice nextVoice
For process ordering you'll set nextVoice to be the voice to be processed after this voice. If you want the next voice to do effect processing on this voice only, you should use a separate buffer, and let nextVoice add this buffer to the main buffer when processed.


interrupts

public java.util.Vector<VoiceInterrupt> interrupts
Constructor Detail

Voice

public Voice()
Method Detail

fillBuffer

public abstract void fillBuffer(int startBufferPos,
                                int endBufferPos,
                                float[] buffer)
This is where the raw audio data should be produced. The passed in buffer contains the audio data from the previous voice in the chain, thus new data should just be added to the buffer. It's important to just fill within the start and stop positions, because this is how the interrupt functions control that parameter modification occur at the right place.

Parameters:
startBufferPos -
endBufferPos -
buffer -