com.frinika.synth.synths.sampler
Class SamplerOscillator

java.lang.Object
  extended by com.frinika.voiceserver.Voice
      extended by com.frinika.synth.Oscillator
          extended by com.frinika.synth.synths.sampler.SamplerOscillator

public class SamplerOscillator
extends Oscillator

Sampler class. Use for capturing inputs and for direct monitoring.

Author:
Peter Johan Salomonsen

Field Summary
 
Fields inherited from class com.frinika.synth.Oscillator
frequency, increment, level, position, release, sampleRate, synth, triggeredRelease
 
Fields inherited from class com.frinika.voiceserver.Voice
interrupts, nextVoice, startFramePos
 
Constructor Summary
SamplerOscillator(Synth synth)
           
 
Method Summary
 int available()
           
 void fillBuffer(int startBufferPos, int endBufferPos, float[] buffer)
          This is where the raw audio data should be produced.
 boolean isMonitoring()
           
 boolean isRecording()
           
 void setRecordProgressListener(RecordProgressListener recordProgressListener)
           
 void startMonitor(javax.sound.sampled.TargetDataLine lineIn, boolean stereo)
           
 void startRecording()
          Start recording
 void stopMonitor()
           
 short[][] stopRecording()
          Stop recording
 
Methods inherited from class com.frinika.synth.Oscillator
getFrequency, release, setNoteNumber, setVelocity, updateIncrement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplerOscillator

public SamplerOscillator(Synth synth)
Parameters:
synth -
Method Detail

startMonitor

public void startMonitor(javax.sound.sampled.TargetDataLine lineIn,
                         boolean stereo)
                  throws java.lang.Exception
Throws:
java.lang.Exception

stopMonitor

public void stopMonitor()

startRecording

public void startRecording()
Start recording


stopRecording

public short[][] stopRecording()
Stop recording

Returns:

fillBuffer

public void fillBuffer(int startBufferPos,
                       int endBufferPos,
                       float[] buffer)
Description copied from class: Voice
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.

Specified by:
fillBuffer in class Voice

isMonitoring

public boolean isMonitoring()

isRecording

public boolean isRecording()
Returns:

available

public int available()

setRecordProgressListener

public void setRecordProgressListener(RecordProgressListener recordProgressListener)