Safe Haskell | None |
---|

Tuning tables

- octpc_to_pitch_cps :: Floating n => OctPC -> (Pitch, n)
- tbl_12et :: [(Pitch, Double)]
- tbl_24et :: [(Pitch, Double)]
- bounds_et_table :: Ord s => [(t, s)] -> s -> Maybe ((t, s), (t, s))
- bounds_12et_tone :: Double -> Maybe ((Pitch, Double), (Pitch, Double))
- type HS_R = (Double, Pitch, Double, Double, Cents)
- nearest_et_table_tone :: [(Pitch, Double)] -> Double -> HS_R
- nearest_12et_tone :: Double -> HS_R
- nearest_24et_tone :: Double -> HS_R
- ndp :: Int -> Double -> String
- hs_r_cell :: Int -> (Int -> String) -> [HS_R] -> (Int, Int) -> Table_Cell

# Equal temperament

octpc_to_pitch_cps :: Floating n => OctPC -> (Pitch, n)Source

tbl_12et :: [(Pitch, Double)]Source

12-tone equal temperament table equating `Pitch`

and frequency
over range of human hearing, where `A4`

= `440`

hz.

length tbl_12et == 132 min_max (map (round . snd) tbl_12et) == (16,31609)

tbl_24et :: [(Pitch, Double)]Source

24-tone equal temperament variant of `tbl_12et`

.

length tbl_24et == 264 min_max (map (round . snd) tbl_24et) == (16,32535)

bounds_et_table :: Ord s => [(t, s)] -> s -> Maybe ((t, s), (t, s))Source

Given an `ET`

table (or like) find bounds of frequency.

let r = Just (at_pair octpc_to_pitch_cps ((3,11),(4,0))) in bounds_et_table tbl_12et 256 == r

bounds_12et_tone :: Double -> Maybe ((Pitch, Double), (Pitch, Double))Source

map bounds_12et_tone (hsn 17 55)

nearest_et_table_tone :: [(Pitch, Double)] -> Double -> HS_RSource

Form `HS_R`

for *frequency* by consulting table.

let {f = 256 ;f' = octpc_to_cps (4,0) ;r = (f,Pitch C Natural 4,f',f-f',to_cents (f/f'))} in nearest_et_table_tone tbl_12et 256 == r