-- | Andreas Werckmeister (1645-1706).
module Music.Theory.Tuning.Db.Werckmeister where

import Music.Theory.Tuning {- hmt -}
import Music.Theory.Tuning.Type {- hmt -}

-- | Approximate ratios for 'werckmeister_iii'.
--
-- > let c = [0,90,192,294,390,498,588,696,792,888,996,1092]
-- > in map (round . ratio_to_cents) werckmeister_iii_ar == c
werckmeister_iii_ar :: [Approximate_Ratio]
werckmeister_iii_ar :: [Approximate_Ratio]
werckmeister_iii_ar =
    let c0 :: Approximate_Ratio
c0 = Approximate_Ratio
2 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
2)
        c1 :: Approximate_Ratio
c1 = Approximate_Ratio
2 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
4)
        c2 :: Approximate_Ratio
c2 = Approximate_Ratio
8 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
4)
    in [Approximate_Ratio
1,Approximate_Ratio
256forall a. Fractional a => a -> a -> a
/Approximate_Ratio
243
       ,Approximate_Ratio
64forall a. Fractional a => a -> a -> a
/Approximate_Ratio
81 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0,Approximate_Ratio
32forall a. Fractional a => a -> a -> a
/Approximate_Ratio
27
       ,Approximate_Ratio
256forall a. Fractional a => a -> a -> a
/Approximate_Ratio
243 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1
       ,Approximate_Ratio
4forall a. Fractional a => a -> a -> a
/Approximate_Ratio
3,Approximate_Ratio
1024forall a. Fractional a => a -> a -> a
/Approximate_Ratio
729
       ,Approximate_Ratio
8forall a. Fractional a => a -> a -> a
/Approximate_Ratio
9 forall a. Num a => a -> a -> a
* Approximate_Ratio
c2,Approximate_Ratio
128forall a. Fractional a => a -> a -> a
/Approximate_Ratio
81
       ,Approximate_Ratio
1024forall a. Fractional a => a -> a -> a
/Approximate_Ratio
729 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1,Approximate_Ratio
16forall a. Fractional a => a -> a -> a
/Approximate_Ratio
9
       ,Approximate_Ratio
128forall a. Fractional a => a -> a -> a
/Approximate_Ratio
81 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1]

-- | Cents for 'werckmeister_iii'.
werckmeister_iii_ar_c :: [Cents]
werckmeister_iii_ar_c :: [Approximate_Ratio]
werckmeister_iii_ar_c = forall a b. (a -> b) -> [a] -> [b]
map Approximate_Ratio -> Approximate_Ratio
approximate_ratio_to_cents [Approximate_Ratio]
werckmeister_iii_ar

-- | Werckmeister III, Andreas Werckmeister (1645-1706)
--
-- > cents_i werckmeister_iii == [0,90,192,294,390,498,588,696,792,888,996,1092]
--
-- > import Music.Theory.Tuning.Scala
-- > scl <- scl_load "werck3"
-- > cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_iii
werckmeister_iii :: Tuning
werckmeister_iii :: Tuning
werckmeister_iii = Either [Rational] [Approximate_Ratio]
-> Maybe (Either Rational Approximate_Ratio) -> Tuning
Tuning (forall a b. b -> Either a b
Right [Approximate_Ratio]
werckmeister_iii_ar_c) forall a. Maybe a
Nothing

-- | Approximate ratios for 'werckmeister_iv'.
--
-- > let c = [0,82,196,294,392,498,588,694,784,890,1004,1086]
-- > in map (round . ratio_to_cents) werckmeister_iv_ar == c
werckmeister_iv_ar :: [Approximate_Ratio]
werckmeister_iv_ar :: [Approximate_Ratio]
werckmeister_iv_ar =
    let c0 :: Approximate_Ratio
c0 = Approximate_Ratio
2 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
3)
        c1 :: Approximate_Ratio
c1 = Approximate_Ratio
4 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
3)
    in [Approximate_Ratio
1,Approximate_Ratio
16384forall a. Fractional a => a -> a -> a
/Approximate_Ratio
19683 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0
       ,Approximate_Ratio
8forall a. Fractional a => a -> a -> a
/Approximate_Ratio
9 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0,Approximate_Ratio
32forall a. Fractional a => a -> a -> a
/Approximate_Ratio
27
       ,Approximate_Ratio
64forall a. Fractional a => a -> a -> a
/Approximate_Ratio
81 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1
       ,Approximate_Ratio
4forall a. Fractional a => a -> a -> a
/Approximate_Ratio
3,Approximate_Ratio
1024forall a. Fractional a => a -> a -> a
/Approximate_Ratio
729
       ,Approximate_Ratio
32forall a. Fractional a => a -> a -> a
/Approximate_Ratio
27 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0,Approximate_Ratio
8192forall a. Fractional a => a -> a -> a
/Approximate_Ratio
6561 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0
       ,Approximate_Ratio
256forall a. Fractional a => a -> a -> a
/Approximate_Ratio
243 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1,Approximate_Ratio
9forall a. Fractional a => a -> a -> a
/(Approximate_Ratio
4forall a. Num a => a -> a -> a
*Approximate_Ratio
c0)
       ,Approximate_Ratio
4096forall a. Fractional a => a -> a -> a
/Approximate_Ratio
2187]

-- | Cents for 'werckmeister_iv'.
werckmeister_iv_c :: [Cents]
werckmeister_iv_c :: [Approximate_Ratio]
werckmeister_iv_c = forall a b. (a -> b) -> [a] -> [b]
map Approximate_Ratio -> Approximate_Ratio
approximate_ratio_to_cents [Approximate_Ratio]
werckmeister_iv_ar

