DixShtix

com.dixshtix.midi
Class TimeSignature

java.lang.Object
  |
  +--com.dixshtix.midi.BinaryData
        |
        +--com.dixshtix.midi.TimeSignature

public class TimeSignature
extends BinaryData

TimeSignature is complex.
Most sequencers time-stamp MIDI data in terms of "clock pulses". For example, a sequencer may have a clock resolution of 96 pulses per quarter note. This means that 96 clock pulses are counted off for the duration of each quarter note (ie, a quarter note is held for 96 pulses). Because an eighth note is half as long as a quarter note, this means that an eighth note is held for 48 clock pulses. Since a half note is twice as long as a quarter note, the half note is held for 192 clock pulses.
The charts below show how many clock pulses are in each note value for various PPQN (pulses per quarter note) resolutions. For example, the first chart is used if your sequencer has a 96 PPQN clock resolution. Note values start with a whole note and diminish down to a 128th note. (Some PPQN resolution do not divide evenly to support certain note values. An unsupported note value is indicated by --).
96 PPQN
Whole 384 Dotted Whole 576 Whole Triplet 256
Half 192 Dotted Half 288 Half Triplet 128
Quarter 96 Dotted Quarter 144 Quarter Triplet 64
Eighth 48 Dotted Eighth 72 Eighth Triplet 32
16th 24 Dotted 16th 36 16th Triplet 16
32nd 12 Dotted 32nd 18 32nd Triplet 8
64th 6 Dotted 64th 9 64th Triplet 4
128th 3 Dotted 128th -- 128th Triplet 2
192 PPQN
Whole 768 Dotted Whole 1152 Whole Triplet 512
Half 384 Dotted Half 576 Half Triplet 256
Quarter192 Dotted Quarter 288 Quarter Triplet128
Eighth 96 Dotted Eighth 144 Eighth Triplet 64
16th 48 Dotted 16th 72 16th Triplet 32
32nd 24 Dotted 32nd 36 32nd Triplet 16
64th 12 Dotted 64th 18 64th Triplet 8
128th 6 Dotted 128th 9 128th Triplet 4
240 PPQN
Whole 960 Dotted Whole 1440 Whole Triplet 640
Half 480 Dotted Half 720 Half Triplet 320
Quarter240 Dotted Quarter 360 Quarter Triplet160
Eighth 120 Dotted Eighth 180 Eighth Triplet 80
16th 60 Dotted 16th 90 16th Triplet 40
32nd 30 Dotted 32nd 45 32nd Triplet 20
64th 15 Dotted 64th -- 64th Triplet 10
128th -- Dotted 128th -- 128th Triplet 5
384 PPQN
Whole 1536 Dotted Whole 2304 Whole Triplet 1024
Half 768 Dotted Half 1152 Half Triplet 512
Quarter384 Dotted Quarter 576 Quarter Triplet256
Eighth 192 Dotted Eighth 288 Eighth Triplet 128
16th 96 Dotted 16th 144 16th Triplet 64
32nd 48 Dotted 32nd 72 32nd Triplet 32
64th 24 Dotted 64th 36 64th Triplet 16
128th 12 Dotted 128th 18 128th Triplet 8

Version:
0.1
Author:
Richard C. Penner II
See Also:
EventStatus.kmbTimeSignature, EventType.kTimeSignature

Fields inherited from class com.dixshtix.midi.BinaryData
data, maxPrintLength
 
Constructor Summary
TimeSignature(byte num, byte dpower)
          Simple Constructor.
TimeSignature(byte num, byte dpower, byte clocks_per_metro)
          Constructor with Metronome.
TimeSignature(byte num, byte dpower, byte clocks_per_metro, byte clocks_per_qnote)
          Constructor.
 
Method Summary
 java.lang.String toString()
          Produce a short, human-readable string.
 
Methods inherited from class com.dixshtix.midi.BinaryData
getData, getData, getLength, getMaxPrintLength, hashCode, setMaxPrintLength, simpleClass
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

TimeSignature

public TimeSignature(byte num,
                     byte dpower,
                     byte clocks_per_metro,
                     byte clocks_per_qnote)
Constructor.
Example Time Signatures based on 192 ticks per qnote
2/2might beTimeSignature(2,1,24,8).
3/4might beTimeSignature(3,2,24,8).
4/4might beTimeSignature(4,2,24,8).
5/4might beTimeSignature(5,2,24,8).
6/8might beTimeSignature(6,3,24,8).
6/8might beTimeSignature(6,3,36,8).Metronome on the dotted quarter note.

Parameters:
num - The numerator.
dpower - The denominator in log base 2 form; 1->2, 2->4, 3->8, etc.
clocks_per_metro - (default 24) expresses the number of MIDI clocks in a metronome click. A midi clock is 1/24 of a midi quarter note.
clocks_per_qnote - (default 8) expresses the number of notated 32nd notes in a MIDI quarter note (24 MIDI clocks).

TimeSignature

public TimeSignature(byte num,
                     byte dpower,
                     byte clocks_per_metro)
Constructor with Metronome.

Parameters:
num - The numerator.
dpower - The denominator in log base 2 form; 1->2, 2->4, 3->8, etc.
clocks_per_metro - (default 24) expresses the number of MIDI clocks in a metronome click. A midi clock is 1/24 of a midi quarter note.

TimeSignature

public TimeSignature(byte num,
                     byte dpower)
Simple Constructor.

Parameters:
num - The numerator.
dpower - The denominator in log base 2 form; 1->2, 2->4, 3->8, etc.
Method Detail

toString

public java.lang.String toString()
Produce a short, human-readable string.
Overrides:
toString in class BinaryData
Following copied from class: com.dixshtix.midi.BinaryData
See Also:
BinaryData.maxPrintLength

DixShtix