Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Tuning type
Synopsis
- data Tuning = Tuning {}
- tn_epsilon :: Double
- tn_as_ratio :: Double -> Either Rational Cents -> Rational
- tn_as_cents :: Either Rational Cents -> Cents
- tn_octave_def :: Tuning -> Either Rational Cents
- tn_octave_cents :: Tuning -> Cents
- tn_octave_ratio :: Double -> Tuning -> Rational
- tn_divisions :: Tuning -> Int
- tn_ratios :: Tuning -> Maybe [Rational]
- tn_limit :: Tuning -> Maybe Integer
- tn_ratios_err :: Tuning -> [Rational]
- tn_cents :: Tuning -> [Cents]
- tn_cents_i :: Integral i => Tuning -> [i]
- tn_cents_octave :: Tuning -> [Cents]
- tn_fmidi :: Tuning -> [Double]
- tn_approximate_ratios :: Tuning -> [Approximate_Ratio]
- tn_approximate_ratios_cyclic :: Tuning -> [Approximate_Ratio]
- tn_ratios_lookup :: Tuning -> Int -> Maybe Rational
- tn_approximate_ratios_lookup :: Tuning -> Int -> Approximate_Ratio
- tn_reconstructed_ratios :: Double -> Tuning -> Maybe [Rational]
- tn_equal_temperament :: Integral n => n -> Tuning
- tn_equal_temperament_12 :: Tuning
- tn_equal_temperament_19 :: Tuning
- tn_equal_temperament_31 :: Tuning
- tn_equal_temperament_53 :: Tuning
- tn_equal_temperament_72 :: Tuning
- tn_equal_temperament_96 :: Tuning
Tuning
A tuning specified Either
as a sequence of exact ratios, or as
a sequence of possibly inexact Cents
, and an octave if not 2:1 or 1200.
In both cases, the values are given in relation to the first degree of the scale, which for ratios is 1 and for cents 0.
tn_epsilon :: Double Source #
Default epsilon for recovering ratios from cents.
tn_as_ratio :: Double -> Either Rational Cents -> Rational Source #
Tuning value as rational, reconstructed if required.
tn_octave_cents :: Tuning -> Cents Source #
Tuning octave in cents.
tn_divisions :: Tuning -> Int Source #
Divisions of octave.
tn_divisions (tn_equal_temperament 12) == 12
tn_approximate_ratios :: Tuning -> [Approximate_Ratio] Source #
Possibly inexact Approximate_Ratio
s of tuning.
tn_approximate_ratios_cyclic :: Tuning -> [Approximate_Ratio] Source #
Cyclic form, taking into consideration octave_ratio
.
tn_ratios_lookup :: Tuning -> Int -> Maybe Rational Source #
Lookup function that allows both negative & multiple octave indices.
:l Music.Theory.Tuning.DB.Werckmeister let map_zip f l = zip l (map f l) map_zip (tn_ratios_lookup werckmeister_vi) [-24 .. 24]
tn_approximate_ratios_lookup :: Tuning -> Int -> Approximate_Ratio Source #
Lookup function that allows both negative & multiple octave indices.
map_zip (tn_approximate_ratios_lookup werckmeister_v) [-24 .. 24]
Equal temperaments
tn_equal_temperament :: Integral n => n -> Tuning Source #
Make n division equal temperament.
tn_equal_temperament_12 :: Tuning Source #
12-tone equal temperament.
tn_cents tn_equal_temperament_12 == [0,100..1100]
tn_equal_temperament_19 :: Tuning Source #
19-tone equal temperament.
let c = [0,63,126,189,253,316,379,442,505,568,632,695,758,821,884,947,1011,1074,1137] tn_cents_i tn_equal_temperament_19 == c
tn_equal_temperament_31 :: Tuning Source #
31-tone equal temperament.
tn_equal_temperament_53 :: Tuning Source #
53-tone equal temperament.
tn_equal_temperament_72 :: Tuning Source #
72-tone equal temperament.
let r = [0,17,33,50,67,83,100] take 7 (map round (tn_cents tn_equal_temperament_72)) == r
tn_equal_temperament_96 :: Tuning Source #
96-tone equal temperament.