-- | Werckmeister IV, Andreas Werckmeister (1645-1706)
--
-- > cents_i werckmeister_iv == [0,82,196,294,392,498,588,694,784,890,1004,1086]
--
-- > scl <- scl_load "werck4"
-- > cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_iv
werckmeister_iv :: Tuning
werckmeister_iv :: Tuning
werckmeister_iv = Either [Rational] [Approximate_Ratio]
-> Maybe (Either Rational Approximate_Ratio) -> Tuning
Tuning (forall a b. b -> Either a b
Right [Approximate_Ratio]
werckmeister_iv_c) forall a. Maybe a
Nothing

-- | Approximate ratios for 'werckmeister_v'.
--
-- > let c = [0,96,204,300,396,504,600,702,792,900,1002,1098]
-- > in map (round . ratio_to_cents) werckmeister_v_ar == c
werckmeister_v_ar :: [Approximate_Ratio]
werckmeister_v_ar :: [Approximate_Ratio]
werckmeister_v_ar =
    let c0 :: Approximate_Ratio
c0 = Approximate_Ratio
2 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
4)
        c1 :: Approximate_Ratio
c1 = Approximate_Ratio
2 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
2)
        c2 :: Approximate_Ratio
c2 = Approximate_Ratio
8 forall a. Floating a => a -> a -> a
** (Approximate_Ratio
1forall a. Fractional a => a -> a -> a
/Approximate_Ratio
4)
    in [Approximate_Ratio
1,Approximate_Ratio
8forall a. Fractional a => a -> a -> a
/Approximate_Ratio
9 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0
       ,Approximate_Ratio
9forall a. Fractional a => a -> a -> a
/Approximate_Ratio
8,Approximate_Ratio
c0
       ,Approximate_Ratio
8forall a. Fractional a => a -> a -> a
/Approximate_Ratio
9 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1
       ,Approximate_Ratio
9forall a. Fractional a => a -> a -> a
/Approximate_Ratio
8 forall a. Num a => a -> a -> a
* Approximate_Ratio
c0,Approximate_Ratio
c1
       ,Approximate_Ratio
3forall a. Fractional a => a -> a -> a
/Approximate_Ratio
2,Approximate_Ratio
128forall a. Fractional a => a -> a -> a
/Approximate_Ratio
81
       ,Approximate_Ratio
c2,Approximate_Ratio
3forall a. Fractional a => a -> a -> a
/Approximate_Ratio
c2
       ,Approximate_Ratio
4forall a. Fractional a => a -> a -> a
/Approximate_Ratio
3 forall a. Num a => a -> a -> a
* Approximate_Ratio
c1]

-- | Cents for 'werckmeister_v'.
werckmeister_v_c :: [Cents]
werckmeister_v_c :: [Approximate_Ratio]
werckmeister_v_c = forall a b. (a -> b) -> [a] -> [b]
map Approximate_Ratio -> Approximate_Ratio
approximate_ratio_to_cents [Approximate_Ratio]
werckmeister_v_ar

-- | Werckmeister V, Andreas Werckmeister (1645-1706)
--
-- > cents_i werckmeister_v == [0,96,204,300,396,504,600,702,792,900,1002,1098]
--
-- > scl <- scl_load "werck5"
-- > cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_v
werckmeister_v :: Tuning
werckmeister_v :: Tuning
werckmeister_v = Either [Rational] [Approximate_Ratio]
-> Maybe (Either Rational Approximate_Ratio) -> Tuning
Tuning (forall a b. b -> Either a b
Right [Approximate_Ratio]
werckmeister_v_c) forall a. Maybe a
Nothing

-- | Ratios for 'werckmeister_vi', with supposed correction of 28/25 to 49/44.
--
-- > let c = [0,91,186,298,395,498,595,698,793,893,1000,1097]
-- > in map (round . ratio_to_cents) werckmeister_vi_r == c
werckmeister_vi_r :: [Rational]
werckmeister_vi_r :: [Rational]
werckmeister_vi_r =
    [Rational
1,Rational
98forall a. Fractional a => a -> a -> a
/Rational
93
    ,Rational
49forall a. Fractional a => a -> a -> a
/Rational
44 {- 28/25 -},Rational
196forall a. Fractional a => a -> a -> a
/Rational
165
    ,Rational
49forall a. Fractional a => a -> a -> a
/Rational
39
    ,Rational
4forall a. Fractional a => a -> a -> a
/Rational
3,Rational
196forall a. Fractional a => a -> a -> a
/Rational
139
    ,Rational
196forall a. Fractional a => a -> a -> a
/Rational
131,Rational
49forall a. Fractional a => a -> a -> a
/Rational
31
    ,Rational
196forall a. Fractional a => a -> a -> a
/Rational
117,Rational
98forall a. Fractional a => a -> a -> a
/Rational
55
    ,Rational
49forall a. Fractional a => a -> a -> a
/Rational
26]

-- | Werckmeister VI, Andreas Werckmeister (1645-1706)
--
-- > cents_i werckmeister_vi == [0,91,186,298,395,498,595,698,793,893,1000,1097]
--
-- > scl <- scl_load "werck6"
-- > cents_i (scale_tuning 0.01 scl) == cents_i werckmeister_vi
werckmeister_vi :: Tuning
werckmeister_vi :: Tuning
werckmeister_vi = Either [Rational] [Approximate_Ratio]
-> Maybe (Either Rational Approximate_Ratio) -> Tuning
Tuning (forall a b. a -> Either a b
Left [Rational]
werckmeister_vi_r) forall a. Maybe a
Nothing