This module translates Pitch Class Sets to and from Compact Format. In Compact Format, data such as StdSet [0,4,7,11] could be represented by the string 047B, which uses a single alphanumeric character for each pitch class element.
Limitations: this module is only usable for pitch class sets of modulus 36 or below. Beyond that, it's not really certain that a compact format would be of any practical use.
Constructors: Compact Format to PcSet
toGenSet :: Int -> String -> GenSetSource
Creates a new General Pitch Class Set of modulus n. Alphanumeric character values 0-9 and A-Z represent the numbers 0 to 36. Other inputs, including whitespace, are ignored.
toStdSet :: String -> StdSetSource
Creates a new Standard (modulus 12) Pitch Class Set. Here, input characters 0-9 count as their decimal equivalents; the letter A stands for 10, and the letter B stands for 11. Other inputs, including whitespace, are ignored.
toStdSet' :: String -> StdSetSource
Creates a new Standard (modulus 12) Pitch Class Set, using an alternative duodecimal format. Here, input characters 0-9 count as their decimal equivalents; the letter T stands for 10, and the letter E stands for 11. Other inputs, including whitespace, are ignored.
toGenRow :: Int -> String -> GenRowSource
Creates a new General Tone Row of modulus n. Alphanumeric character values 0-9 and A-Z represent the numbers 0 to 36. Other inputs, including whitespace, are ignored. Since Tone Rows must contain all possible elements, an incomplete entry list will result in a new row with the missing tones added at the end.
toStdRow :: String -> StdRowSource
Creates a new Standard (modulus 12) Tone Row. Here, input characters 0-9
count as their decimal equivalents; the letter A stands for 10, and
the letter B stands for 11. Other inputs, including whitespace, are
ignored. (Also, see notes for toGenRow
.)
toStdRow' :: String -> StdRowSource
Creates a new Standard (modulus 12) Tone Row, using an alternative
duodecimal format. Here, input characters 0-9 count as their decimal
equivalents; the letter T stands for 10, and the letter E stands for
11. Other inputs, including whitespace, are ignored. (Also, see notes for
toGenRow
.)
Abbreviators: PcSet to Compact Format
compact :: PcSet a => a -> StringSource
Translates a Pitch Class Set or Tone Row to Compact Format. Values from 0-9 are translated as the characters 0-9; values from 10 to 35 are translated as charaters A-Z. Values which are out of the representable range are ignored, therefore this function is not suitable for sets of modulus 37 or greater.