Previous  Next          Package

Class MIDICompose.MIDIFile

java.lang.Object
   |
   +----MIDICompose.MIDIObject
           |
           +----MIDICompose.MIDIContainer
                   |
                   +----MIDICompose.MIDIFile

public class MIDIFile
extends MIDIContainer

MIDIFile is an ABSOLUTE-typed MIDIContainer, that is not set to any specific channel. It can write its elements to a MIDI-file.

Constructor Index

 o MIDIFile()
Creates new MIDIFile.
 o MIDIFile(double, int, int)
Creates new MIDIFile with tempo, numerator and denominator.
 o MIDIFile(double, int, int, String)
Creates new MIDIFile with tempo, numerator, denominator and copyright.
 o MIDIFile(MIDIFile)
Creates new MIDIFile equal to another MIDIFile.

Method Index

All methods from interfaces are implemented, but not listed here!
 o copyright()
Returns current copyright-message.
 o denominator()
Returns current denominator.
 o numerator()
Returns current numerator.
 o tempo()
Returns current tempo.
 o setCopyright(String)
Sets copyright-message.
 o setDenominator(int)
Sets denominator.
 o setNumerator(int)
Sets numerator.
 o setTempo(double)
Sets tempo.
 o setTimeSignature(int, int)
Sets numerator and denominator.
 o print(FileOutputStream)
Writes all elements to a MIDI-file.

Constructors

 o MIDIFile
 public MIDIFile()
Creates a new MIDIFile with 120 BPM and 4/4 TimeSignature.
 o MIDIFile
 public MIDIFile(double tempo,
                 int numerator,
                 int denominator)
Creates a new MIDIFile.

Parameters:
tempo - any double between Tempo.MIN and Tempo.MAX.
numerator - any int between 0 and 255.
denominator - 1, 2, 4, 8, 16, 32 or 64.
 o MIDIFile
 public MIDIFile(double tempo,
                 int numerator,
                 int denominator,
                 String copyright)
Creates a new MIDIFile.

Parameters:
tempo - any double between Tempo.MIN and Tempo.MAX.
numerator - any int between 0 and 255.
denominator - 1, 2, 4, 8, 16, 32 or 64.
copyright - any String.
 o MIDIFile
 protected MIDIFile(MIDIFile object)
Creates a new MIDIFile that is a copy of object.

Parameters:
object - any MIDIFile.

Methods

 o copyright
 public String copyright()
Returns the current copyright-message.

Returns:
a String.
 o setCopyright
 public void setCopyright(String text)
Sets the copyright-message.

Parameters:
text - any String.
 o tempo
 public double tempo()
Returns the current tempo.

Returns:
an int between Tempo.MIN and Tempo.MAX.
 o setTempo
 public void setTempo(double tempo)
Sets the tempo.

Parameters:
tempo - any int between Tempo.MIN and Tempo.MAX.
 o numerator
 public int numerator()
Returns the current numerator.

Returns:
an int between 0 and 255.
 o setNumerator
 public void setNumerator(int numerator)
Sets the numerator.

Parameters:
numerator - any int between 0 and 255.
 o denominator
 public int denominator()
Returns the current denominator.

Returns:
1, 2, 4, 8, 16, 32 or 64.
 o setDenominator
 public void setDenominator(int denominator)
Sets the denominator.

Parameters:
denominator - 1, 2, 4, 8, 16, 32 or 64.
 o setTimeSignature
 public void setTimeSignature(int numerator,
                              int denominator)
Sets numerator and denominator.

Parameters:
numerator - any int between 0 and 255.
denominator - 1, 2, 4, 8, 16, 32 or 64.
 o print
 public void print(FileOutputStream fpp) throws IOException
Writes all elements to a MIDI-file.

Parameters:
fpp - any FileOutputStream.

 Previous  Next          Package