All Packages Class Hierarchy This Package Previous Next Index
Class com.nosuch.midi.MidiFileWriter
java.lang.Object
|
+----com.nosuch.midi.MidiFileWriter
- public class MidiFileWriter
- extends Object
Write a Standard MIDI File.
Typical usage:
FileOutputStream fos = new FileOutputStream("test.mid");
MidiFileWriter mf = new MidiFileWriter(outputstream);
mf.addTrack(new MidiPhrase('a,b,c,d,e'));
mf.write();
fos.close();
-
MidiFileWriter(OutputStream)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream.
-
MidiFileWriter(OutputStream, int, int)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream.
-
MidiFileWriter(OutputStream, int, int, int)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream.
-
addTrack(MidiPhrase)
- Add a track to the list of tracks that will be written.
-
main(String[])
-
-
write()
- Write the Midi File.
MidiFileWriter
public MidiFileWriter(OutputStream out)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream. Defaults to a type-0 file with no tempo track.
- Parameters:
- out - The OutputStream to send data to.
MidiFileWriter
public MidiFileWriter(OutputStream out,
int f,
int t)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream.
- Parameters:
- out - The OutputStream to send data to.
- f - The Standard MIDI File type (0, 1, or 2).
- t - The tempo, in microseconds. This is only used
if the file type is 1, in which case a tempo
track is added (assuming this value is > 0)
MidiFileWriter
public MidiFileWriter(OutputStream out,
int f,
int t,
int d)
- Create a MidiFileWriter for sending a Standard MIDI File
to an OutputStream.
- Parameters:
- out - The OutputStream to send data to.
- f - The Standard MIDI File type (0, 1, or 2).
- t - The tempo, in microseconds. This is only used
if the file type is 1, in which case a tempo
track is added (assuming this value is > 0)
- d - Number of clicks per quarter note?
addTrack
public void addTrack(MidiPhrase p)
- Add a track to the list of tracks that will be written.
(Nothing is actually written until the write() method is called.
- Parameters:
- p - The MidiPhrase to be added.
write
public void write() throws IOException
- Write the Midi File.
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index