com.sun.media.sound
Class ModelAbstractOscillator
java.lang.Object
com.sun.media.sound.ModelAbstractOscillator
- All Implemented Interfaces:
- ModelOscillator, ModelOscillatorStream, javax.sound.midi.Soundbank
public abstract class ModelAbstractOscillator
- extends java.lang.Object
- implements ModelOscillator, ModelOscillatorStream, javax.sound.midi.Soundbank
A abstract class used to simplify creating custom ModelOscillator.
- Author:
- Karl Helgason
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModelAbstractOscillator
public ModelAbstractOscillator()
init
public void init()
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface ModelOscillatorStream
- Throws:
java.io.IOException
noteOff
public void noteOff(int velocity)
- Specified by:
noteOff
in interface ModelOscillatorStream
noteOn
public void noteOn(javax.sound.midi.MidiChannel channel,
javax.sound.midi.VoiceStatus voice,
int noteNumber,
int velocity)
- Specified by:
noteOn
in interface ModelOscillatorStream
read
public int read(float[][] buffer,
int offset,
int len)
throws java.io.IOException
- Specified by:
read
in interface ModelOscillatorStream
- Throws:
java.io.IOException
getChannel
public javax.sound.midi.MidiChannel getChannel()
getVoice
public javax.sound.midi.VoiceStatus getVoice()
getNoteNumber
public int getNoteNumber()
getVelocity
public int getVelocity()
isOn
public boolean isOn()
setPitch
public void setPitch(float pitch)
- Specified by:
setPitch
in interface ModelOscillatorStream
getPitch
public float getPitch()
setSampleRate
public void setSampleRate(float samplerate)
getSampleRate
public float getSampleRate()
getAttenuation
public float getAttenuation()
- Description copied from interface:
ModelOscillator
- Attenuation is in cB.
- Specified by:
getAttenuation
in interface ModelOscillator
- Returns:
getChannels
public int getChannels()
- Specified by:
getChannels
in interface ModelOscillator
getName
public java.lang.String getName()
- Specified by:
getName
in interface javax.sound.midi.Soundbank
getPatch
public javax.sound.midi.Patch getPatch()
open
public ModelOscillatorStream open(float samplerate)
- Specified by:
open
in interface ModelOscillator
getPerformer
public ModelPerformer getPerformer()
getInstrument
public ModelInstrument getInstrument()
getSoundBank
public javax.sound.midi.Soundbank getSoundBank()
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interface javax.sound.midi.Soundbank
getInstrument
public javax.sound.midi.Instrument getInstrument(javax.sound.midi.Patch patch)
- Specified by:
getInstrument
in interface javax.sound.midi.Soundbank
getInstruments
public javax.sound.midi.Instrument[] getInstruments()
- Specified by:
getInstruments
in interface javax.sound.midi.Soundbank
getResources
public javax.sound.midi.SoundbankResource[] getResources()
- Specified by:
getResources
in interface javax.sound.midi.Soundbank
getVendor
public java.lang.String getVendor()
- Specified by:
getVendor
in interface javax.sound.midi.Soundbank
getVersion
public java.lang.String getVersion()
- Specified by:
getVersion
in interface javax.sound.midi.Soundbank