com.softsynth.jmsl.midi
Class MidiIO_JavaSound

java.lang.Object
  extended by com.softsynth.jmsl.midi.MidiIO
      extended by 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.

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, POLYPHONIC_AFTERTOUCH, PROGRAM_CHANGE
 
Method Summary
 void closeDevices()
           
 java.lang.String[] getInputDeviceNames()
           
 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)
           
 void openDevices(int inDevice, int outDevice)
          initialize JavaSound Midi.
 void sendMessage(double timeStamp, int status, int data1, int data2)
           
 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 File
 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
 void startListening()
           
 void stopListening()
           
 void synchClocks()
          unimplemented
 void sysex(double timeStamp, byte[] data)
          Not implemented
 
Methods 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, getQuiet, logMessage, logMessage, noteOff, noteOff, noteOff, noteOff, noteOn, noteOn, open, printMidiLog, programChange, programChange, removeEditListener, removeMidiParser, scheduleMessage, setEditEnabled, setInDevice, setMidiLogging, setOutDevice, setQuiet, sysex, test1, test2, test3, writeMidiFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static MidiIO_JavaSound instance()
Returns:
singleton instance of this class

openDevices

public void openDevices(int inDevice,
                        int outDevice)
initialize JavaSound Midi. If MidiSystem.getSynthesizer().getDefaultSoundbank() == null, try to load one from a URL or from a File depending on JMSL.getIsApplet()

Specified by:
openDevices in class MidiIO

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 -

closeDevices

public void closeDevices()
Specified by:
closeDevices in class MidiIO

sendMessage

public void sendMessage(int status,
                        int data1,
                        int data2)
Specified by:
sendMessage in class MidiIO

sendMessage

public void sendMessage(double timeStamp,
                        int status,
                        int data1,
                        int data2)
Specified by:
sendMessage in class MidiIO

getInputDeviceNames

public java.lang.String[] getInputDeviceNames()
Specified by:
getInputDeviceNames in class MidiIO

getOutputDeviceNames

public java.lang.String[] getOutputDeviceNames()
Specified by:
getOutputDeviceNames in class MidiIO

startListening

public void startListening()
Specified by:
startListening in class MidiIO

stopListening

public void stopListening()
Specified by:
stopListening in class MidiIO

sysex

public void sysex(double timeStamp,
                  byte[] data)
Not implemented

Specified by:
sysex in class MidiIO

main

public static void main(java.lang.String[] args)

synchClocks

public void synchClocks()
unimplemented

Specified by:
synchClocks in class MidiIO
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.