Top Description Inners Fields Constructors Methods
com.sun.media.sound

public final Class SoftSynthesizer

extends Object
implements AudioSynthesizer, ReferenceCountingDevice
Class Inheritance
All Implemented Interfaces
com.sun.media.sound.ReferenceCountingDevice, com.sun.media.sound.AudioSynthesizer, javax.sound.midi.Synthesizer, javax.sound.midi.MidiDevice, java.lang.AutoCloseable
Imports
sun.awt.OSInfo, java.io.BufferedInputStream, .File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.lang.ref.WeakReference, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Arrays, .HashMap, .List, .Map, .Properties, .StringTokenizer, java.util.prefs.BackingStoreException, .Preferences, javax.sound.midi.Instrument, .MidiChannel, .MidiDevice, .MidiSystem, .MidiUnavailableException, .Patch, .Receiver, .Soundbank, .Transmitter, .VoiceStatus, javax.sound.sampled.AudioFormat, .AudioInputStream, .AudioSystem, .LineUnavailableException, .SourceDataLine

The software synthesizer class.
Author
Karl Helgason

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
protected static class

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv SoftChannel[]
pack-priv boolean
pack-priv final Object
private float
private static Soundbank
private int
pack-priv SoftChannelProxy[]
private AudioFormat
private int
private boolean
pack-priv static final MidiDevice.Info
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
private final Map<String, SoftInstrument>
private boolean
private boolean
private long
pack-priv boolean
private final Map<String, ModelInstrument>
private SoftMainMixer
private int
private int
private boolean
private SoftAudioPusher
private AudioInputStream
private final ArrayList<Receiver>
private SoftResampler
private String
pack-priv boolean
pack-priv boolean
private SourceDataLine
private static SourceDataLine
private final Map<String, SoftTuning>
pack-priv int
pack-priv int
private SoftVoice[]
pack-priv SoftSynthesizer.WeakAudioStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.sound.midi.MidiDevice.close.

Closes the device, indicating that the device should now release any system resources it is using.
pack-priv SoftInstrument
findInstrument(int program, int bank, int channel)

public Instrument[]
getAvailableInstruments()

Implements javax.sound.midi.Synthesizer.getAvailableInstruments.

Obtains a list of instruments that come with the synthesizer.
private void
public MidiChannel[]
getChannels()

Implements javax.sound.midi.Synthesizer.getChannels.

Obtains the set of MIDI channels controlled by this synthesizer.
pack-priv float
public Soundbank
getDefaultSoundbank()

Implements javax.sound.midi.Synthesizer.getDefaultSoundbank.

Obtains the default soundbank for the synthesizer, if one exists.
pack-priv int
public MidiDevice.Info
getDeviceInfo()

Implements javax.sound.midi.MidiDevice.getDeviceInfo.

Obtains information about the device, including its Java class and Strings containing its name, vendor, and description.
public AudioFormat
getFormat()

Implements com.sun.media.sound.AudioSynthesizer.getFormat.

Obtains the current format (encoding, sample rate, number of channels, etc.) of the synthesizer audio data.
pack-priv int
public long
getLatency()

Implements javax.sound.midi.Synthesizer.getLatency.

Obtains the processing latency incurred by this synthesizer, expressed in microseconds.
public Instrument[]
getLoadedInstruments()

Implements javax.sound.midi.Synthesizer.getLoadedInstruments.

Obtains a list of the instruments that are currently loaded onto this Synthesizer.
pack-priv SoftMainMixer
public int
getMaxPolyphony()

Implements javax.sound.midi.Synthesizer.getMaxPolyphony.

Obtains the maximum number of notes that this synthesizer can sound simultaneously.
public int
getMaxReceivers()

Implements javax.sound.midi.MidiDevice.getMaxReceivers.

Obtains the maximum number of MIDI IN connections available on this MIDI device for receiving MIDI data.
public int
getMaxTransmitters()

Implements javax.sound.midi.MidiDevice.getMaxTransmitters.

Obtains the maximum number of MIDI OUT connections available on this MIDI device for transmitting MIDI data.
public long
getMicrosecondPosition()

Implements javax.sound.midi.MidiDevice.getMicrosecondPosition.

Obtains the current time-stamp of the device, in microseconds.
public AudioSynthesizerPropertyInfo[]
getPropertyInfo(Map<String, Object>
a proposed list of tag/value pairs that will be sent on open.
info
)

Implements com.sun.media.sound.AudioSynthesizer.getPropertyInfo.

Gets information about the possible properties for the synthesizer.
public Receiver
getReceiver()

