Package com.softsynth.jmsl.midi
Class MidiIO_JavaSound
java.lang.Object
com.softsynth.jmsl.midi.MidiIO
com.softsynth.jmsl.midi.MidiIO_JavaSound
- All Implemented Interfaces:
Editable
,MusicDevice
public class MidiIO_JavaSound extends MidiIO
Uses Sun's JavaSound package to provide MIDI output nad input.
MOD 4/14/08 Supports external MIDI devices. MidiIO_JavaSound is now the
default JMSL.midi MOD 2015-12-03 adding support for external Midi input
devices. No more need for MidiShare.
- Author:
- Phil Burk and Nick Didkovsky
-
Field Summary
Fields inherited from class com.softsynth.jmsl.midi.MidiIO
CHANNEL_AFTERTOUCH, CONTROL_CHANGE, MIDI_PAN_CONTROL_INDEX, MIDI_VOLUME_CONTROL_INDEX, NOTE_OFF, NOTE_ON, PITCH_BEND, PITCH_BEND_CENTER, PITCH_BEND_MAX, POLYPHONIC_AFTERTOUCH, PROGRAM_CHANGE
-
Method Summary
Modifier and Type Method Description boolean
closeDevices()
java.lang.String[]
getDeviceNames(boolean inputDevices)
java.lang.String[]
getInputDeviceNames()
javax.sound.midi.Instrument[]
getLoadedSoundbankInstruments()
java.lang.String[]
getOutputDeviceNames()
java.io.File
getSoundbankFile()
java.net.URL
getSoundbankURL()
void
initFromSoundbank()
This is called automatically if MidiSystem.getSynthesizer().getDefaultSoundbank() is NULL and a soundban has been successfully loaded from a File or a URL.static MidiIO_JavaSound
instance()
static void
main(java.lang.String[] args)
boolean
openDevices(int inDevice, int outDevice)
void
sendMessage(double timeStamp, int status, int data1, int data2)
Use EventScheduler because this device does not currently support timestamped output.void
sendMessage(int status, int data1, int data2)
void
setSoundbankFile(java.io.File soundbankFile)
if the synthesizer's soundbank is null in opendevices() and JMSL.isApplet() is false, try to load a soundbank from this Filevoid
setSoundbankURL(java.net.URL soundbankURL)
*If the synthesizer's soundbank is null in opendevices() and JMSL.isApplet() is true, try to load a soundbank from this URLvoid
startListening()
void
stopListening()
void
synchClocks()
unimplementedvoid
sysex(double timeStamp, byte[] data)
Not implementedMethods inherited from class com.softsynth.jmsl.midi.MidiIO
addEditListener, addMidiParser, allNotesOff, allNotesOff, bendPitch, bendPitch, clearMidiLog, close, control, control, controlContinuous, controlContinuous, createMidiIO, edit, getEditEnabled, getInDevice, getMidiParser, getOutDevice, getPreferredInDevName, getPreferredOutDevName, getQuiet, logMessage, logMessage, noteOff, noteOff, noteOff, noteOff, noteOn, noteOn, open, printMidiLog, programChange, programChange, removeEditListener, removeMidiParser, scheduleMessage, setEditEnabled, setInDevice, setInDevice, setMidiLogging, setOutDevice, setOutDevice, setQuiet, sysex, test1, test2, test3, writeMidiFile
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
instance
- Returns:
- singleton instance of this class
-
openDevices
public boolean openDevices(int inDevice, int outDevice)- Specified by:
openDevices
in classMidiIO
-
initFromSoundbank
public void initFromSoundbank()This is called automatically if MidiSystem.getSynthesizer().getDefaultSoundbank() is NULL and a soundban has been successfully loaded from a File or a URL. But you can call this directly after openDevices()- Parameters:
sb
-
-
getLoadedSoundbankInstruments
public javax.sound.midi.Instrument[] getLoadedSoundbankInstruments() -
closeDevices
public boolean closeDevices()- Specified by:
closeDevices
in classMidiIO
-
sendMessage
public void sendMessage(int status, int data1, int data2)- Specified by:
sendMessage
in classMidiIO
-
sendMessage
public void sendMessage(double timeStamp, int status, int data1, int data2)Use EventScheduler because this device does not currently support timestamped output. UPDATE: Gervill supports timestamped output under Windows but not OSX. We will support real timestamped output when both platforms support it- Specified by:
sendMessage
in classMidiIO
-
getDeviceNames
public java.lang.String[] getDeviceNames(boolean inputDevices) -
getOutputDeviceNames
public java.lang.String[] getOutputDeviceNames()- Specified by:
getOutputDeviceNames
in classMidiIO
-
getInputDeviceNames
public java.lang.String[] getInputDeviceNames()- Specified by:
getInputDeviceNames
in classMidiIO
-
startListening
public void startListening()- Specified by:
startListening
in classMidiIO
-
stopListening
public void stopListening()- Specified by:
stopListening
in classMidiIO
-
sysex
public void sysex(double timeStamp, byte[] data)Not implemented -
main
public static void main(java.lang.String[] args) -
synchClocks
public void synchClocks()unimplemented- Specified by:
synchClocks
in classMidiIO
- See Also:
MidiIO.synchClocks()
-
getSoundbankFile
public java.io.File getSoundbankFile()- Returns:
- Returns the soundbankFile.
-
setSoundbankFile
public void setSoundbankFile(java.io.File soundbankFile)if the synthesizer's soundbank is null in opendevices() and JMSL.isApplet() is false, try to load a soundbank from this File- Parameters:
soundbankFile
- The soundbankFile to set.
-
getSoundbankURL
public java.net.URL getSoundbankURL()- Returns:
- Returns the soundbankURL.
-
setSoundbankURL
public void setSoundbankURL(java.net.URL soundbankURL)*If the synthesizer's soundbank is null in opendevices() and JMSL.isApplet() is true, try to load a soundbank from this URL- Parameters:
soundbankURL
- The soundbankURL to set.
-