about summary refs log tree commit diff
path: root/website/sandbox/chord-drill-sergeant/src/Tempo.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/Tempo.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/Tempo.elm')
-rw-r--r--website/sandbox/chord-drill-sergeant/src/Tempo.elm31
1 files changed, 18 insertions, 13 deletions
diff --git a/website/sandbox/chord-drill-sergeant/src/Tempo.elm b/website/sandbox/chord-drill-sergeant/src/Tempo.elm
index de4fa32795f9..270cc5bd6dc6 100644
--- a/website/sandbox/chord-drill-sergeant/src/Tempo.elm
+++ b/website/sandbox/chord-drill-sergeant/src/Tempo.elm
@@ -4,19 +4,24 @@ import Html exposing (..)
 import Html.Attributes exposing (..)
 import Html.Events exposing (..)
 
+
 type alias Props msg =
-  { tempo : Int
-  , handleIncrease : msg
-  , handleDecrease : msg
-  , handleInput : String -> msg
-  }
+    { tempo : Int
+    , handleIncrease : msg
+    , handleDecrease : msg
+    , handleInput : String -> msg
+    }
+
 
 render : Props msg -> Html msg
-render {tempo, handleIncrease, handleDecrease, handleInput} =
-  div [] [ p [] [ text ((String.fromInt tempo) ++ " BPM") ]
-         , button [ onClick handleDecrease ] [ text "Slower" ]
-         , input [ onInput handleInput
-                 , placeholder "Set tempo..."
-                 ] []
-         , button [ onClick handleIncrease ] [ text "Faster" ]
-         ]
+render { tempo, handleIncrease, handleDecrease, handleInput } =
+    div []
+        [ p [] [ text (String.fromInt tempo ++ " BPM") ]
+        , button [ onClick handleDecrease ] [ text "Slower" ]
+        , input
+            [ onInput handleInput
+            , placeholder "Set tempo..."
+            ]
+            []
+        , button [ onClick handleIncrease ] [ text "Faster" ]
+        ]