hmt-0.20: Haskell Music Theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Music.Theory.Z.Clough_1979

Contents

Description

John Clough. "Aspects of Diatonic Sets". _Journal of Music Theory_, 23(1):45--61, 1979.

Synopsis

Documentation

transpose_to_zero :: Num n => [n] -> [n] Source #

Shift sequence so the initial value is zero.

transpose_to_zero [1,2,5] == [0,1,4]

dpcset_to_chord :: Integral n => [n] -> [n] Source #

Diatonic pitch class (Z7) set to chord.

map dpcset_to_chord [[0,1],[0,2,4],[2,3,4,5,6]] == [[1,6],[2,2,3],[1,1,1,1,3]]

chord_to_dpcset :: Integral n => [n] -> [n] Source #

Inverse of dpcset_to_chord.

map chord_to_dpcset [[1,6],[2,2,3]] == [[0,1],[0,2,4]]

dpcset_complement :: Integral n => [n] -> [n] Source #

Complement, ie. in relation to z7_univ.

map dpcset_complement [[0,1],[0,2,4]] == [[2,3,4,5,6],[1,3,5,6]]

is_ic :: Integral n => n -> Bool Source #

Interval class predicate (ie. is_z4).

map is_ic [-1 .. 4] == [False,True,True,True,True,False]

i_to_ic :: Integral n => n -> n Source #

Interval to interval class.

map i_to_ic [0..7] == [0,1,2,3,3,2,1,0]

is_chord :: Integral n => [n] -> Bool Source #

Is chord, ie. is sum 7.

is_chord [2,2,3]

iv :: Integral n => [n] -> [n] Source #

Interval vector, given list of intervals.

iv [2,2,3] == [0,2,1]

inf_cmp :: Ord a => [a] -> [a] -> Ordering Source #

Comparison function for inv.

inf :: Integral n => [n] -> [n] Source #

Interval normal form.

map inf [[2,2,3],[1,2,4],[2,1,4]] == [[2,2,3],[1,2,4],[2,1,4]]

invert :: [n] -> [n] Source #

Inverse of chord (retrograde).

let p = [1,2,4] in (inf p,invert p,inf (invert p)) == ([1,2,4],[4,2,1],[2,1,4])

complement :: Integral n => [n] -> [n] Source #

Complement of chord.

let r = [[1,1,1,1,3],[1,1,1,2,2],[1,1,2,1,2],[1,1,1,4],[2,1,1,3],[1,2,1,3],[1,2,2,2]]
in map complement [[1,6],[2,5],[3,4],[1,1,5],[1,2,4],[1,3,3],[2,2,3]] == r

iseq :: Integral n => [n] -> [n] Source #

Z7 pitch sequence to Z7 interval sequence, ie. mod7 of d_dx.

map iseq (permutations [0,1,2]) == [[1,1],[6,2],[6,6],[1,5],[5,1],[2,6]]
map iseq (permutations [0,1,3]) == [[1,2],[6,3],[5,6],[2,4],[4,1],[3,5]]
map iseq (permutations [0,2,3]) == [[2,1],[5,3],[6,5],[1,4],[4,2],[3,6]]
map iseq (permutations [0,1,4]) == [[1,3],[6,4],[4,6],[3,3],[3,1],[4,4]]
map iseq (permutations [0,2,4]) == [[2,2],[5,4],[5,5],[2,3],[3,2],[4,5]]

Z

is_z_n :: Integral n => n -> n -> Bool Source #

Is n in (0,m - 1).

z_n_univ :: Integral n => n -> [n] Source #

Z m universe, ie [0 .. m-1].

is_z4 :: Integral n => n -> Bool Source #

is_z_n of 4.

z7_univ :: Integral n => [n] Source #

z_n_univ of 7.

z7_univ == [0 .. 6]

is_z7 :: Integral n => n -> Bool Source #

is_z_n of 7.

mod7 :: Integral n => n -> n Source #

mod 7.