-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bernardo Barros
committed
Jan 25, 2024
1 parent
403dba9
commit 43535b4
Showing
4 changed files
with
191 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# OPTIONS_GHC -Wno-orphans #-} | ||
|
||
module Pitch.LilyPitch where | ||
|
||
import qualified Data.Map as Map | ||
import Data.Maybe (fromMaybe) | ||
import Data.String (IsString, fromString) | ||
import Pitch.Pitch | ||
|
||
instance IsString Pitch where | ||
fromString :: String -> Pitch | ||
fromString str = fromMaybe (error $ "Invalid pitch: " <> str) (Map.lookup str pitchMap) | ||
|
||
$(generatePitchVars (Map.keys pitchMap)) | ||
|
||
allPitches :: [Pitch] | ||
allPitches = | ||
[ "c", | ||
"cis", | ||
"ces", | ||
"cisis", | ||
"ceses", | ||
"d", | ||
"dis", | ||
"des", | ||
"dih___", | ||
"deh'''", | ||
"d__", | ||
"e", | ||
"ees", | ||
"eis", | ||
"eeh", | ||
"feseh", | ||
"eih", | ||
"f" | ||
] | ||
|
||
allPitches2 :: [Pitch] | ||
allPitches2 = | ||
[ c, | ||
cis, | ||
ces, | ||
cisis, | ||
ceses, | ||
d, | ||
dis, | ||
des, | ||
dih___, | ||
deh''', | ||
d__, | ||
e, | ||
ees, | ||
eis, | ||
eeh, | ||
feseh, | ||
eih, | ||
f | ||
] |
Oops, something went wrong.