com.soundhelix.misc
Class Structure

java.lang.Object
  extended by com.soundhelix.misc.Structure

public class Structure
extends Object

Defines the immutable logical structure of a song. The logical structure consists of the song's signature details (internal note quantization, song length, etc.). The main unit is a beat. Beats are divided into ticks (usually 4 ticks form a beat), and beats are grouped into bars (usually 4 beats form a bar), and an integer number of bars forms the song. Ticks are the smallest units of a song. The song signature is defined by specifying the total number of bars, the number of beats per bar and the number of ticks per beat. Each point in time within the song is addressed by its tick number (counted from 0). Beats, bars, ticks within a beat and beats within a bar can be derived by using the ticks per beat and the beats per bar, if necessary. Each component must be ready to handle at least the following ticks per beat: 1, 2, 3, 4, 6, 8, 12, 16. For most music types, 3 (3/4 bars) or 4 (4/4 bars) ticks per beat will be fine. In order to mix 3/4 with 4/4 notes, one might consider using 12 ticks per beat, so that quarter notes (3 ticks) and third notes (4 ticks) can be used at the same time.

Author:
Thomas Schuerger (thomas@schuerger.com)

Constructor Summary
Structure(int bars, int beatsPerBar, int ticksPerBeat)
          Constructor.
 
Method Summary
 int getBars()
           
 int getBeatsPerBar()
           
 int getTicks()
           
 int getTicksPerBar()
           
 int getTicksPerBeat()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Structure

public Structure(int bars,
                 int beatsPerBar,
                 int ticksPerBeat)
Constructor.

Parameters:
bars - the number of bars
beatsPerBar - the number of beats per bar
ticksPerBeat - the number of ticks per beat
Method Detail

getBeatsPerBar

public int getBeatsPerBar()

getTicksPerBeat

public int getTicksPerBeat()

getTicks

public int getTicks()

getTicksPerBar

public int getTicksPerBar()

getBars

public int getBars()