Ensure only whitelisted chord inversions present in initial state

Whoops...
This commit is contained in:
William Carroll 2020-04-19 18:56:51 +01:00
parent a059c32403
commit 541c40cd2f

View file

@ -63,7 +63,9 @@ init =
[ { pitchClass = Theory.C, mode = Theory.MajorMode } ] [ { pitchClass = Theory.C, mode = Theory.MajorMode } ]
in in
{ whitelistedChords = { whitelistedChords =
keys |> List.concatMap Theory.chordsForKey keys
|> List.concatMap Theory.chordsForKey
|> List.filter (\chord -> List.member chord.chordInversion inversions)
, whitelistedChordTypes = chordTypes , whitelistedChordTypes = chordTypes
, whitelistedInversions = inversions , whitelistedInversions = inversions
, whitelistedPitchClasses = pitchClasses , whitelistedPitchClasses = pitchClasses
@ -200,7 +202,9 @@ update msg model =
( { model ( { model
| whitelistedKeys = keys | whitelistedKeys = keys
, whitelistedChords = , whitelistedChords =
keys |> List.concatMap Theory.chordsForKey keys
|> List.concatMap Theory.chordsForKey
|> List.filter (\chord -> List.member chord.chordInversion model.whitelistedInversions)
, selectedChord = Nothing , selectedChord = Nothing
} }
, Cmd.none , Cmd.none