about summary refs log tree commit diff
path: root/website/sandbox/chord-drill-sergeant/src/ChordInspector.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-04-12T15·43+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-04-12T15·43+0100
commit24692ab46508d5e3348af19a6eae583a6d02e0e7 (patch)
treed4b3c36d303957f5d32213bccb83bd291b6c7a04 /website/sandbox/chord-drill-sergeant/src/ChordInspector.elm
parent730aecc076fd21c48884201f59c9b1fce8c7a23a (diff)
Properly support chord inversions
While I did change a lot of functionality, I also ran `elm-format` across the
codebase, which makes these changes a bit noisy.

Here is the TL;DR:
- Properly support chord inversions
- Ensure that the piano styling changes dynamically when I change the variables
  like `naturalWidth`
- Add start and end notes to define the size of the piano and which chords we
  create
- Support elm-format and run it across entire project
- Debug Misc.comesBefore
- Introduce a ChordInspector and debugger

TODO: Ensure that we only generate chords where all of the notes can be rendered
on the displayed keys.

TODO: Add preferences panel, so that I can do things like "Practice blues chords
in C and E with chord substitutions."
Diffstat (limited to 'website/sandbox/chord-drill-sergeant/src/ChordInspector.elm')
-rw-r--r--website/sandbox/chord-drill-sergeant/src/ChordInspector.elm25
1 files changed, 25 insertions, 0 deletions
diff --git a/website/sandbox/chord-drill-sergeant/src/ChordInspector.elm b/website/sandbox/chord-drill-sergeant/src/ChordInspector.elm
new file mode 100644
index 000000000000..809894f2c2b0
--- /dev/null
+++ b/website/sandbox/chord-drill-sergeant/src/ChordInspector.elm
@@ -0,0 +1,25 @@
+module ChordInspector exposing (render)
+
+import Html exposing (..)
+import Theory
+
+
+render : Theory.Chord -> Html a
+render chord =
+    case Theory.notesForChord chord of
+        Nothing ->
+            p [] [ text "Cannot retrieve the notes for the chord." ]
+
+        Just notes ->
+            ul []
+                (notes
+                    |> List.map
+                        (\note ->
+                            li []
+                                [ text
+                                    (Theory.viewNote
+                                        note
+                                    )
+                                ]
+                        )
+                )