{-# LANGUAGE OverloadedStrings #-}
module Harmonic.Framework.Builder.Types
(
HarmonicContext(..)
, harmonicContext
, hContext
, Drift(..)
, hcOvertones
, hcKey
, hcRoots
, dissonant
, consonant
, invSkip
, hcPedal
, hcTristrata
, GeneratorConfig(..)
, defaultConfig
, ParsedContext(..)
, parseContextOnce
, keySpellingOf
, BassDirection(..)
, BassDirectionSpec(..)
, BDKind(..)
, BDSelector(..)
, Verbosity(..)
, GenConfig(..)
, GenMode(..)
, TransformTrace(..)
, AdvanceTrace(..)
, StepDiagnostic(..)
, FusionDiag(..)
, GenerationDiagnostics(..)
, AttemptDiagnostic(..)
) where
import Data.List (intercalate)
import qualified Data.IntSet as IntSet
import qualified Data.Text as T
import Data.Text (Text)
import qualified Harmonic.Rules.Types.Harmony as H
import qualified Harmonic.Rules.Types.Pitch as P
import qualified Harmonic.Rules.Types.Progression as Prog
import qualified Harmonic.Rules.Types.ProgressionContext as PC
import qualified Harmonic.Rules.Types.Scale as Sc
import qualified Harmonic.Evaluation.Scoring.Progression as PS
import Harmonic.Rules.Constraints.Filter (parseOvertones', parseKey, isWildcard, resolveRoots,
BassDirection(..), BassDirectionSpec(..),
BDKind(..), BDSelector(..),
parseBassDirectionSpec, stripDirectionToken,
noteNameToPitchClass)
data HarmonicContext = HarmonicContext
{ HarmonicContext -> Text
_hcOvertones :: Text
, HarmonicContext -> Text
_hcKey :: Text
, HarmonicContext -> Text
_hcRoots :: Text
, HarmonicContext -> Drift
_hcDrift :: Drift
, HarmonicContext -> Int
_hcInversionSpacing :: Int
, HarmonicContext -> Text
_hcPedal :: Text
, HarmonicContext -> Text
_hcTristrata :: Text
} deriving (HarmonicContext -> HarmonicContext -> Bool
(HarmonicContext -> HarmonicContext -> Bool)
-> (HarmonicContext -> HarmonicContext -> Bool)
-> Eq HarmonicContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HarmonicContext -> HarmonicContext -> Bool
== :: HarmonicContext -> HarmonicContext -> Bool
$c/= :: HarmonicContext -> HarmonicContext -> Bool
/= :: HarmonicContext -> HarmonicContext -> Bool
Eq)
instance Show HarmonicContext where
show :: HarmonicContext -> String
show HarmonicContext
ctx = String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate String
" | " ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$ (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (String -> Bool) -> String -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null)
[ String
"overtones " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Text -> String
T.unpack (HarmonicContext -> Text
_hcOvertones HarmonicContext
ctx)
, String
"key " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Text -> String
T.unpack (HarmonicContext -> Text
_hcKey HarmonicContext
ctx)
, String
"roots " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Text -> String
T.unpack (HarmonicContext -> Text
_hcRoots HarmonicContext
ctx)
, Drift -> String
forall {a}. IsString a => Drift -> a
driftStr (HarmonicContext -> Drift
_hcDrift HarmonicContext
ctx)
, Int -> String
forall {a}. (Eq a, Num a, Show a) => a -> String
invStr (HarmonicContext -> Int
_hcInversionSpacing HarmonicContext
ctx)
, Text -> String
pedalStr (HarmonicContext -> Text
_hcPedal HarmonicContext
ctx)
]
where
driftStr :: Drift -> a
driftStr Drift
Free = a
""
driftStr Drift
Dissonant = a
"drift dissonant"
driftStr Drift
Consonant = a
"drift consonant"
invStr :: a -> String
invStr a
0 = String
""
invStr a
n = String
"inv skip " String -> ShowS
forall a. [a] -> [a] -> [a]
++ a -> String
forall a. Show a => a -> String
show a
n
pedalStr :: Text -> String
pedalStr Text
t = if Text -> Bool
T.null (Text -> Text
T.strip Text
t) then String
"" else String
"pedal " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Text -> String
T.unpack Text
t
harmonicContext :: Text -> Text -> Text -> HarmonicContext
harmonicContext :: Text -> Text -> Text -> HarmonicContext
harmonicContext Text
o Text
k Text
r = Text
-> Text -> Text -> Drift -> Int -> Text -> Text -> HarmonicContext
HarmonicContext Text
o Text
k Text
r Drift
Free Int
0 Text
"" Text
""
hContext :: HarmonicContext
hContext :: HarmonicContext
hContext = Text
-> Text -> Text -> Drift -> Int -> Text -> Text -> HarmonicContext
HarmonicContext Text
"*" Text
"*" Text
"*" Drift
Free Int
0 Text
"" Text
""
data Drift = Dissonant | Consonant | Free deriving (Int -> Drift -> ShowS
[Drift] -> ShowS
Drift -> String
(Int -> Drift -> ShowS)
-> (Drift -> String) -> ([Drift] -> ShowS) -> Show Drift
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Drift -> ShowS
showsPrec :: Int -> Drift -> ShowS
$cshow :: Drift -> String
show :: Drift -> String
$cshowList :: [Drift] -> ShowS
showList :: [Drift] -> ShowS
Show, Drift -> Drift -> Bool
(Drift -> Drift -> Bool) -> (Drift -> Drift -> Bool) -> Eq Drift
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Drift -> Drift -> Bool
== :: Drift -> Drift -> Bool
$c/= :: Drift -> Drift -> Bool
/= :: Drift -> Drift -> Bool
Eq)
hcOvertones :: String -> HarmonicContext -> HarmonicContext
hcOvertones :: String -> HarmonicContext -> HarmonicContext
hcOvertones String
o HarmonicContext
ctx = HarmonicContext
ctx { _hcOvertones = T.pack o }
hcKey :: String -> HarmonicContext -> HarmonicContext
hcKey :: String -> HarmonicContext -> HarmonicContext
hcKey String
k HarmonicContext
ctx = HarmonicContext
ctx { _hcKey = T.pack k }
hcRoots :: String -> HarmonicContext -> HarmonicContext
hcRoots :: String -> HarmonicContext -> HarmonicContext
hcRoots String
r HarmonicContext
ctx = HarmonicContext
ctx { _hcRoots = T.pack r }
dissonant :: HarmonicContext -> HarmonicContext
dissonant :: HarmonicContext -> HarmonicContext
dissonant HarmonicContext
ctx = HarmonicContext
ctx { _hcDrift = Dissonant }
consonant :: HarmonicContext -> HarmonicContext
consonant :: HarmonicContext -> HarmonicContext
consonant HarmonicContext
ctx = HarmonicContext
ctx { _hcDrift = Consonant }
invSkip :: Int -> HarmonicContext -> HarmonicContext
invSkip :: Int -> HarmonicContext -> HarmonicContext
invSkip Int
n HarmonicContext
ctx = HarmonicContext
ctx { _hcInversionSpacing = n }
hcPedal :: String -> HarmonicContext -> HarmonicContext
hcPedal :: String -> HarmonicContext -> HarmonicContext
hcPedal String
p HarmonicContext
ctx = HarmonicContext
ctx { _hcPedal = T.pack p }
hcTristrata :: String -> HarmonicContext -> HarmonicContext
hcTristrata :: String -> HarmonicContext -> HarmonicContext
hcTristrata String
t HarmonicContext
ctx = HarmonicContext
ctx { _hcTristrata = T.pack t }
data GeneratorConfig = GeneratorConfig
{ GeneratorConfig -> Bool
gcQuad :: !Bool
} deriving (Int -> GeneratorConfig -> ShowS
[GeneratorConfig] -> ShowS
GeneratorConfig -> String
(Int -> GeneratorConfig -> ShowS)
-> (GeneratorConfig -> String)
-> ([GeneratorConfig] -> ShowS)
-> Show GeneratorConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GeneratorConfig -> ShowS
showsPrec :: Int -> GeneratorConfig -> ShowS
$cshow :: GeneratorConfig -> String
show :: GeneratorConfig -> String
$cshowList :: [GeneratorConfig] -> ShowS
showList :: [GeneratorConfig] -> ShowS
Show, GeneratorConfig -> GeneratorConfig -> Bool
(GeneratorConfig -> GeneratorConfig -> Bool)
-> (GeneratorConfig -> GeneratorConfig -> Bool)
-> Eq GeneratorConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeneratorConfig -> GeneratorConfig -> Bool
== :: GeneratorConfig -> GeneratorConfig -> Bool
$c/= :: GeneratorConfig -> GeneratorConfig -> Bool
/= :: GeneratorConfig -> GeneratorConfig -> Bool
Eq)
defaultConfig :: GeneratorConfig
defaultConfig :: GeneratorConfig
defaultConfig = GeneratorConfig { gcQuad :: Bool
gcQuad = Bool
False }
data ParsedContext = ParsedContext
{ ParsedContext -> IntSet
pcEffectiveOvertones :: !IntSet.IntSet
, ParsedContext -> IntSet
pcAllowedBassNotes :: !IntSet.IntSet
, ParsedContext -> Bool
pcIsRootsWild :: !Bool
, ParsedContext -> Bool
pcIsKeyWild :: !Bool
, ParsedContext -> Bool
pcIsOvertonesWild :: !Bool
, ParsedContext -> [Int]
pcRawOvertones :: ![Int]
, ParsedContext -> Maybe BassDirectionSpec
pcBassDirectionSpec :: !(Maybe BassDirectionSpec)
, ParsedContext -> Drift
pcDrift :: !Drift
, ParsedContext -> Int
pcInversionSpacing :: !Int
, ParsedContext -> IntSet
pcPedalRequired :: !IntSet.IntSet
, ParsedContext -> IntSet
pcPedalPreferred :: !IntSet.IntSet
, ParsedContext -> [Tristrata]
pcAllowedTristrata :: ![Sc.Tristrata]
, ParsedContext -> Double
pcSoftBoost :: !Double
, ParsedContext -> Bool
pcStrictContainment :: !Bool
, ParsedContext -> Maybe EnharmonicSpelling
pcKeySpelling :: !(Maybe H.EnharmonicSpelling)
}
parsePedalTones :: Text -> (IntSet.IntSet, IntSet.IntSet)
parsePedalTones :: Text -> (IntSet, IntSet)
parsePedalTones Text
input
| Text -> Bool
T.null (Text -> Text
T.strip Text
input) = (IntSet
IntSet.empty, IntSet
IntSet.empty)
| Bool
otherwise =
let tokens :: [Text]
tokens = Text -> [Text]
T.words Text
input
classify :: Text -> (Bool, Maybe Int)
classify Text
t
| Text -> Text -> Bool
T.isSuffixOf Text
"?" Text
t = (Bool
False, Text -> Maybe Int
noteNameToPitchClass (HasCallStack => Text -> Text
Text -> Text
T.init Text
t))
| Bool
otherwise = (Bool
True, Text -> Maybe Int
noteNameToPitchClass Text
t)
pairs :: [(Bool, Maybe Int)]
pairs = (Text -> (Bool, Maybe Int)) -> [Text] -> [(Bool, Maybe Int)]
forall a b. (a -> b) -> [a] -> [b]
map Text -> (Bool, Maybe Int)
classify [Text]
tokens
required :: IntSet
required = [Int] -> IntSet
IntSet.fromList [Int
pc | (Bool
True, Just Int
pc) <- [(Bool, Maybe Int)]
pairs]
preferred :: IntSet
preferred = [Int] -> IntSet
IntSet.fromList [Int
pc | (Bool
False, Just Int
pc) <- [(Bool, Maybe Int)]
pairs]
in (IntSet
required, IntSet
preferred)
parseContextOnce :: HarmonicContext -> ParsedContext
parseContextOnce :: HarmonicContext -> ParsedContext
parseContextOnce HarmonicContext
ctx =
let rawOvertones :: [Int]
rawOvertones = Int -> Text -> [Int]
parseOvertones' Int
3 (HarmonicContext -> Text
_hcOvertones HarmonicContext
ctx)
keyPcs :: [Int]
keyPcs = Text -> [Int]
parseKey (HarmonicContext -> Text
_hcKey HarmonicContext
ctx)
keyWild :: Bool
keyWild = Text -> Bool
isWildcard (HarmonicContext -> Text
_hcKey HarmonicContext
ctx)
effectiveOvertones :: [Int]
effectiveOvertones = if Bool
keyWild
then [Int]
rawOvertones
else (Int -> Bool) -> [Int] -> [Int]
forall a. (a -> Bool) -> [a] -> [a]
filter (Int -> [Int] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Int]
keyPcs) [Int]
rawOvertones
rootsRaw :: Text
rootsRaw = HarmonicContext -> Text
_hcRoots HarmonicContext
ctx
rootsStripped :: Text
rootsStripped = Text -> Text
stripDirectionToken Text
rootsRaw
bassDirSpec :: Maybe BassDirectionSpec
bassDirSpec = Text -> Maybe BassDirectionSpec
parseBassDirectionSpec Text
rootsRaw
allowedBassNotes :: [Int]
allowedBassNotes = Text -> Text -> Text -> [Int]
resolveRoots (HarmonicContext -> Text
_hcOvertones HarmonicContext
ctx) (HarmonicContext -> Text
_hcKey HarmonicContext
ctx) Text
rootsStripped
(IntSet
pedalReq, IntSet
pedalPref) = Text -> (IntSet, IntSet)
parsePedalTones (HarmonicContext -> Text
_hcPedal HarmonicContext
ctx)
allowedTS :: [Tristrata]
allowedTS =
let idxs :: [Int]
idxs = String -> [Int]
Sc.parseTristrataList (Text -> String
T.unpack (HarmonicContext -> Text
_hcTristrata HarmonicContext
ctx))
in if [Int] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [Int]
idxs
then [Tristrata]
Sc.validTristrata
else (Int -> Tristrata) -> [Int] -> [Tristrata]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Tristrata
Sc.tristrataIndex [Int]
idxs
in ParsedContext
{ pcEffectiveOvertones :: IntSet
pcEffectiveOvertones = [Int] -> IntSet
IntSet.fromList [Int]
effectiveOvertones
, pcAllowedBassNotes :: IntSet
pcAllowedBassNotes = [Int] -> IntSet
IntSet.fromList [Int]
allowedBassNotes
, pcIsRootsWild :: Bool
pcIsRootsWild = Text -> Bool
isWildcard Text
rootsStripped
, pcIsKeyWild :: Bool
pcIsKeyWild = Bool
keyWild
, pcIsOvertonesWild :: Bool
pcIsOvertonesWild = Text -> Bool
isWildcard (HarmonicContext -> Text
_hcOvertones HarmonicContext
ctx)
, pcRawOvertones :: [Int]
pcRawOvertones = [Int]
rawOvertones
, pcBassDirectionSpec :: Maybe BassDirectionSpec
pcBassDirectionSpec = Maybe BassDirectionSpec
bassDirSpec
, pcDrift :: Drift
pcDrift = HarmonicContext -> Drift
_hcDrift HarmonicContext
ctx
, pcInversionSpacing :: Int
pcInversionSpacing = HarmonicContext -> Int
_hcInversionSpacing HarmonicContext
ctx
, pcPedalRequired :: IntSet
pcPedalRequired = IntSet
pedalReq
, pcPedalPreferred :: IntSet
pcPedalPreferred = IntSet
pedalPref
, pcAllowedTristrata :: [Tristrata]
pcAllowedTristrata = [Tristrata]
allowedTS
, pcSoftBoost :: Double
pcSoftBoost = Double
1.0
, pcStrictContainment :: Bool
pcStrictContainment = Bool
False
, pcKeySpelling :: Maybe EnharmonicSpelling
pcKeySpelling = Text -> Maybe EnharmonicSpelling
keySpellingOf (HarmonicContext -> Text
_hcKey HarmonicContext
ctx)
}
keySpellingOf :: Text -> Maybe H.EnharmonicSpelling
keySpellingOf :: Text -> Maybe EnharmonicSpelling
keySpellingOf Text
raw
| Text -> Bool
isWildcard Text
raw = Maybe EnharmonicSpelling
forall a. Maybe a
Nothing
| Bool
otherwise =
let toks :: [Text]
toks = [ Text
t | Text
t <- Text -> [Text]
T.words (Text -> Text
T.toLower (Text -> Text
T.strip Text
raw))
, Bool -> Bool
not (Text
"-" Text -> Text -> Bool
`T.isPrefixOf` Text
t) ]
sides :: [EnharmonicSpelling]
sides = [ EnharmonicSpelling
s | Just EnharmonicSpelling
s <- (Text -> Maybe EnharmonicSpelling)
-> [Text] -> [Maybe EnharmonicSpelling]
forall a b. (a -> b) -> [a] -> [b]
map Text -> Maybe EnharmonicSpelling
tokenSide [Text]
toks ]
in case [EnharmonicSpelling]
sides of
[] -> Maybe EnharmonicSpelling
forall a. Maybe a
Nothing
[EnharmonicSpelling]
ss | (EnharmonicSpelling -> Bool) -> [EnharmonicSpelling] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (EnharmonicSpelling -> EnharmonicSpelling -> Bool
forall a. Eq a => a -> a -> Bool
== EnharmonicSpelling
H.FlatSpelling) [EnharmonicSpelling]
ss -> EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.FlatSpelling
| (EnharmonicSpelling -> Bool) -> [EnharmonicSpelling] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (EnharmonicSpelling -> EnharmonicSpelling -> Bool
forall a. Eq a => a -> a -> Bool
== EnharmonicSpelling
H.SharpSpelling) [EnharmonicSpelling]
ss -> EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.SharpSpelling
| Bool
otherwise -> Maybe EnharmonicSpelling
forall a. Maybe a
Nothing
where
tokenSide :: Text -> Maybe EnharmonicSpelling
tokenSide Text
t
| Text
t Text -> [Text] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Text
"0#", Text
"0b"] = Maybe EnharmonicSpelling
forall a. Maybe a
Nothing
| Text
"#" Text -> Text -> Bool
`T.isSuffixOf` Text
t = EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.SharpSpelling
| Text
t Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"b" = EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.SharpSpelling
| (Char -> Bool) -> Text -> Bool
T.any (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'b') Text
t = EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.FlatSpelling
| Text
t Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"f" = EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.FlatSpelling
| Text
t Text -> [Text] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Text
"g", Text
"d", Text
"a", Text
"e"] = EnharmonicSpelling -> Maybe EnharmonicSpelling
forall a. a -> Maybe a
Just EnharmonicSpelling
H.SharpSpelling
| Bool
otherwise = Maybe EnharmonicSpelling
forall a. Maybe a
Nothing
data Verbosity = Silent | Standard | Verbose deriving (Int -> Verbosity -> ShowS
[Verbosity] -> ShowS
Verbosity -> String
(Int -> Verbosity -> ShowS)
-> (Verbosity -> String)
-> ([Verbosity] -> ShowS)
-> Show Verbosity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Verbosity -> ShowS
showsPrec :: Int -> Verbosity -> ShowS
$cshow :: Verbosity -> String
show :: Verbosity -> String
$cshowList :: [Verbosity] -> ShowS
showList :: [Verbosity] -> ShowS
Show, Verbosity -> Verbosity -> Bool
(Verbosity -> Verbosity -> Bool)
-> (Verbosity -> Verbosity -> Bool) -> Eq Verbosity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Verbosity -> Verbosity -> Bool
== :: Verbosity -> Verbosity -> Bool
$c/= :: Verbosity -> Verbosity -> Bool
/= :: Verbosity -> Verbosity -> Bool
Eq)
data GenMode
= Fresh
| FromProg Prog.Progression !Int !Int
| FromProgPC PC.ProgressionContext !Int !Int
| GridMode
| StrataMode Sc.StrataLabel
data GenConfig = GenConfig
{ GenConfig -> IO CadenceState
_gcCue :: IO H.CadenceState
, GenConfig -> Int
_gcLen :: Int
, GenConfig -> String
_gcSeek :: String
, GenConfig -> Double
_gcEntropy :: Double
, GenConfig -> HarmonicContext
_gcTonal :: HarmonicContext
, GenConfig -> Verbosity
_gcVerbosity :: Verbosity
, GenConfig -> GenMode
_gcMode :: GenMode
, GenConfig -> Maybe Int
_gcLenOverride :: Maybe Int
, GenConfig -> Maybe [Int]
_gcRelStrata :: Maybe [Int]
, GenConfig -> Maybe [StrataLabel]
_gcAbsStrata :: Maybe [Sc.StrataLabel]
, GenConfig -> Double
_gcBoostSame :: Double
, GenConfig -> Double
_gcBoostFlip :: Double
, GenConfig -> Double
_gcBoostTri :: Double
, GenConfig -> Bool
_gcQuad :: Bool
, GenConfig -> Int
_gcMaxAttempts :: Int
, GenConfig -> Int
_gcViableTarget :: Int
, GenConfig -> Double
_gcViabilityFloor :: Double
}
data TransformTrace = TransformTrace
{ TransformTrace -> String
ttRawDbIntervals :: String
, TransformTrace -> String
ttRawDbMovement :: String
, TransformTrace -> String
ttRawDbFunctionality:: String
, TransformTrace -> Int
ttRootPC :: Int
, TransformTrace -> String
ttRootNoteName :: String
, TransformTrace -> [Int]
ttTones :: [Int]
, TransformTrace -> [Int]
ttTransposedPitches :: [Int]
, TransformTrace -> [Int]
ttNormalizedPs :: [Int]
, TransformTrace -> [Int]
ttZeroForm :: [Int]
, TransformTrace -> String
ttDetectedRoot :: String
, TransformTrace -> String
ttFunctionality :: String
, TransformTrace -> String
ttFinalChord :: String
, TransformTrace -> String
ttStoredFunc :: String
} deriving (Int -> TransformTrace -> ShowS
[TransformTrace] -> ShowS
TransformTrace -> String
(Int -> TransformTrace -> ShowS)
-> (TransformTrace -> String)
-> ([TransformTrace] -> ShowS)
-> Show TransformTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransformTrace -> ShowS
showsPrec :: Int -> TransformTrace -> ShowS
$cshow :: TransformTrace -> String
show :: TransformTrace -> String
$cshowList :: [TransformTrace] -> ShowS
showList :: [TransformTrace] -> ShowS
Show, TransformTrace -> TransformTrace -> Bool
(TransformTrace -> TransformTrace -> Bool)
-> (TransformTrace -> TransformTrace -> Bool) -> Eq TransformTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransformTrace -> TransformTrace -> Bool
== :: TransformTrace -> TransformTrace -> Bool
$c/= :: TransformTrace -> TransformTrace -> Bool
/= :: TransformTrace -> TransformTrace -> Bool
Eq)
data AdvanceTrace = AdvanceTrace
{ AdvanceTrace -> String
atCurrentRoot :: String
, AdvanceTrace -> Int
atCurrentRootPC :: Int
, AdvanceTrace -> String
atMovement :: String
, AdvanceTrace -> Int
atMovementInterval :: Int
, AdvanceTrace -> Int
atNewRootPC :: Int
, AdvanceTrace -> String
atEnharmFunc :: String
, AdvanceTrace -> String
atNewRoot :: String
} deriving (Int -> AdvanceTrace -> ShowS
[AdvanceTrace] -> ShowS
AdvanceTrace -> String
(Int -> AdvanceTrace -> ShowS)
-> (AdvanceTrace -> String)
-> ([AdvanceTrace] -> ShowS)
-> Show AdvanceTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AdvanceTrace -> ShowS
showsPrec :: Int -> AdvanceTrace -> ShowS
$cshow :: AdvanceTrace -> String
show :: AdvanceTrace -> String
$cshowList :: [AdvanceTrace] -> ShowS
showList :: [AdvanceTrace] -> ShowS
Show, AdvanceTrace -> AdvanceTrace -> Bool
(AdvanceTrace -> AdvanceTrace -> Bool)
-> (AdvanceTrace -> AdvanceTrace -> Bool) -> Eq AdvanceTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AdvanceTrace -> AdvanceTrace -> Bool
== :: AdvanceTrace -> AdvanceTrace -> Bool
$c/= :: AdvanceTrace -> AdvanceTrace -> Bool
/= :: AdvanceTrace -> AdvanceTrace -> Bool
Eq)
data StepDiagnostic = StepDiagnostic
{ StepDiagnostic -> Int
sdStepNumber :: Int
, StepDiagnostic -> String
sdPriorCadence :: String
, StepDiagnostic -> String
sdPriorRoot :: String
, StepDiagnostic -> Int
sdPriorRootPC :: Int
, StepDiagnostic -> String
sdSelectedDbIntervals :: String
, StepDiagnostic -> String
sdSelectedDbMovement :: String
, StepDiagnostic -> String
sdSelectedDbFunctionality :: String
, StepDiagnostic -> Int
sdGraphCount :: Int
, StepDiagnostic -> [(String, Double)]
sdGraphTop6 :: [(String, Double)]
, StepDiagnostic -> Int
sdFallbackCount :: Int
, StepDiagnostic -> [(String, Double, Double, Double, Double)]
sdFallbackTop6 :: [(String, Double, Double, Double, Double)]
, StepDiagnostic -> Int
sdPoolSize :: Int
, StepDiagnostic -> Double
sdEntropyUsed :: Double
, StepDiagnostic -> Int
sdGammaIndex :: Int
, StepDiagnostic -> String
sdSelectedFrom :: String
, StepDiagnostic -> String
sdPosteriorRoot :: String
, StepDiagnostic -> Int
sdPosteriorRootPC :: Int
, StepDiagnostic -> Maybe String
sdRenderedChord :: Maybe String
, StepDiagnostic -> Maybe TransformTrace
sdTransformTrace :: Maybe TransformTrace
, StepDiagnostic -> Maybe AdvanceTrace
sdAdvanceTrace :: Maybe AdvanceTrace
, StepDiagnostic -> Maybe Int
sdTristrataIdx :: Maybe Int
, StepDiagnostic -> Maybe Tristrata
sdTristrata :: Maybe Sc.Tristrata
, StepDiagnostic -> Maybe StrataLabel
sdStrataLabel :: Maybe Sc.StrataLabel
, StepDiagnostic -> Maybe Mode
sdMode :: Maybe Sc.Mode
, StepDiagnostic -> Maybe [PitchClass]
sdStrataChroma :: Maybe [P.PitchClass]
, StepDiagnostic -> Maybe [PitchClass]
sdModeChroma :: Maybe [P.PitchClass]
, StepDiagnostic -> Maybe Double
sdSoftBoost :: Maybe Double
, StepDiagnostic -> Maybe Int
sdHarmonicRootPC :: Maybe Int
, StepDiagnostic -> Maybe (PitchClass, ScaleFamily)
sdParentKey :: Maybe (P.PitchClass, Sc.ScaleFamily)
, StepDiagnostic -> Maybe ModeResult
sdModeResult :: Maybe Sc.ModeResult
, StepDiagnostic -> Maybe EnharmonicSpelling
sdBarSpelling :: Maybe H.EnharmonicSpelling
, StepDiagnostic -> Maybe FusionDiag
sdFusion :: Maybe FusionDiag
} deriving (Int -> StepDiagnostic -> ShowS
[StepDiagnostic] -> ShowS
StepDiagnostic -> String
(Int -> StepDiagnostic -> ShowS)
-> (StepDiagnostic -> String)
-> ([StepDiagnostic] -> ShowS)
-> Show StepDiagnostic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StepDiagnostic -> ShowS
showsPrec :: Int -> StepDiagnostic -> ShowS
$cshow :: StepDiagnostic -> String
show :: StepDiagnostic -> String
$cshowList :: [StepDiagnostic] -> ShowS
showList :: [StepDiagnostic] -> ShowS
Show, StepDiagnostic -> StepDiagnostic -> Bool
(StepDiagnostic -> StepDiagnostic -> Bool)
-> (StepDiagnostic -> StepDiagnostic -> Bool) -> Eq StepDiagnostic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StepDiagnostic -> StepDiagnostic -> Bool
== :: StepDiagnostic -> StepDiagnostic -> Bool
$c/= :: StepDiagnostic -> StepDiagnostic -> Bool
/= :: StepDiagnostic -> StepDiagnostic -> Bool
Eq)
data FusionDiag = FusionDiag
{ FusionDiag -> Int
fdAddedPC :: Int
, FusionDiag -> String
fdFusedName :: String
, FusionDiag -> Int
fdGammaIdx :: Int
, FusionDiag -> Int
fdPoolK :: Int
} deriving (Int -> FusionDiag -> ShowS
[FusionDiag] -> ShowS
FusionDiag -> String
(Int -> FusionDiag -> ShowS)
-> (FusionDiag -> String)
-> ([FusionDiag] -> ShowS)
-> Show FusionDiag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FusionDiag -> ShowS
showsPrec :: Int -> FusionDiag -> ShowS
$cshow :: FusionDiag -> String
show :: FusionDiag -> String
$cshowList :: [FusionDiag] -> ShowS
showList :: [FusionDiag] -> ShowS
Show, FusionDiag -> FusionDiag -> Bool
(FusionDiag -> FusionDiag -> Bool)
-> (FusionDiag -> FusionDiag -> Bool) -> Eq FusionDiag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FusionDiag -> FusionDiag -> Bool
== :: FusionDiag -> FusionDiag -> Bool
$c/= :: FusionDiag -> FusionDiag -> Bool
/= :: FusionDiag -> FusionDiag -> Bool
Eq)
data GenerationDiagnostics = GenerationDiagnostics
{ GenerationDiagnostics -> String
gdStartCadence :: String
, GenerationDiagnostics -> String
gdStartRoot :: String
, GenerationDiagnostics -> Int
gdRequestedLen :: Int
, GenerationDiagnostics -> Int
gdActualLen :: Int
, GenerationDiagnostics -> Double
gdEntropy :: Double
, GenerationDiagnostics -> [StepDiagnostic]
gdSteps :: [StepDiagnostic]
, GenerationDiagnostics -> Progression
gdProgression :: Prog.Progression
} deriving (Int -> GenerationDiagnostics -> ShowS
[GenerationDiagnostics] -> ShowS
GenerationDiagnostics -> String
(Int -> GenerationDiagnostics -> ShowS)
-> (GenerationDiagnostics -> String)
-> ([GenerationDiagnostics] -> ShowS)
-> Show GenerationDiagnostics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerationDiagnostics -> ShowS
showsPrec :: Int -> GenerationDiagnostics -> ShowS
$cshow :: GenerationDiagnostics -> String
show :: GenerationDiagnostics -> String
$cshowList :: [GenerationDiagnostics] -> ShowS
showList :: [GenerationDiagnostics] -> ShowS
Show)
data AttemptDiagnostic = AttemptDiagnostic
{ AttemptDiagnostic -> Int
adIndex :: !Int
, AttemptDiagnostic -> ProgressionScore
adScore :: !PS.ProgressionScore
, AttemptDiagnostic -> Double
adTotal :: !Double
, AttemptDiagnostic -> Bool
adViable :: !Bool
, AttemptDiagnostic -> Bool
adPicked :: !Bool
, AttemptDiagnostic -> [String]
adChords :: ![String]
} deriving (Int -> AttemptDiagnostic -> ShowS
[AttemptDiagnostic] -> ShowS
AttemptDiagnostic -> String
(Int -> AttemptDiagnostic -> ShowS)
-> (AttemptDiagnostic -> String)
-> ([AttemptDiagnostic] -> ShowS)
-> Show AttemptDiagnostic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AttemptDiagnostic -> ShowS
showsPrec :: Int -> AttemptDiagnostic -> ShowS
$cshow :: AttemptDiagnostic -> String
show :: AttemptDiagnostic -> String
$cshowList :: [AttemptDiagnostic] -> ShowS
showList :: [AttemptDiagnostic] -> ShowS
Show, AttemptDiagnostic -> AttemptDiagnostic -> Bool
(AttemptDiagnostic -> AttemptDiagnostic -> Bool)
-> (AttemptDiagnostic -> AttemptDiagnostic -> Bool)
-> Eq AttemptDiagnostic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttemptDiagnostic -> AttemptDiagnostic -> Bool
== :: AttemptDiagnostic -> AttemptDiagnostic -> Bool
$c/= :: AttemptDiagnostic -> AttemptDiagnostic -> Bool
/= :: AttemptDiagnostic -> AttemptDiagnostic -> Bool
Eq)