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 } ]
in
{ whitelistedChords =
keys |> List.concatMap Theory.chordsForKey
keys
|> List.concatMap Theory.chordsForKey
|> List.filter (\chord -> List.member chord.chordInversion inversions)
, whitelistedChordTypes = chordTypes
, whitelistedInversions = inversions
, whitelistedPitchClasses = pitchClasses
@ -200,7 +202,9 @@ update msg model =
( { model
| whitelistedKeys = keys
, whitelistedChords =
keys |> List.concatMap Theory.chordsForKey
keys
|> List.concatMap Theory.chordsForKey
|> List.filter (\chord -> List.member chord.chordInversion model.whitelistedInversions)
, selectedChord = Nothing
}
, Cmd.none