Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/TabCode/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ trebNote = do

fret :: GenParser Char st Fret
fret = do
f <- oneOf ['a'..'n']
f <- oneOf "abcdefghiklmnopqrstvwxyz"
return $ case f of
'a' -> A
'b' -> B
Expand All @@ -251,11 +251,21 @@ fret = do
'g' -> G
'h' -> H
'i' -> I
'j' -> J
'k' -> K
'l' -> L
'm' -> M
'n' -> N
'o' -> O
'p' -> P
'q' -> Q
'r' -> R
's' -> S
't' -> T
'v' -> V
'w' -> W
'x' -> X
'y' -> Y
'z' -> Z
_ -> error $ "Invalid fret symbol: " ++ (show f)

course :: GenParser Char st Course
Expand Down Expand Up @@ -392,7 +402,7 @@ ornament = option Nothing $ (try abbr) <|> (try full)
full = do
between (char '(') (char ')') $ do
char 'O'
t <- oneOf "abcdefghijklm"
t <- oneOf ['a'..'m']
s <- optionMaybe int
pos <- option Nothing $ attachment
return $ Just $ case t of
Expand Down
32 changes: 26 additions & 6 deletions src/TabCode/Serialiser/MEIXML/Elements.hs
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,21 @@ fretNo F = pack "5"
fretNo G = pack "6"
fretNo H = pack "7"
fretNo I = pack "8"
fretNo J = pack "9"
fretNo K = pack "10"
fretNo L = pack "11"
fretNo M = pack "12"
fretNo N = pack "13"
fretNo K = pack "9"
fretNo L = pack "10"
fretNo M = pack "11"
fretNo N = pack "12"
fretNo O = pack "13"
fretNo P = pack "14"
fretNo Q = pack "15"
fretNo R = pack "16"
fretNo S = pack "17"
fretNo T = pack "18"
fretNo V = pack "19"
fretNo W = pack "20"
fretNo X = pack "21"
fretNo Y = pack "22"
fretNo Z = pack "23"

fretGlyphIt :: Fret -> Text
fretGlyphIt f = fretNo f
Expand All @@ -509,11 +519,21 @@ fretGlyphFr F = pack "f"
fretGlyphFr G = pack "g"
fretGlyphFr H = pack "h"
fretGlyphFr I = pack "i"
fretGlyphFr J = pack "j"
fretGlyphFr K = pack "k"
fretGlyphFr L = pack "l"
fretGlyphFr M = pack "m"
fretGlyphFr N = pack "n"
fretGlyphFr O = pack "o"
fretGlyphFr P = pack "p"
fretGlyphFr Q = pack "q"
fretGlyphFr R = pack "r"
fretGlyphFr S = pack "s"
fretGlyphFr T = pack "t"
fretGlyphFr V = pack "v"
fretGlyphFr W = pack "w"
fretGlyphFr X = pack "x"
fretGlyphFr Y = pack "y"
fretGlyphFr Z = pack "z"

durSymb :: Duration -> Beat -> Dot -> Text
durSymb Fermata _ Dot = error "Dotted fermata not allowed"
Expand Down
2 changes: 1 addition & 1 deletion src/TabCode/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ data RhythmSign = RhythmSign Duration Beat Dot (Maybe (Beam Duration)) deriving
-- FIXME Perhaps this data model should rather be a numeric fret
-- number and then any symbol from the source should be captured as
-- another part of the Note type
data Fret = A | B | C | D | E | F | G | H | I | J | K | L | M | N deriving (Eq, Show, Ord)
data Fret = A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | Q | R | S | T | V | W | X | Y | Z deriving (Eq, Show, Ord)

data Course
= One
Expand Down