{- deriveOffset a returns the offset from the key of C
   e.g.) deriveOffset D returns 2, because D is offset from C by 2
   deriveOffset :: String -> Int
   
   these are our outside cases, not appearing in sharps 
   (we only need to determine index here): 
   Db, db, Eb, eb, Gb, gb, Ab, ab, Bb, bb
   
   we match both sides toLower equivalent 
   e.g.) map toLower Bb == "bb"
   because matching toUpper results in B not matching -} 
deriveOffset key | map toLower key == "db" = 1
                 | map toLower key == "eb" = 3
                 | map toLower key == "gb" = 6
                 | map toLower key == "ab" = 8
                 | map toLower key == "bb" = 10
deriveOffset key | map toLower key == "db" = 1
                 | map toLower key == "eb" = 3
                 | map toLower key == "gb" = 6
                 | map toLower key == "ab" = 8
                 | map toLower key == "bb" = 10
deriveOffset key | map toLower key == "db" = 1
                 | map toLower key == "eb" = 3
                 | map toLower key == "gb" = 6
                 | map toLower key == "ab" = 8
                 | map toLower key == "bb" = 10