hmt-0.15: Haskell Music Theory

Safe Haskell | Safe
Language | Haskell98

Music.Theory.Z.Forte_1973

Contents

- Prime form
- ICV Metric
- BIP Metric

Description

Allen Forte. The Structure of Atonal Music. Yale University Press, New Haven, 1973.

Synopsis

- t_rotations :: Integral a => a -> [a] -> [[a]]
- ti_rotations :: Integral a => a -> [a] -> [[a]]
- minimumBy_or :: a -> (a -> a -> Ordering) -> [a] -> a
- t_cmp_prime :: Integral a => a -> ([a] -> [a] -> Ordering) -> [a] -> [a]
- ti_cmp_prime :: Integral a => a -> ([a] -> [a] -> Ordering) -> [a] -> [a]
- forte_cmp :: Ord t => [t] -> [t] -> Ordering
- forte_prime :: Integral a => a -> [a] -> [a]
- t_prime :: Integral a => a -> [a] -> [a]
- ic :: Integral a => a -> a -> a
- icv :: (Integral i, Num n) => i -> [i] -> [n]
- bip :: Integral a => a -> [a] -> [a]

# Prime form

t_rotations :: Integral a => a -> [a] -> [[a]] Source #

T-related rotations of p.

    t_rotations 12 [0,1,3] == [[0,1,3],[0,2,11],[0,9,10]]

ti_rotations :: Integral a => a -> [a] -> [[a]] Source #

T/I-related rotations of p.

    ti_rotations 12 [0,1,3] == [[0,1,3],[0,2,11],[0,9,10]
                               ,[0,9,11],[0,2,3],[0,1,10]]

minimumBy_or :: a -> (a -> a -> Ordering) -> [a] -> a Source #

Variant with default value for empty input list case.

t_cmp_prime :: Integral a => a -> ([a] -> [a] -> Ordering) -> [a] -> [a] Source #

Prime form rule requiring comparator, considering `t_rotations`.

ti_cmp_prime :: Integral a => a -> ([a] -> [a] -> Ordering) -> [a] -> [a] Source #

Prime form rule requiring comparator, considering `ti_rotations`.

forte_cmp :: Ord t => [t] -> [t] -> Ordering Source #

Forte comparison function (rightmost first then leftmost outwards).

    forte_cmp [0,1,3,6,8,9] [0,2,3,6,7,9] == LT

forte_prime :: Integral a => a -> [a] -> [a] Source #

Forte prime form, ie. `cmp_prime` of `forte_cmp`.

    forte_prime 12 [0,1,3,6,8,9] == [0,1,3,6,8,9]
    forte_prime 5 [0,1,4] == [0,1,2]

    S.set (map (forte_prime 5) (S.powerset [0..4]))

t_prime :: Integral a => a -> [a] -> [a] Source #

Transpositional equivalence prime form, ie. `t_cmp_prime` of `forte_cmp`.

    (forte_prime 12 [0,2,3],t_prime 12 [0,2,3]) == ([0,1,3],[0,2,3])

# ICV Metric

ic :: Integral a => a -> a -> a Source #

Interval class of i interval i.

    map (ic 5) [1,2,3,4] == [1,2,2,1]
    map (ic 12) [5,6,7] == [5,6,5]
    map (ic 12 . to_Z 12) [-13,-1,0,1,13] == [1,1,0,1,1]

icv :: (Integral i, Num n) => i -> [i] -> [n] Source #

Forte notation for interval class vector.

    icv 12 [0,1,2,4,7,8] == [3,2,2,3,3,2]

# BIP Metric

bip :: Integral a => a -> [a] -> [a] Source #

Basic interval pattern, see Allen Forte "The Basic Interval Patterns" JMT 17/2 (1973):234-272

    >>> bip 0t95728e3416
    11223344556

    bip 12 [0,10,9,5,7,2,8,11,3,4,1,6] == [1,1,2,2,3,3,4,4,5,5,6]