Implements javax.sound.midi.MidiDevice.getReceiver.

Obtains a MIDI IN receiver through which the MIDI device may receive MIDI data.
public Receiver
getReceiverReferenceCounting()

Implements com.sun.media.sound.ReferenceCountingDevice.getReceiverReferenceCounting.

Retrieve a Receiver that opens the device implicitly.
public List<Receiver>
getReceivers()

Implements javax.sound.midi.MidiDevice.getReceivers.

Returns all currently active, non-closed receivers connected with this MidiDevice.
private Properties
public Transmitter
getTransmitter()

Implements javax.sound.midi.MidiDevice.getTransmitter.

Obtains a MIDI OUT connection from which the MIDI device will transmit MIDI data.
public Transmitter
getTransmitterReferenceCounting()

Implements com.sun.media.sound.ReferenceCountingDevice.getTransmitterReferenceCounting.

Retrieve a Transmitter that opens the device implicitly.
public List<Transmitter>
getTransmitters()

Implements javax.sound.midi.MidiDevice.getTransmitters.

Returns all currently active, non-closed transmitters connected with this MidiDevice.
pack-priv SoftTuning
pack-priv int
pack-priv SoftVoice[]
public VoiceStatus[]
getVoiceStatus()

Implements javax.sound.midi.Synthesizer.getVoiceStatus.

Obtains the current status of the voices produced by this synthesizer.
public boolean
isOpen()

Implements javax.sound.midi.MidiDevice.isOpen.

Reports whether the device is open.
public boolean
isSoundbankSupported(Soundbank
soundbank for which support is queried
soundbank
)

Implements javax.sound.midi.Synthesizer.isSoundbankSupported.

Informs the caller whether this synthesizer is capable of loading instruments from the specified soundbank.
public boolean
loadAllInstruments(Soundbank
the Soundbank whose are instruments are to be loaded
soundbank
)

Implements javax.sound.midi.Synthesizer.loadAllInstruments.

Loads onto the Synthesizer all instruments contained in the specified Soundbank.
public boolean
loadInstrument(Instrument
instrument to load
instrument
)

Implements javax.sound.midi.Synthesizer.loadInstrument.

Makes a particular instrument available for synthesis.
private boolean
public boolean
loadInstruments(Soundbank
the Soundbank containing the instruments to load
soundbank
,
Patch[]
list of patches for which instruments should be loaded
patchList
)

Implements javax.sound.midi.Synthesizer.loadInstruments.

Loads the instruments referenced by the specified patches, from the specified Soundbank.
private boolean
public void
open()

Implements javax.sound.midi.MidiDevice.open.

Opens the device, indicating that it should now acquire any system resources it requires and become operational.
public void
open(SourceDataLine
which AudioSynthesizer writes output audio into. If line is null, then line from system default mixer is used.
line
,
Map<String, Object>
a Map<String,Object> object containing properties for additional configuration supported by synthesizer. If info is null then default settings are used.
info
)

Implements com.sun.media.sound.AudioSynthesizer.open.

Opens the synthesizer and starts rendering audio into SourceDataLine.
public AudioInputStream
openStream(AudioFormat
specifies the AudioFormat used in returned AudioInputStream.
targetFormat
,
Map<String, Object>
a Map<String,Object> object containing properties for additional configuration supported by synthesizer. If info is null then default settings are used.
info
)

Implements com.sun.media.sound.AudioSynthesizer.openStream.

Opens the synthesizer and renders audio into returned AudioInputStream.
private String
private void
public boolean
remapInstrument(Instrument
the Instrument object to be replaced
from
,
Instrument
the Instrument object to be used in place of the old instrument, it should be loaded into the synthesizer
to
)

Implements javax.sound.midi.Synthesizer.remapInstrument.

Remaps an instrument.
pack-priv void
private void
pack-priv void
setGeneralMidiMode(int gmmode)

public void
unloadAllInstruments(Soundbank
soundbank containing instruments to unload
soundbank
)

Implements javax.sound.midi.Synthesizer.unloadAllInstruments.

Unloads all instruments contained in the specified Soundbank.
public void
unloadInstrument(Instrument
instrument to unload
instrument
)

Implements javax.sound.midi.Synthesizer.unloadInstrument.

Unloads a particular instrument.
public void
unloadInstruments(Soundbank
soundbank containing instruments to unload
soundbank
,
Patch[]
list of patches for which instruments should be unloaded
patchList
)

Implements javax.sound.midi.Synthesizer.unloadInstruments.

Unloads the instruments referenced by the specified patches, from the MIDI sound bank specified.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait