diff options
author | Andrew Cady <d@jerkface.net> | 2014-01-20 16:07:16 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2014-01-20 16:07:16 -0500 |
commit | d09c723fe925b5fe92420f3b0b3db7545622870d (patch) | |
tree | 379f295a1171cfb99754a827f3a29b8e1a3e0699 | |
parent | 84b5695349e4d549e2535003a6321f450862ac62 (diff) |
fix note labels
-rw-r--r-- | axis.hs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -36,14 +36,14 @@ netwireIsCool = | |||
36 | smartShowPitch p = showPitch p -- TODO: use flat for Eb, Bb; use unicode flat/sharp chars | 36 | smartShowPitch 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 | ||
112 | pitchToColor p = | 111 | pitchToColor 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 () |