uk.org.toot.synth
Class PolyphonicSynthChannel

java.lang.Object
  extended by uk.org.toot.synth.SynthChannel
      extended by uk.org.toot.synth.PolyphonicSynthChannel
All Implemented Interfaces:
javax.sound.midi.MidiChannel, AudioProcess, AudioOutput, AudioPort
Direct Known Subclasses:
Example2SynthChannel, Example3SynthChannel

public abstract class PolyphonicSynthChannel
extends SynthChannel
implements AudioOutput

A PolyphonicSynthChannel is a SynthChannel that generates audio as an AudioProcess. It is polyphonic, supporting multiple Voices.

Author:
st

Nested Class Summary
 class PolyphonicSynthChannel.AbstractVoice
           
static interface PolyphonicSynthChannel.Voice
           
 
Field Summary
 
Fields inherited from interface uk.org.toot.audio.core.AudioProcess
AUDIO_DISCONNECT, AUDIO_OK
 
Constructor Summary
PolyphonicSynthChannel(java.lang.String name)
           
 
Method Summary
 void allNotesOff()
           
 void allSoundOff()
           
 void close()
          Close any resources opened by this AudioProcess.
 java.lang.String getLocation()
          Return a unique string representing the location.
 java.lang.String getName()
          Return a unique name for this audio port.
 int getPolyphony()
           
 void noteOff(int pitch)
           
 void noteOn(int pitch, int velocity)
           
 void open()
          Open any resources required by this AudioProcess.
 int processAudio(AudioBuffer buffer)
          Process the supplied buffer
 void setLocation(java.lang.String location)
           
 void setPolyphony(int p)
           
 
Methods inherited from class uk.org.toot.synth.SynthChannel
controlChange, getBendFactor, getChannelPressure, getController, getMono, getMute, getOmni, getPitchBend, getPolyPressure, getProgram, getSolo, localControl, midiFreq, noteOff, programChange, programChange, resetAllControllers, setChannelPressure, setMono, setMute, setOmni, setPitchBend, setPolyPressure, setSolo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolyphonicSynthChannel

public PolyphonicSynthChannel(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: AudioPort
Return a unique name for this audio port. Typically by concatenating the logical, but not necessarily unique, port name with a unique decice name.

Specified by:
getName in interface AudioPort
Returns:
String - a unique port name

setLocation

public void setLocation(java.lang.String location)
Overrides:
setLocation in class SynthChannel

getLocation

public java.lang.String getLocation()
Description copied from interface: AudioOutput
Return a unique string representing the location. e.g. MultiSynth C Channel 2 e.g. Sequencer 17 This should be the same string as used by AudioBuffer.MetaInfo.

Specified by:
getLocation in interface AudioOutput
Returns:
String the location of this AudioOutput

open

public void open()
Description copied from interface: AudioProcess
Open any resources required by this AudioProcess.

Specified by:
open in interface AudioProcess

processAudio

public int processAudio(AudioBuffer buffer)
Description copied from interface: AudioProcess
Process the supplied buffer

Specified by:
processAudio in interface AudioProcess
Parameters:
buffer - the AudioBuffer to process.
Returns:
int AUDIO_OK or AUDIO_DISCONNECT.

close

public void close()
Description copied from interface: AudioProcess
Close any resources opened by this AudioProcess.

Specified by:
close in interface AudioProcess

setPolyphony

public void setPolyphony(int p)

getPolyphony

public int getPolyphony()

noteOn

public void noteOn(int pitch,
                   int velocity)
Specified by:
noteOn in interface javax.sound.midi.MidiChannel
Specified by:
noteOn in class SynthChannel

noteOff

public void noteOff(int pitch)
Specified by:
noteOff in interface javax.sound.midi.MidiChannel
Specified by:
noteOff in class SynthChannel

allNotesOff

public void allNotesOff()
Specified by:
allNotesOff in interface javax.sound.midi.MidiChannel
Specified by:
allNotesOff in class SynthChannel

allSoundOff

public void allSoundOff()
Specified by:
allSoundOff in interface javax.sound.midi.MidiChannel
Specified by:
allSoundOff in class SynthChannel


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.