-- | Db of locally defined tunings, but for ordinary use see "Music.Theory.Tuning.Scala".
module Music.Theory.Tuning.Db where

import Data.List {- base -}

import Music.Theory.Tuning.Type

import Music.Theory.Tuning.Alves_1997
import Music.Theory.Tuning.Gann_1993
import Music.Theory.Tuning.Polansky_1978
import Music.Theory.Tuning.Polansky_1985c

import Music.Theory.Tuning.Db.Alves
import Music.Theory.Tuning.Db.Gann
import Music.Theory.Tuning.Db.Microtonal_Synthesis
import Music.Theory.Tuning.Db.Riley
import Music.Theory.Tuning.Db.Werckmeister

-- | (last-name,first-name,title,year,hmt/tuning,scala/name)
type Named_Tuning = (String,String,String,String,Tuning,String)

named_tuning_t :: Named_Tuning -> Tuning
named_tuning_t :: Named_Tuning -> Tuning
named_tuning_t (String
_,String
_,String
_,String
_,Tuning
t,String
_) = Tuning
t

tuning_db :: [Named_Tuning]
tuning_db :: [Named_Tuning]
tuning_db =
    [(String
"Aaron",String
"Pietro",String
"",String
"1523",Tuning
pietro_aaron_1523,String
"meanquar")
    ,(String
"Alves",String
"Bill",String
"Slendro",String
"",Tuning
alves_slendro,String
"slendro_alves") -- slendro9
    ,(String
"Alves",String
"Bill",String
"Pelog/Bem",String
"",Tuning
alves_pelog_bem,String
"") -- hirajoshi2 / pelog_jc
    ,(String
"Alves",String
"Bill",String
"Pelog/Barang",String
"",Tuning
alves_pelog_barang,String
"") -- surupan_degung / degung3
    ,(String
"Gann",String
"Kyle",String
"Superparticular",String
"1992",Tuning
gann_superparticular,String
"gann_super")
    ,(String
"Harrison",String
"Lou",String
"Ditone",String
"",Tuning
harrison_ditone,String
"") -- pyth_12 / zwolle
    ,(String
"Harrison",String
"Lou",String
"16-tone",String
"",Tuning
lou_harrison_16,String
"harrison_16")
    ,(String
"Johnston",String
"Ben",String
"MTP",String
"1977",Tuning
ben_johnston_mtp_1977,String
"") -- carlos_harm
    ,(String
"Johnston",String
"Ben",String
"25-tone",String
"",Tuning
ben_johnston_25,String
"johnston_25")
    ,(String
"Kirnberger",String
"Johann Philipp",String
"III",String
"",Tuning
kirnberger_iii,String
"kirnberger")
    ,(String
"Malcolm",String
"Alexander",String
"Monochord",String
"1721",Tuning
five_limit_tuning,String
"malcolm") -- wurschmidt
    ,(String
"Partch",String
"Harry",String
"43-tone",String
"",Tuning
partch_43,String
"partch_43")
    ,(String
"Polansky",String
"Larry",String
"Piano Study #5",String
"1985",Tuning
ps5_jpr,String
"polansky_ps") -- 56-any
    ,(String
"Polansky",String
"Larry",String
"Psaltery",String
"1978",Tuning
psaltery_o,String
"") -- dconv9marv
    ,(String
"Riley",String
"Terry",String
"Harp of New Albion",String
"",Tuning
riley_albion,String
"riley_albion")
    ,(String
"Tsuda",String
"Mayumi",String
"13-limit",String
"",Tuning
mayumi_tsuda,String
"tsuda13")
    ,(String
"Vallotti",String
"",String
"",String
"1754",Tuning
vallotti,String
"vallotti") -- bemetzrieder2
    ,(String
"Werckmeister",String
"Andreas",String
"Werckmeister III",String
"",Tuning
werckmeister_iii,String
"werck3")
    ,(String
"Werckmeister",String
"Andreas",String
"Werckmeister IV",String
"",Tuning
werckmeister_iv,String
"werck4")
    ,(String
"Werckmeister",String
"Andreas",String
"Werckmeister V",String
"",Tuning
werckmeister_v,String
"werck5") -- ammerbach1
    ,(String
"Werckmeister",String
"Andreas",String
"Werckmeister VI",String
"",Tuning
werckmeister_vi,String
"werck6")
    ,(String
"Young",String
"La Monte",String
"The Well-Tuned Piano",String
"",Tuning
lmy_wtp,String
"young-lm_piano")
    ,(String
"Young",String
"Thomas",String
"",String
"1799",Tuning
thomas_young_1799,String
"young1") -- young2
    ,(String
"Zarlino",String
"Gioseffo",String
"",String
"1588",Tuning
zarlino_1588,String
"zarlino2") -- mersen_s3
    ,(String
"",String
"",String
"JI/12 7-limit",String
"",Tuning
septimal_tritone_just_intonation,String
"ji_12")
    ,(String
"",String
"",String
"ET/12",String
"",Tuning
tn_equal_temperament_12,String
"et12")
    ,(String
"",String
"",String
"ET/19",String
"",Tuning
tn_equal_temperament_19,String
"et19")
    ,(String
"",String
"",String
"ET/31",String
"",Tuning
tn_equal_temperament_31,String
"et13")
    ,(String
"",String
"",String
"ET/53",String
"",Tuning
tn_equal_temperament_53,String
"et53")
    ,(String
"",String
"",String
"ET/72",String
"",Tuning
tn_equal_temperament_72,String
"et72")
    ,(String
"",String
"",String
"ET/96",String
"",Tuning
tn_equal_temperament_96,String
"et96")
    ,(String
"",String
"",String
"Pythagorean/12",String
"",Tuning
pythagorean_12,String
"pyth_12") -- zwolle
    ]

tuning_db_lookup_scl :: String -> Maybe Tuning
tuning_db_lookup_scl :: String -> Maybe Tuning
tuning_db_lookup_scl String
nm = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Named_Tuning -> Tuning
named_tuning_t (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find (\(String
_,String
_,String
_,String
_,Tuning
_,String
scl) -> String
scl forall a. Eq a => a -> a -> Bool
== String
nm) [Named_Tuning]
tuning_db)

{-

import Music.Theory.Tuning.Scala
db <- scl_load_db
f n = take n . scl_db_query_cdiff_asc round db . sort . tn_cents_octave
f 2 pietro_aaron_1523
pp = mapM_ (putStrLn . unlines . scale_stat . snd)
mapM_ pp (map (f 2 . named_tuning_t) tuning_db)

-}