com.frinika.synth
Class SynthRack
java.lang.Object
com.frinika.synth.SynthRack
- All Implemented Interfaces:
- ChannelListProvider, ListProvider, MidiDeviceIconProvider, MidiListProvider, InstrumentNameListener, javax.sound.midi.MidiDevice, javax.sound.midi.Synthesizer, javax.sound.sampled.Line, javax.sound.sampled.Mixer
public class SynthRack
- extends java.lang.Object
- implements javax.sound.midi.Synthesizer, InstrumentNameListener, MidiListProvider, ChannelListProvider, MidiDeviceIconProvider, javax.sound.sampled.Mixer
The SynthRack class can hold 16 Frinika soft synths - one for each MidiChannel. Also making it
ideal for connecting to your MidiKeyboard for live playing. You can then setup 16 synths
and shift between them using the channel switch on your master keyboard.
- Author:
- Peter Salomonsen
Nested classes/interfaces inherited from interface javax.sound.midi.MidiDevice |
javax.sound.midi.MidiDevice.Info |
Nested classes/interfaces inherited from interface javax.sound.sampled.Mixer |
javax.sound.sampled.Mixer.Info |
Field Summary |
static double |
GAIN
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
GAIN
public static final double GAIN
- See Also:
- Constant Field Values
SynthRack
public SynthRack(VoiceServer voiceServer)
- Construct a Frinika Synth
- Parameters:
voiceServer
-
- Throws:
java.lang.Exception
getIcon
public javax.swing.Icon getIcon()
- Specified by:
getIcon
in interface MidiDeviceIconProvider
setSynth
public void setSynth(int index,
Synth synth)
getSynth
public Synth getSynth(int index)
getSynthSetup
public SynthSettings getSynthSetup()
clearSynths
public void clearSynths()
loadSynthSetup
public void loadSynthSetup(SynthSettings setup)
loadSynthSetupThread
public void loadSynthSetupThread(SynthSettings setup)
save
public void save(java.io.File file)
load
public void load(java.io.File file)
getMaxPolyphony
public int getMaxPolyphony()
- Specified by:
getMaxPolyphony
in interface javax.sound.midi.Synthesizer
getLatency
public long getLatency()
- Specified by:
getLatency
in interface javax.sound.midi.Synthesizer
getChannels
public javax.sound.midi.MidiChannel[] getChannels()
- Specified by:
getChannels
in interface javax.sound.midi.Synthesizer
getVoiceStatus
public javax.sound.midi.VoiceStatus[] getVoiceStatus()
- Specified by:
getVoiceStatus
in interface javax.sound.midi.Synthesizer
isSoundbankSupported
public boolean isSoundbankSupported(javax.sound.midi.Soundbank soundbank)
- Specified by:
isSoundbankSupported
in interface javax.sound.midi.Synthesizer
loadInstrument
public boolean loadInstrument(javax.sound.midi.Instrument instrument)
- Specified by:
loadInstrument
in interface javax.sound.midi.Synthesizer
unloadInstrument
public void unloadInstrument(javax.sound.midi.Instrument instrument)
- Specified by:
unloadInstrument
in interface javax.sound.midi.Synthesizer
remapInstrument
public boolean remapInstrument(javax.sound.midi.Instrument from,
javax.sound.midi.Instrument to)
- Specified by:
remapInstrument
in interface javax.sound.midi.Synthesizer
getDefaultSoundbank
public javax.sound.midi.Soundbank getDefaultSoundbank()
- Specified by:
getDefaultSoundbank
in interface javax.sound.midi.Synthesizer
getAvailableInstruments
public javax.sound.midi.Instrument[] getAvailableInstruments()
- Specified by:
getAvailableInstruments
in interface javax.sound.midi.Synthesizer
getLoadedInstruments
public javax.sound.midi.Instrument[] getLoadedInstruments()
- Specified by:
getLoadedInstruments
in interface javax.sound.midi.Synthesizer
loadAllInstruments
public boolean loadAllInstruments(javax.sound.midi.Soundbank soundbank)
- Specified by:
loadAllInstruments
in interface javax.sound.midi.Synthesizer
unloadAllInstruments
public void unloadAllInstruments(javax.sound.midi.Soundbank soundbank)
- Specified by:
unloadAllInstruments
in interface javax.sound.midi.Synthesizer
loadInstruments
public boolean loadInstruments(javax.sound.midi.Soundbank soundbank,
javax.sound.midi.Patch[] patchList)
- Specified by:
loadInstruments
in interface javax.sound.midi.Synthesizer
unloadInstruments
public void unloadInstruments(javax.sound.midi.Soundbank soundbank,
javax.sound.midi.Patch[] patchList)
- Specified by:
unloadInstruments
in interface javax.sound.midi.Synthesizer
getDeviceInfo
public javax.sound.midi.MidiDevice.Info getDeviceInfo()
- Specified by:
getDeviceInfo
in interface javax.sound.midi.MidiDevice
open
public void open()
- Specified by:
open
in interface javax.sound.midi.MidiDevice
- Specified by:
open
in interface javax.sound.sampled.Line
close
public void close()
- Specified by:
close
in interface javax.sound.midi.MidiDevice
- Specified by:
close
in interface javax.sound.sampled.Line
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface javax.sound.midi.MidiDevice
- Specified by:
isOpen
in interface javax.sound.sampled.Line
getMicrosecondPosition
public long getMicrosecondPosition()
- Specified by:
getMicrosecondPosition
in interface javax.sound.midi.MidiDevice
getMaxReceivers
public int getMaxReceivers()
- Specified by:
getMaxReceivers
in interface javax.sound.midi.MidiDevice
getMaxTransmitters
public int getMaxTransmitters()
- Specified by:
getMaxTransmitters
in interface javax.sound.midi.MidiDevice
getReceiver
public javax.sound.midi.Receiver getReceiver()
throws javax.sound.midi.MidiUnavailableException
- Specified by:
getReceiver
in interface javax.sound.midi.MidiDevice
- Throws:
javax.sound.midi.MidiUnavailableException
getReceivers
public java.util.List getReceivers()
- Specified by:
getReceivers
in interface javax.sound.midi.MidiDevice
getTransmitter
public javax.sound.midi.Transmitter getTransmitter()
throws javax.sound.midi.MidiUnavailableException
- Specified by:
getTransmitter
in interface javax.sound.midi.MidiDevice
- Throws:
javax.sound.midi.MidiUnavailableException
getTransmitters
public java.util.List getTransmitters()
- Specified by:
getTransmitters
in interface javax.sound.midi.MidiDevice
addGlobalInstrumentNameListener
public void addGlobalInstrumentNameListener(GlobalInstrumentNameListener globalInstrumentNameListener)
- Parameters:
box
-
instrumentNameChange
public void instrumentNameChange(Synth synth,
java.lang.String instrumentName)
- Specified by:
instrumentNameChange
in interface InstrumentNameListener
getNumberOfSynths
public int getNumberOfSynths()
getVoiceServer
public VoiceServer getVoiceServer()
- Returns:
- Returns the voiceServer.
toString
public java.lang.String toString()
- over to provide easier GUI manufactoring
- Overrides:
toString
in class java.lang.Object
getList
public java.lang.Object[] getList()
- Description copied from interface:
ChannelListProvider
- The position in the returned array must correspond to the channel number.
null entries are allowed.
- Specified by:
getList
in interface ChannelListProvider
- Specified by:
getList
in interface ListProvider
- Returns:
- list of channels provided.
isSaveReferencedData
public boolean isSaveReferencedData()
- Returns:
- Returns the saveReferencedData.
setSaveReferencedData
public void setSaveReferencedData(boolean saveReferencedData)
- Parameters:
saveReferencedData
- The saveReferencedData to set.
getControllerList
public ControllerListProvider getControllerList()
- Specified by:
getControllerList
in interface MidiListProvider
setVoiceServer
public void setVoiceServer(VoiceServer voiceServer)
getLine
public javax.sound.sampled.Line getLine(javax.sound.sampled.Line.Info info)
throws javax.sound.sampled.LineUnavailableException
- Specified by:
getLine
in interface javax.sound.sampled.Mixer
- Throws:
javax.sound.sampled.LineUnavailableException
getMaxLines
public int getMaxLines(javax.sound.sampled.Line.Info info)
- Specified by:
getMaxLines
in interface javax.sound.sampled.Mixer
getMixerInfo
public javax.sound.sampled.Mixer.Info getMixerInfo()
- Specified by:
getMixerInfo
in interface javax.sound.sampled.Mixer
getSourceLineInfo
public javax.sound.sampled.Line.Info[] getSourceLineInfo()
- Specified by:
getSourceLineInfo
in interface javax.sound.sampled.Mixer
getSourceLineInfo
public javax.sound.sampled.Line.Info[] getSourceLineInfo(javax.sound.sampled.Line.Info info)
- Specified by:
getSourceLineInfo
in interface javax.sound.sampled.Mixer
getSourceLines
public javax.sound.sampled.Line[] getSourceLines()
- Specified by:
getSourceLines
in interface javax.sound.sampled.Mixer
getTargetLineInfo
public javax.sound.sampled.Line.Info[] getTargetLineInfo()
- Specified by:
getTargetLineInfo
in interface javax.sound.sampled.Mixer
getTargetLineInfo
public javax.sound.sampled.Line.Info[] getTargetLineInfo(javax.sound.sampled.Line.Info info)
- Specified by:
getTargetLineInfo
in interface javax.sound.sampled.Mixer
getTargetLines
public javax.sound.sampled.Line[] getTargetLines()
- Specified by:
getTargetLines
in interface javax.sound.sampled.Mixer
isLineSupported
public boolean isLineSupported(javax.sound.sampled.Line.Info info)
- Specified by:
isLineSupported
in interface javax.sound.sampled.Mixer
isSynchronizationSupported
public boolean isSynchronizationSupported(javax.sound.sampled.Line[] lines,
boolean maintainSync)
- Specified by:
isSynchronizationSupported
in interface javax.sound.sampled.Mixer
synchronize
public void synchronize(javax.sound.sampled.Line[] lines,
boolean maintainSync)
- Specified by:
synchronize
in interface javax.sound.sampled.Mixer
unsynchronize
public void unsynchronize(javax.sound.sampled.Line[] lines)
- Specified by:
unsynchronize
in interface javax.sound.sampled.Mixer
addLineListener
public void addLineListener(javax.sound.sampled.LineListener listener)
- Specified by:
addLineListener
in interface javax.sound.sampled.Line
getControl
public javax.sound.sampled.Control getControl(javax.sound.sampled.Control.Type control)
- Specified by:
getControl
in interface javax.sound.sampled.Line
getControls
public javax.sound.sampled.Control[] getControls()
- Specified by:
getControls
in interface javax.sound.sampled.Line
getLineInfo
public javax.sound.sampled.Line.Info getLineInfo()
- Specified by:
getLineInfo
in interface javax.sound.sampled.Line
isControlSupported
public boolean isControlSupported(javax.sound.sampled.Control.Type control)
- Specified by:
isControlSupported
in interface javax.sound.sampled.Line
removeLineListener
public void removeLineListener(javax.sound.sampled.LineListener listener)
- Specified by:
removeLineListener
in interface javax.sound.sampled.Line
getTempoBPM
public float getTempoBPM()
show
public void show()
- Frinika specific method to show gui of this synth
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Local test program for SynthRack with GUI - opens a SynthRack midi device and creates the GUI dialog
- Parameters:
args
-
- Throws:
java.lang.Exception