summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2014-01-20 16:07:16 -0500
committerAndrew Cady <d@jerkface.net>2014-01-20 16:07:16 -0500
commitd09c723fe925b5fe92420f3b0b3db7545622870d (patch)
tree379f295a1171cfb99754a827f3a29b8e1a3e0699
parent84b5695349e4d549e2535003a6321f450862ac62 (diff)
fix note labels
-rw-r--r--axis.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/axis.hs b/axis.hs
index e263862..8c30a32 100644
--- a/axis.hs
+++ b/axis.hs
@@ -36,14 +36,14 @@ netwireIsCool =
36smartShowPitch p = showPitch p -- TODO: use flat for Eb, Bb; use unicode flat/sharp chars 36smartShowPitch p = showPitch p -- TODO: use flat for Eb, Bb; use unicode flat/sharp chars
37 37
38_USE_HEXAGONS = True 38_USE_HEXAGONS = True
39_COLORIZE_BY_CHANNEL = True 39_LABEL_WHILE_PLAYING = True
40_LABEL_ALL_KEYS = False
40 41
41_AXIS_ROWS = 7 + 4 42_AXIS_ROWS = 7 + 4
42_AXIS_UNIQUE_COLS = 7 43_AXIS_UNIQUE_COLS = 7
43_AXIS_COLS_REPEAT = 2 44_AXIS_COLS_REPEAT = 2
44_AXIS_TOP_PITCH = 81 + (7 * (_AXIS_ROWS - 7) `div` 2) 45_AXIS_TOP_PITCH = 81 + (7 * (_AXIS_ROWS - 7) `div` 2)
45_AXIS_BOTTOM_PITCH = 81 - (7 * _AXIS_ROWS) - 3 46_AXIS_BOTTOM_PITCH = 81 - (7 * _AXIS_ROWS) - 3
46_OCTAVE_SQUASH = False -- it's terrible, because it draws the octave in the wrong shape
47 47
48--_KEY_BORDER_COLOR = (SDL.Color 0 0 255) 48--_KEY_BORDER_COLOR = (SDL.Color 0 0 255)
49_KEY_BORDER_COLOR = (SDL.Color 0 0 0) 49_KEY_BORDER_COLOR = (SDL.Color 0 0 0)
@@ -108,7 +108,6 @@ inMajorC pclass = not (pclass == 1 || pclass == 3 || pclass == 6 || pclass == 8
108-- TODO: try hilighting like in the app, where only part of the key is colored 108-- TODO: try hilighting like in the app, where only part of the key is colored
109-- TODO: idea: for the channels, draw a dot. offset the dot from the center of the key at an angle determined by the channel number 109-- TODO: idea: for the channels, draw a dot. offset the dot from the center of the key at an angle determined by the channel number
110 110
111_UNLABELLED_KEYS = True
112pitchToColor p = 111pitchToColor p =
113 case p `mod` 12 of 112 case p `mod` 12 of
114 2 -> (SDL.Color 0xD0 0xD0 0xFF) -- D 113 2 -> (SDL.Color 0xD0 0xD0 0xFF) -- D
@@ -129,11 +128,12 @@ smartDrawKeys reallyErase beforeKeys_ nowKeys_ videoSurface font axis_key_locati
129 128
130 forM_ actions $ \ (n, chans) -> do 129 forM_ actions $ \ (n, chans) -> do
131 let text = smartShowPitch (unPitch n) 130 let text = smartShowPitch (unPitch n)
132 pitch = if _OCTAVE_SQUASH then unPitch n `mod` 12 + 12 * 6 else unPitch n 131 pitch = unPitch n
133 forM_ (elemIndices pitch pitchIndex) $ \idx -> do 132 forM_ (elemIndices pitch pitchIndex) $ \idx -> do
133 let showLabel = (not reallyErase) && (_LABEL_ALL_KEYS || (_LABEL_WHILE_PLAYING && (length chans /= 0)))
134 drawKey idx videoSurface font axis_key_locations axis_key_size 134 drawKey idx videoSurface font axis_key_locations axis_key_size
135 (if reallyErase then _KB_BG_COLOR else pitchToColor pitch) 135 (if reallyErase then _KB_BG_COLOR else pitchToColor pitch)
136 (if reallyErase || _UNLABELLED_KEYS then Nothing else (Just text)) 136 (if showLabel then (Just text) else Nothing)
137 chans 137 chans
138 138
139--drawKey :: (Integral a1, Integral a2, Integral a) => Int -> SDL.Surface -> SDL.TTF.Font -> [(a1, a2)] -> a -> SDL.Color -> t -> Maybe String -> [Int] -> IO () 139--drawKey :: (Integral a1, Integral a2, Integral a) => Int -> SDL.Surface -> SDL.TTF.Font -> [(a1, a2)] -> a -> SDL.Color -> t -> Maybe String -> [Int] -> IO ()