abc.notation
Class TimeSignature

java.lang.Object
  extended byabc.notation.Fraction
      extended byabc.notation.TimeSignature
All Implemented Interfaces:
ScoreElementInterface

public class TimeSignature
extends Fraction
implements ScoreElementInterface

This class enables you to describe any time signatures like 4/4, 6/8 ...


Constructor Summary
TimeSignature(int num, int den)
          Creates a new time signature with the specified parameters.
 
Method Summary
 short getDefaultNoteLength()
          Returns the default note length for this time signature.
 int getNumberOfDefaultNotesPerBeat(short defaultLength)
           
 boolean isCoumpound()
          Return true if this time signature if compound, false otherwise.
 
Methods inherited from class abc.notation.Fraction
floatValue, getDenominator, getNumerator, multipliedBy, setDenominator, setNumerator, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeSignature

public TimeSignature(int num,
                     int den)
Creates a new time signature with the specified parameters.

Parameters:
num - The number of beat in a bar.
den - The type of those beats.
Method Detail

getDefaultNoteLength

public short getDefaultNoteLength()
Returns the default note length for this time signature.

Returns:
The default note length for this time signature. The default note length is equals to Note.SIXTEENTH when the time signature decimal conversion value is strictly less than 0.75. If it's higher, the default is Note.EIGHTH.

isCoumpound

public boolean isCoumpound()
Return true if this time signature if compound, false otherwise.

Returns:
true if this time signature if compound, false otherwise. Compound time signatures are 3/4, 3/8, 9/8 etc... simple time signatures are C, 4/4, 2/4 etc...

getNumberOfDefaultNotesPerBeat

public int getNumberOfDefaultNotesPerBeat(short defaultLength)