abc4j API Specification

abc.notation
Class TimeSignature

java.lang.Object
  extended by abc.notation.Fraction
      extended by abc.notation.TimeSignature
All Implemented Interfaces:
MusicElement

public class TimeSignature
extends Fraction
implements MusicElement

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


Field Summary
static TimeSignature SIGNATURE_3_4
          The 3/4 time signature constant.
static TimeSignature SIGNATURE_4_4
          The 4/4 time signature constant.
static TimeSignature SIGNATURE_6_8
          The 6/8 time signature constant.
 
Constructor Summary
TimeSignature(int num, int den)
          Creates a new time signature with the specified parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 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
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIGNATURE_4_4

public static final TimeSignature SIGNATURE_4_4
The 4/4 time signature constant.


SIGNATURE_3_4

public static final TimeSignature SIGNATURE_3_4
The 3/4 time signature constant.


SIGNATURE_6_8

public static final TimeSignature SIGNATURE_6_8
The 6/8 time signature constant.

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. A time signature is considered as compound if its top number can be divided by 3. As a way of consequence, 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)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

abc4j API Specification

Submit a bug or feature