Safe Haskell | Safe |
---|---|

Language | Haskell98 |

Serial (ordered) pitch-class operations on `Z`

.

- data SRO t = SRO {}
- sro_pp :: Show t => SRO t -> String
- p_sro :: Integral t => GenParser Char () (SRO t)
- sro_parse :: Integral i => String -> SRO i
- z_sro_univ :: Integral i => Int -> Z i -> [SRO i]
- z_sro_Tn :: Integral i => Z i -> [SRO i]
- z_sro_TnI :: Integral i => Z i -> [SRO i]
- z_sro_RTnI :: Integral i => Z i -> [SRO i]
- z_sro_TnMI :: Integral i => Z i -> [SRO i]
- z_sro_RTnMI :: Integral i => Z i -> [SRO i]
- z_sro_apply :: Integral i => i -> Z i -> SRO i -> [i] -> [i]
- z_sro_tn :: (Integral i, Functor f) => Z i -> i -> f i -> f i
- z_sro_invert :: (Integral i, Functor f) => Z i -> i -> f i -> f i
- z_sro_tni :: (Integral i, Functor f) => Z i -> i -> f i -> f i
- z_sro_mn :: (Integral i, Functor f) => Z i -> i -> f i -> f i
- z_sro_t_related :: (Integral i, Functor f) => Z i -> f i -> [f i]
- z_sro_ti_related :: (Eq (f i), Integral i, Functor f) => Z i -> f i -> [f i]
- z_sro_rti_related :: Integral i => Z i -> [i] -> [[i]]
- z_sro_tn_to :: Integral i => Z i -> i -> [i] -> [i]
- z_sro_invert_ix :: Integral i => Z i -> Int -> [i] -> [i]
- z_tmatrix :: Integral i => Z i -> [i] -> [[i]]

# Documentation

Serial operator,of the form rRTMI.

sro_parse :: Integral i => String -> SRO i Source #

Parse a Morris format serial operator descriptor.

sro_parse "r2RT3MI" == SRO 2 True 3 True True

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

The total set of serial operations.

let u = z_sro_univ 3 mod12 zip (map sro_pp u) (map (\o -> z_sro_apply 5 mod12 o [0,1,3]) u)

z_sro_RTnI :: Integral i => Z i -> [SRO i] Source #

The set of retrograde and transposition and inversion `SRO`

s.

z_sro_RTnMI :: Integral i => Z i -> [SRO i] Source #

The set of retrograde,transposition,`M5`

and inversion `SRO`

s.

# Serial operations

z_sro_apply :: Integral i => i -> Z i -> SRO i -> [i] -> [i] Source #

Apply SRO. M is ordinarily 5, but can be specified here.

z_sro_apply 5 mod12 (SRO 1 True 1 True False) [0,1,2,3] == [11,6,1,4] z_sro_apply 5 mod12 (SRO 1 False 4 True True) [0,1,2,3] == [11,6,1,4]

z_sro_tn :: (Integral i, Functor f) => Z i -> i -> f i -> f i Source #

Transpose *p* by *n*.

z_sro_tn mod5 4 [0,1,4] == [4,0,3] z_sro_tn mod12 4 [1,5,6] == [5,9,10]

z_sro_invert :: (Integral i, Functor f) => Z i -> i -> f i -> f i Source #

Invert *p* about *n*.

z_sro_invert mod5 0 [0,1,4] == [0,4,1] z_sro_invert mod12 6 [4,5,6] == [8,7,6] z_sro_invert mod12 0 [0,1,3] == [0,11,9]

import Data.Word {- base -} z_sro_invert mod12 (0::Word8) [1,4,8]

z_sro_tni :: (Integral i, Functor f) => Z i -> i -> f i -> f i Source #

Composition of `invert`

about `0`

and `tn`

.

z_sro_tni mod5 1 [0,1,3] == [1,0,3] z_sro_tni mod12 4 [1,5,6] == [3,11,10] (z_sro_invert mod12 0 . z_sro_tn mod12 4) [1,5,6] == [7,3,2]

z_sro_mn :: (Integral i, Functor f) => Z i -> i -> f i -> f i Source #

Modulo multiplication.

z_sro_mn mod12 11 [0,1,4,9] == z_tni mod12 0 [0,1,4,9]

z_sro_t_related :: (Integral i, Functor f) => Z i -> f i -> [f i] Source #

T-related sequences of *p*.

length (z_sro_t_related mod12 [0,3,6,9]) == 12 z_sro_t_related mod5 [0,2] == [[0,2],[1,3],[2,4],[3,0],[4,1]]

z_sro_ti_related :: (Eq (f i), Integral i, Functor f) => Z i -> f i -> [f i] Source #

T/I-related sequences of *p*.

length (z_sro_ti_related mod12 [0,1,3]) == 24 length (z_sro_ti_related mod12 [0,3,6,9]) == 24 z_sro_ti_related mod12 [0] == map return [0..11]

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

R/T/I-related sequences of *p*.

length (z_sro_rti_related mod12 [0,1,3]) == 48 length (z_sro_rti_related mod12 [0,3,6,9]) == 24

# Sequence operations

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

Variant of `tn`

, transpose *p* so first element is *n*.

z_sro_tn_to mod12 5 [0,1,3] == [5,6,8] map (z_sro_tn_to mod12 0) [[0,1,3],[1,3,0],[3,0,1]]