public abstract class

ModelAbstractOscillator

extends Object
implements ModelOscillator ModelOscillatorStream Soundbank
java.lang.Object
   ↳ com.sun.media.sound.ModelAbstractOscillator

Class Overview

A abstract class used to simplify creating custom ModelOscillator.

Summary

Fields
protected MidiChannel channel
protected int noteNumber
protected boolean on
protected float pitch
protected float samplerate
protected int velocity
protected VoiceStatus voice
Public Constructors
ModelAbstractOscillator()
Public Methods
void close()
float getAttenuation()
Attenuation is in cB.
MidiChannel getChannel()
int getChannels()
String getDescription()
Obtains a textual description of the sound bank, suitable for display.
Instrument getInstrument(Patch patch)
Obtains an Instrument from the given Patch.
ModelInstrument getInstrument()
Instrument[] getInstruments()
Obtains a list of instruments contained in this sound bank.
String getName()
Obtains the name of the sound bank.
int getNoteNumber()
Patch getPatch()
ModelPerformer getPerformer()
float getPitch()
SoundbankResource[] getResources()
Extracts a list of non-Instrument resources contained in the sound bank.
float getSampleRate()
Soundbank getSoundBank()
int getVelocity()
String getVendor()
Obtains a string naming the company that provides the sound bank
String getVersion()
Obtains the version string for the sound bank.
VoiceStatus getVoice()
void init()
boolean isOn()
void noteOff(int velocity)
void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber, int velocity)
ModelOscillatorStream open(float samplerate)
int read(float[][] buffer, int offset, int len)
void setPitch(float pitch)
void setSampleRate(float samplerate)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.sun.media.sound.ModelOscillator
From interface com.sun.media.sound.ModelOscillatorStream
From interface javax.sound.midi.Soundbank

Fields

protected MidiChannel channel

protected int noteNumber

protected boolean on

protected float pitch

protected float samplerate

protected int velocity

protected VoiceStatus voice

Public Constructors

public ModelAbstractOscillator ()

Public Methods

public void close ()

Throws
IOException

public float getAttenuation ()

Attenuation is in cB.

public MidiChannel getChannel ()

public int getChannels ()

public String getDescription ()

Obtains a textual description of the sound bank, suitable for display.

Returns
  • a String that describes the sound bank

public Instrument getInstrument (Patch patch)

Obtains an Instrument from the given Patch.

Parameters
patch a Patch object specifying the bank index and program change number
Returns
  • the requested instrument, or null if the sound bank doesn't contain that instrument

public ModelInstrument getInstrument ()

public Instrument[] getInstruments ()

Obtains a list of instruments contained in this sound bank.

Returns
  • an array of the Instruments in this SoundBank If the sound bank contains no instruments, returns an array of length 0.

public String getName ()

Obtains the name of the sound bank.

Returns
  • a String naming the sound bank

public int getNoteNumber ()

public Patch getPatch ()

public ModelPerformer getPerformer ()

public float getPitch ()

public SoundbankResource[] getResources ()

Extracts a list of non-Instrument resources contained in the sound bank.

Returns
  • an array of resources, exclusing instruments. If the sound bank contains no resources (other than instruments), returns an array of length 0.

public float getSampleRate ()

public Soundbank getSoundBank ()

public int getVelocity ()

public String getVendor ()

Obtains a string naming the company that provides the sound bank

Returns
  • the vendor string

public String getVersion ()

Obtains the version string for the sound bank.

Returns
  • a String that indicates the sound bank's version

public VoiceStatus getVoice ()

public void init ()

public boolean isOn ()

public void noteOff (int velocity)

public void noteOn (MidiChannel channel, VoiceStatus voice, int noteNumber, int velocity)

public ModelOscillatorStream open (float samplerate)

public int read (float[][] buffer, int offset, int len)

Throws
IOException

public void setPitch (float pitch)

public void setSampleRate (float samplerate)