|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.midi.MidiIO
public abstract class MidiIO
Abstract class that provides access to a MIDI device. Also includes Midi "note on" and "note off" methods.
Field Summary | |
---|---|
static int |
CHANNEL_AFTERTOUCH
|
static int |
CONTROL_CHANGE
|
static int |
MIDI_PAN_CONTROL_INDEX
|
static int |
MIDI_VOLUME_CONTROL_INDEX
|
static int |
NOTE_OFF
|
static int |
NOTE_ON
|
static int |
PITCH_BEND
|
static int |
PITCH_BEND_CENTER
Value for bendPitch for zero bend. |
static int |
POLYPHONIC_AFTERTOUCH
|
static int |
PROGRAM_CHANGE
|
Constructor Summary | |
---|---|
MidiIO()
|
Method Summary | |
---|---|
void |
addEditListener(EditListener listener)
unimplemented |
void |
addMidiParser(MidiParser parser)
Add a listener/parser for raw MIDI input messages. |
void |
allNotesOff(double timeStamp,
int channel)
Turn off all notes on the given MIDI channel at the given time. |
void |
allNotesOff(int channel)
Turn off all notes on the given MIDI channel. |
void |
bendPitch(double timeStamp,
int channel,
int bendAmount)
Send a control message over the given MIDI channel at the given time. |
void |
bendPitch(int channel,
int bendAmount)
Bend the pitch of all notes on the given MIDI channel. |
void |
clearMidiLog()
Remove all logged MIDI events from MIDI event logger |
void |
close()
Calls closeDevices() if not already closed. |
abstract void |
closeDevices()
|
void |
control(double timeStamp,
int channel,
int controlIndex,
int value)
Send a control message over the given MIDI channel at the given time. |
void |
control(int channel,
int controlIndex,
int value)
Send a control message over the given MIDI channel. |
void |
controlContinuous(double timeStamp,
int channel,
int controlIndex,
int value)
Send a control message over the given MIDI channel at the given time. |
void |
controlContinuous(int channel,
int controlIndex,
int value)
Send a continuous control message over the given MIDI channel. |
static MidiIO |
createMidiIO()
Create an appropriate MidiIO. |
void |
edit(java.awt.Frame f)
If Frame is null, MidiInitDialog is called with new Frame() |
boolean |
getEditEnabled()
|
int |
getInDevice()
|
abstract java.lang.String[] |
getInputDeviceNames()
|
java.util.Vector |
getMidiParser()
|
int |
getOutDevice()
|
abstract java.lang.String[] |
getOutputDeviceNames()
|
boolean |
getQuiet()
|
void |
logMessage(double timeStamp,
int status,
int data1,
int data2)
Add tiomestamped event to midi logger if setMidiLogging is true |
void |
logMessage(int status,
int data1,
int data2)
Add event to midi logger if setMidiLogging is true |
static void |
main(java.lang.String[] args)
|
void |
noteOff(double timeStamp,
int channel,
int pitch)
|
void |
noteOff(double timeStamp,
int channel,
int pitch,
int velocity)
|
void |
noteOff(int channel,
int pitch)
Turn on MIDI note at the specified time. |
void |
noteOff(int channel,
int pitch,
int velocity)
|
void |
noteOn(double timeStamp,
int channel,
int pitch,
int velocity)
Turn on MIDI note at the specified time. |
void |
noteOn(int channel,
int pitch,
int velocity)
|
void |
open()
Only calls openDevices() if not already open |
abstract void |
openDevices(int inDevice,
int outDevice)
|
void |
printMidiLog()
|
void |
programChange(double timeStamp,
int channel,
int index_0_127)
|
void |
programChange(int channel,
int index_0_127)
Send a program change message over the given MIDI channel. |
void |
removeEditListener(EditListener listener)
unimplemented |
void |
removeMidiParser(MidiParser parser)
|
void |
scheduleMessage(double timeStamp,
int status,
int data1,
int data2)
Put MIDI message into EventScheduler. |
abstract void |
sendMessage(double timeStamp,
int status,
int data1,
int data2)
|
abstract void |
sendMessage(int status,
int data1,
int data2)
|
void |
setEditEnabled(boolean f)
Set a flag. |
void |
setInDevice(int devID)
|
void |
setMidiLogging(boolean flag)
Turn logging of Midi events on or off |
void |
setOutDevice(int devID)
|
void |
setQuiet(boolean f)
if true, no midi output; calls to various send methods simply return |
abstract void |
startListening()
|
abstract void |
stopListening()
|
abstract void |
synchClocks()
Synchronize JMSL.clock with Midi clock. |
void |
sysex(byte[] data)
Send data[] as sysex. |
abstract void |
sysex(double timeStamp,
byte[] data)
Send data[] as sysex at specified time. |
void |
test1()
Play a couple notes using different programs. |
void |
test2()
Schedule ascending major arpeggio using event buffer. |
void |
test3()
|
void |
writeMidiFile(java.lang.String filename)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIDI_VOLUME_CONTROL_INDEX
public static final int MIDI_PAN_CONTROL_INDEX
public static final int NOTE_OFF
public static final int NOTE_ON
public static final int POLYPHONIC_AFTERTOUCH
public static final int CONTROL_CHANGE
public static final int PROGRAM_CHANGE
public static final int CHANNEL_AFTERTOUCH
public static final int PITCH_BEND
public static final int PITCH_BEND_CENTER
Constructor Detail |
---|
public MidiIO()
Method Detail |
---|
public void setInDevice(int devID)
public int getInDevice()
public void setOutDevice(int devID)
public int getOutDevice()
public void setQuiet(boolean f)
public boolean getQuiet()
public abstract void openDevices(int inDevice, int outDevice)
public abstract void closeDevices()
public abstract void synchClocks()
public void open()
open
in interface MusicDevice
public void close()
close
in interface MusicDevice
public void edit(java.awt.Frame f)
edit
in interface Editable
public void setEditEnabled(boolean f)
Editable
setEditEnabled
in interface Editable
public boolean getEditEnabled()
getEditEnabled
in interface Editable
public void addEditListener(EditListener listener)
addEditListener
in interface Editable
public void removeEditListener(EditListener listener)
removeEditListener
in interface Editable
public abstract void sendMessage(int status, int data1, int data2)
public abstract void sendMessage(double timeStamp, int status, int data1, int data2)
public abstract java.lang.String[] getInputDeviceNames()
public abstract java.lang.String[] getOutputDeviceNames()
public abstract void startListening()
public abstract void stopListening()
public void logMessage(int status, int data1, int data2)
public void logMessage(double timeStamp, int status, int data1, int data2)
public void setMidiLogging(boolean flag)
public void clearMidiLog()
public void printMidiLog()
public void writeMidiFile(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static MidiIO createMidiIO()
public java.util.Vector getMidiParser()
public void scheduleMessage(double timeStamp, int status, int data1, int data2)
public void programChange(int channel, int index_0_127)
channel
- can range from 1 to 16.index_0_127
- can range from 0 to 127.public void programChange(double timeStamp, int channel, int index_0_127)
public void control(int channel, int controlIndex, int value)
channel
- can range from 1 to 16.controlIndex
- can range from 0 to 127.value
- can range from 0 to 127.public void control(double timeStamp, int channel, int controlIndex, int value)
public void controlContinuous(int channel, int controlIndex, int value)
channel
- can range from 1 to 16.controlIndex
- can range from 0 to 31.value
- can range from 0 to 0x3FFF or 16383.public void controlContinuous(double timeStamp, int channel, int controlIndex, int value)
public void allNotesOff(int channel)
public void allNotesOff(double timeStamp, int channel)
public void bendPitch(int channel, int bendAmount)
channel
- can range from 1 to 16.bendAmount
- can range from 0 to 0x3FFF. For no bend, send 0x2000.public void bendPitch(double timeStamp, int channel, int bendAmount)
public void noteOn(int channel, int pitch, int velocity)
public void noteOn(double timeStamp, int channel, int pitch, int velocity)
public void noteOff(int channel, int pitch, int velocity)
public void noteOff(int channel, int pitch)
public void noteOff(double timeStamp, int channel, int pitch, int velocity)
public void noteOff(double timeStamp, int channel, int pitch)
public void sysex(byte[] data)
public abstract void sysex(double timeStamp, byte[] data)
public void addMidiParser(MidiParser parser)
public void removeMidiParser(MidiParser parser)
public void test1()
public void test2()
public void test3()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |