hmt-0.16: Haskell Music Theory

Safe HaskellSafe
LanguageHaskell98

Music.Theory.Tuning.Scala.Mode

Contents

Description

Parser for the modename.par file.

Synopsis

Documentation

type MODE = (Int, [Int], String) Source #

(start-degree,intervals,description)

type MODENAM = (Int, Int, [MODE]) Source #

(mode-count,_,mode-list)

modenam_search_seq :: MODENAM -> [Int] -> [MODE] Source #

Search for mode by interval list.

modenam_search_seq1 :: MODENAM -> [Int] -> Maybe MODE Source #

Expect one result.

mn <- load_modenam
let sq = putStrLn . unlines . mode_stat . fromJust . modenam_search_seq1 mn
sq [2,2,1,2,2,2,1]
sq [2,1,2,2,1,2,2]
sq [2,1,2,2,1,3,1]
sq (replicate 6 2)
sq [1,2,1,2,1,2,1,2]
sq [2,1,2,1,2,1,2,1]
sq (replicate 12 1)

modenam_search_description :: MODENAM -> String -> [MODE] Source #

Search for mode by description text.

map (modenam_search_description mn) ["Messiaen","Xenakis","Raga"]

mode_stat :: MODE -> [String] Source #

Pretty printer.

Parser

non_implicit_degree :: String -> Maybe Int Source #

Bracketed integers are a non-implicit starting degree.

map non_implicit_degree ["4","[4]"] == [Nothing,Just 4]

join_long_lines :: [String] -> [String] Source #

Lines ending with @@ continue to next line.

IO

load_modenam :: IO MODENAM Source #

parse_modenam of load_dist_file of modenam.par.

mn <- load_modenam
let (n,x,m) = mn
n == 2125 && x == 15 && length m == n