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

Music.Theory.Z.Forte_1973

Description

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

Synopsis

Prime form

z_t_rotations :: Integral i => Z i -> [i] -> [[i]] Source #

T-related rotations of p, ie. all rotations tranposed to be at zero.

z_t_rotations z12 [1,2,4] == [[0,1,3],[0,2,11],[0,9,10]]

z_ti_rotations :: Integral i => Z i -> [i] -> [[i]] Source #

T/I-related rotations of p.

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

z_t_cmp_prime :: Integral i => Z i -> ([i] -> [i] -> Ordering) -> [i] -> [i] Source #

Prime form rule requiring comparator, considering t_rotations.

z_ti_cmp_prime :: Integral i => Z i -> ([i] -> [i] -> Ordering) -> [i] -> [i] 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

z_forte_prime :: Integral i => Z i -> [i] -> [i] Source #

Forte prime form, ie. z_ti_cmp_prime of forte_cmp.

z_forte_prime z12 [0,1,3,6,8,9] == [0,1,3,6,8,9]
z_forte_prime z5 [0,1,4] == [0,1,2]
z_forte_prime z5 [0,1,1] -- ERROR
S.set (map (z_forte_prime z5) (S.powerset [0..4]))
S.set (map (z_forte_prime z7) (S.powerset [0..6]))

z_t_prime :: Integral i => Z i -> [i] -> [i] Source #

Transpositional equivalence prime form, ie. z_t_cmp_prime of forte_cmp.

(z_forte_prime z12 [0,2,3],z_t_prime z12 [0,2,3]) == ([0,1,3],[0,2,3])

ICV Metric

z_ic :: Integral i => Z i -> i -> i Source #

Interval class of interval i.

map (z_ic z12) [0..12] == [0,1,2,3,4,5,6,5,4,3,2,1,0]
map (z_ic z7) [0..7] == [0,1,2,3,3,2,1,0]
map (z_ic z5) [0..5] == [0,1,2,2,1,0]
map (z_ic z12) [5,6,7] == [5,6,5]
map (z_ic z12) [-13,-1,0,1,13] == [1,1,0,1,1]

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

Forte notation for interval class vector.

z_icv z12 [0,1,2,4,7,8] == [3,2,2,3,3,2]

BIP Metric

z_bip :: Integral i => Z i -> [i] -> [i] Source #

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

>>> bip 0t95728e3416
11223344556
z_bip z12 [0,10,9,5,7,2,8,11,3,4,1,6] == [1,1,2,2,3,3,4,4,5,5,6]

z_sc_univ :: Integral i => Z i -> [[i]] Source #

Generate SC universe, though not in order of the Forte table.

length (z_sc_univ z7) == 18
sort (z_sc_univ z12) == sort (map snd sc_table)
zipWith (\p q -> (p == q,p,q)) (z_sc_univ z12) (map snd sc_table)

Forte Names (Z12)

type SC_Name = String Source #

Synonym for String.

type SC_Table n = [(SC_Name, [n])] Source #

Table of (SC-NAME,PCSET).

sc_table :: Num n => SC_Table n Source #

The Z12 set-class table (Forte prime forms).

length sc_table == 224

sc_table_unicode :: Num n => SC_Table n Source #

Unicode (non-breaking hyphen) variant.

forte_prime_name :: (Num n, Eq n) => [n] -> (SC_Name, [n]) Source #

Lookup name of prime form of set class. It is an error for the input not to be a forte prime form.

forte_prime_name [0,1,4,6] == ("4-Z15",[0,1,4,6])

sc_tbl_lookup :: Integral i => SC_Table i -> [i] -> Maybe (SC_Name, [i]) Source #

Lookup entry for set in table.

sc_tbl_lookup_err :: Integral i => SC_Table i -> [i] -> (SC_Name, [i]) Source #

Erroring variant

sc_name :: Integral i => [i] -> SC_Name Source #

Lookup a set-class name. The input set is subject to forte_prime of z12 before lookup.

sc_name [0,2,3,6,7] == "5-Z18"
sc_name [0,1,4,6,7,8] == "6-Z17"

sc_name_long :: Integral i => [i] -> SC_Name Source #

Long name (ie. with enumeration of prime form).

sc_name_long [0,1,4,6,7,8] == "6-Z17[012478]"

sc_name_unicode :: Integral i => [i] -> SC_Name Source #

Unicode (non-breaking hyphen) variant.

sc :: Num n => SC_Name -> [n] Source #

Lookup a set-class given a set-class name.

sc "6-Z17" == [0,1,2,4,7,8]

scs :: Num n => [[n]] Source #

The set-class table (Forte prime forms), ie. snd of sc_table.

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

Cardinality n subset of scs.

map (length . scs_n) [1..11] == [1,6,12,29,38,50,38,29,12,6,1]

tics :: Integral i => Z i -> [i] -> [Int] Source #

Vector indicating degree of intersection with inversion at each transposition.

tics z12 [0,2,4,5,7,9] == [3,2,5,0,5,2,3,4,1,6,1,4]
map (tics z12) scs

Z-relation

z_relation_of :: Integral i => [i] -> Maybe [i] Source #

Locate Z relation of set class.

fmap sc_name (z_relation_of (sc "7-Z12")) == Just "7-Z36"