Music.Theory.Time_Signature

Description

Time Signatures.

Synopsis

# Documentation

type Time_Signature = (Integer, Integer) Source #

A Time Signature is a (numerator,denominator) pair.

Tied, non-multiplied durations to fill a whole measure.

ts_whole_note (3,8) == [dotted_quarter_note]
ts_whole_note (2,2) == [whole_note]

Duration of measure in RQ.

map ts_whole_note_rq [(3,8),(2,2)] == [3/2,4]

Duration, in RQ, of a measure of indicated Time_Signature.

map ts_rq [(3,4),(5,8)] == [3,5/2]

compare on ts_rq.

Time_Signature derived from whole note duration in RQ form.

map rq_to_ts [4,3/2,7/4,6] == [(4,4),(3,8),(7,16),(6,4)]

Uniform division of time signature.

ts_divisions (3,4) == [1,1,1]
ts_divisions (3,8) == [1/2,1/2,1/2]
ts_divisions (2,2) == [2,2]
ts_divisions (1,1) == [4]
ts_divisions (7,4) == [1,1,1,1,1,1,1]

Convert a duration to a pulse count in relation to the indicated time signature.

ts_duration_pulses (3,8) quarter_note == 2

Rewrite time signature to indicated denominator.

ts_rewrite 8 (3,4) == (6,8)

Sum time signatures.

ts_sum [(3,16),(1,2)] == (11,16)

# Composite Time Signatures

A composite time signature is a sequence of Time_Signatures.

The RQ is the sum of ts_rq of the elements.

cts_rq [(3,4),(1,8)] == 3 + 1/2

The divisions are the concat of the ts_divisions of the elements.

cts_divisions [(3,4),(1,8)] == [1,1,1,1/2]

Pulses are 1-indexed, RQ locations are 0-indexed.

map (cts_pulse_to_rq [(2,4),(1,8),(1,4)]) [1 .. 4] == [0,1,2,2 + 1/2]

Variant that gives the window of the pulse (ie. the start location and the duration).

let r = [(0,1),(1,1),(2,1/2),(2 + 1/2,1)]
in map (cts_pulse_to_rqw [(2,4),(1,8),(1,4)]) [1 .. 4] == r

# Rational Time Signatures

A rational time signature is a Composite_Time_Signature where the parts are Rational.

The sum of the RQ of the elements.

rts_rq [(3,4),(1,8)] == 3 + 1/2
rts_rq [(3/2,4),(1/2,8)] == 3/2 + 1/4

The divisions of the elements.

rts_divisions [(3,4),(1,8)] == [1,1,1,1/2]
rts_divisions [(3/2,4),(1/2,8)] == [1,1/2,1/4]

Pulses are 1-indexed, RQ locations are 0-indexed.

map (rts_pulse_to_rq [(2,4),(1,8),(1,4)]) [1 .. 4] == [0,1,2,2 + 1/2]
map (rts_pulse_to_rq [(3/2,4),(1/2,8),(1/4,4)]) [1 .. 4] == [0,1,3/2,7/4]

Variant that gives the window of the pulse (ie. the start location and the duration).

let r = [(0,1),(1,1),(2,1/2),(2 + 1/2,1)]
in map (rts_pulse_to_rqw [(2,4),(1,8),(1,4)]) [1 .. 4] == r