packages feed

music-pitch-literal 1.3.1 → 1.6

raw patch · 6 files changed

+399/−228 lines, 6 filesdep +semigroups

Dependencies added: semigroups

Files

COPYING view
@@ -9,14 +9,14 @@     * Redistributions in binary form must reproduce the above copyright       notice, this list of conditions and the following disclaimer in the       documentation and/or other materials provided with the distribution.-    * Neither the name of the <organization> nor the+    * Neither the name of the Music Suite nor the       names of its contributors may be used to endorse or promote products       derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE-DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
music-pitch-literal.cabal view
@@ -1,6 +1,6 @@  name:               music-pitch-literal-version:            1.3.1+version:            1.6 cabal-version:      >= 1.10 author:             Hans Hoglund maintainer:         Hans Hoglund@@ -15,17 +15,21 @@     This package allow you to write the pitches of standard notation as expressions     overloaded on result type. This works exactly like numeric literals. -    This library is part of the Music Suite, see <http://musicsuite.github.com>.+    This library is part of the Music Suite, see <http://music-suite.github.io>.  source-repository head   type:             git-  location:         git://github.com/hanshoglund/music-pitch-literal.git+  location:         git://github.com/music-suite/music-pitch-literal.git    library                         build-depends: -        base >= 4 && < 5+        base                    >= 4 && < 5,+        semigroups     hs-source-dirs: src     default-language: Haskell2010     exposed-modules:+        Data.Semigroup.Applicative         Music.Pitch.Literal+        Music.Pitch.Literal.Pitch+        Music.Pitch.Literal.Interval     
+ src/Data/Semigroup/Applicative.hs view
@@ -0,0 +1,19 @@++module Data.Semigroup.Applicative where++import Control.Applicative+import Data.Semigroup++-- TODO move to semigroups package+instance Functor First where+    fmap f (First x) = First (f x)+instance Applicative First where+    pure x = First x+    First f <*> First x = First (f x)++instance Functor Last where+    fmap f (Last x) = Last (f x)+instance Applicative Last where+    pure x = Last x+    Last f <*> Last x = Last (f x)+
src/Music/Pitch/Literal.hs view
@@ -1,6 +1,4 @@ -{-# LANGUAGE NoMonomorphismRestriction #-}- ------------------------------------------------------------------------------------- -- | -- Copyright   : (c) Hans Hoglund 2012@@ -11,229 +9,14 @@ -- Stability   : experimental -- Portability : portable ----- Provides overloaded pitch literals.+-- Provides overloaded pitch and interval literals. -- -------------------------------------------------------------------------------------  module Music.Pitch.Literal (--        IsPitch(..),-        PitchL(..),--        cs'', ds'', es'', fs'', gs'', as'', bs'',-        c'' , d'' , e'' , f'' , g'' , a'' , b'' ,-        cb'', db'', eb'', fb'', gb'', ab'', bb'',--        cs' , ds' , es' , fs' , gs' , as' , bs' ,-        c'  , d'  , e'  , f'  , g'  , a'  , b'  ,-        cb' , db' , eb' , fb' , gb' , ab' , bb' ,--        cs  , ds  , es  , fs  , gs  , as  , bs  ,-        c   , d   , e   , f   , g   , a   , b   ,-        cb  , db  , eb  , fb  , gb  , ab  , bb  ,--        cs_ , ds_ , es_ , fs_ , gs_ , as_ , bs_ ,-        c_  , d_  , e_  , f_  , g_  , a_  , b_  ,-        cb_ , db_ , eb_ , fb_ , gb_ , ab_ , bb_ ,--        cs__, ds__, es__, fs__, gs__, as__, bs__,-        c__ , d__ , e__ , f__ , g__ , a__ , b__ ,-        cb__, db__, eb__, fb__, gb__, ab__, bb__+        module Music.Pitch.Literal.Pitch,+        module Music.Pitch.Literal.Interval   ) where --- |--- The 'PitchL' types is used to encode a pitch literal. You don't need to--- think about this type unless you are implementing 'IsPitch'.------ It is defined as @(class, alteration, octave)@, where------     * @class@      is a pitch class number in @[0..6]@, starting from C.------     * @alteration@ is the number of semitones, i.e. 0 is natural, 1 for sharp 2 for double sharp, -1 for flat and -2 for double flat.---       Alteration is in 'Maybe' because some pitch representations differ between explicit and explicit accidentals, i.e. a diatonic---       pitch type may assume @(0,Nothing,4)@ to mean C sharp rather than C.------     * @octave@     is octave number in scientific pitch notation.------ Middle C is represented by the pitch literal @(0, Nothing, 4)@.----newtype PitchL = PitchL { getPitchL :: (Int, Maybe Double, Int) }-    deriving (Eq, Show, Ord)---- Like Num can be expressed using arabic numerals, instances--- of IsPitch can be expressed using Western pitch names (c, c sharp, c flat etc)-class IsPitch a where-    fromPitch :: PitchL -> a--instance IsPitch PitchL where-    fromPitch = id--instance IsPitch a => IsPitch (Maybe a) where-    fromPitch = Just . fromPitch--instance IsPitch Double where-    fromPitch (PitchL (pc, sem, oct)) = fromIntegral $ semitones sem + diatonic pc + (oct+1) * 12-        where-            semitones = maybe 0 round-            diatonic pc = case pc of-                0 -> 0-                1 -> 2-                2 -> 4-                3 -> 5-                4 -> 7-                5 -> 9-                6 -> 11--instance IsPitch Integer where-    fromPitch (PitchL (pc, sem, oct)) = fromIntegral $ semitones sem + diatonic pc + (oct+1) * 12-        where-            semitones = maybe 0 round-            diatonic pc = case pc of-                0 -> 0-                1 -> 2-                2 -> 4-                3 -> 5-                4 -> 7-                5 -> 9-                6 -> 11---{--cs'', ds'', es'', fs'', gs'', as'', bs''::  IsPitch a => a-c'' , d'' , e'' , f'' , g'' , a'' , b'' ::  IsPitch a => a-cb'', db'', eb'', fb'', gb'', ab'', bb''::  IsPitch a => a--cs' , ds' , es' , fs' , gs' , as' , bs' ::  IsPitch a => a-c'  , d'  , e'  , f'  , g'  , a'  , b'  ::  IsPitch a => a-cb' , db' , eb' , fb' , gb' , ab' , bb' ::  IsPitch a => a--cs  , ds  , es  , fs  , gs  , as  , bs  ::  IsPitch a => a-c   , d   , e   , f   , g   , a   , b   ::  IsPitch a => a-cb  , db  , eb  , fb  , gb  , ab  , bb  ::  IsPitch a => a--cs_ , ds_ , es_ , fs_ , gs_ , as_ , bs_ ::  IsPitch a => a-c_  , d_  , e_  , f_  , g_  , a_  , b_  ::  IsPitch a => a-cb_ , db_ , eb_ , fb_ , gb_ , ab_ , bb_ ::  IsPitch a => a--}---cs'' = fromPitch $ PitchL (0, Just 1, 6)-ds'' = fromPitch $ PitchL (1, Just 1, 6)-es'' = fromPitch $ PitchL (2, Just 1, 6)-fs'' = fromPitch $ PitchL (3, Just 1, 6)-gs'' = fromPitch $ PitchL (4, Just 1, 6)-as'' = fromPitch $ PitchL (5, Just 1, 6)-bs'' = fromPitch $ PitchL (6, Just 1, 6)--c''  = fromPitch $ PitchL (0, Nothing, 6)-d''  = fromPitch $ PitchL (1, Nothing, 6)-e''  = fromPitch $ PitchL (2, Nothing, 6)-f''  = fromPitch $ PitchL (3, Nothing, 6)-g''  = fromPitch $ PitchL (4, Nothing, 6)-a''  = fromPitch $ PitchL (5, Nothing, 6)-b''  = fromPitch $ PitchL (6, Nothing, 6)--cb'' = fromPitch $ PitchL (0, Just (-1), 6)-db'' = fromPitch $ PitchL (1, Just (-1), 6)-eb'' = fromPitch $ PitchL (2, Just (-1), 6)-fb'' = fromPitch $ PitchL (3, Just (-1), 6)-gb'' = fromPitch $ PitchL (4, Just (-1), 6)-ab'' = fromPitch $ PitchL (5, Just (-1), 6)-bb'' = fromPitch $ PitchL (6, Just (-1), 6)--cs'  = fromPitch $ PitchL (0, Just 1, 5)-ds'  = fromPitch $ PitchL (1, Just 1, 5)-es'  = fromPitch $ PitchL (2, Just 1, 5)-fs'  = fromPitch $ PitchL (3, Just 1, 5)-gs'  = fromPitch $ PitchL (4, Just 1, 5)-as'  = fromPitch $ PitchL (5, Just 1, 5)-bs'  = fromPitch $ PitchL (6, Just 1, 5)--c'   = fromPitch $ PitchL (0, Nothing, 5)-d'   = fromPitch $ PitchL (1, Nothing, 5)-e'   = fromPitch $ PitchL (2, Nothing, 5)-f'   = fromPitch $ PitchL (3, Nothing, 5)-g'   = fromPitch $ PitchL (4, Nothing, 5)-a'   = fromPitch $ PitchL (5, Nothing, 5)-b'   = fromPitch $ PitchL (6, Nothing, 5)--cb'  = fromPitch $ PitchL (0, Just (-1), 5)-db'  = fromPitch $ PitchL (1, Just (-1), 5)-eb'  = fromPitch $ PitchL (2, Just (-1), 5)-fb'  = fromPitch $ PitchL (3, Just (-1), 5)-gb'  = fromPitch $ PitchL (4, Just (-1), 5)-ab'  = fromPitch $ PitchL (5, Just (-1), 5)-bb'  = fromPitch $ PitchL (6, Just (-1), 5)--cs   = fromPitch $ PitchL (0, Just 1, 4)-ds   = fromPitch $ PitchL (1, Just 1, 4)-es   = fromPitch $ PitchL (2, Just 1, 4)-fs   = fromPitch $ PitchL (3, Just 1, 4)-gs   = fromPitch $ PitchL (4, Just 1, 4)-as   = fromPitch $ PitchL (5, Just 1, 4)-bs   = fromPitch $ PitchL (6, Just 1, 4)--c    = fromPitch $ PitchL (0, Nothing, 4)-d    = fromPitch $ PitchL (1, Nothing, 4)-e    = fromPitch $ PitchL (2, Nothing, 4)-f    = fromPitch $ PitchL (3, Nothing, 4)-g    = fromPitch $ PitchL (4, Nothing, 4)-a    = fromPitch $ PitchL (5, Nothing, 4)-b    = fromPitch $ PitchL (6, Nothing, 4)--cb   = fromPitch $ PitchL (0, Just (-1), 4)-db   = fromPitch $ PitchL (1, Just (-1), 4)-eb   = fromPitch $ PitchL (2, Just (-1), 4)-fb   = fromPitch $ PitchL (3, Just (-1), 4)-gb   = fromPitch $ PitchL (4, Just (-1), 4)-ab   = fromPitch $ PitchL (5, Just (-1), 4)-bb   = fromPitch $ PitchL (6, Just (-1), 4)--cs_  = fromPitch $ PitchL (0, Just 1, 3)-ds_  = fromPitch $ PitchL (1, Just 1, 3)-es_  = fromPitch $ PitchL (2, Just 1, 3)-fs_  = fromPitch $ PitchL (3, Just 1, 3)-gs_  = fromPitch $ PitchL (4, Just 1, 3)-as_  = fromPitch $ PitchL (5, Just 1, 3)-bs_  = fromPitch $ PitchL (6, Just 1, 3)--c_   = fromPitch $ PitchL (0, Nothing, 3)-d_   = fromPitch $ PitchL (1, Nothing, 3)-e_   = fromPitch $ PitchL (2, Nothing, 3)-f_   = fromPitch $ PitchL (3, Nothing, 3)-g_   = fromPitch $ PitchL (4, Nothing, 3)-a_   = fromPitch $ PitchL (5, Nothing, 3)-b_   = fromPitch $ PitchL (6, Nothing, 3)--cb_  = fromPitch $ PitchL (0, Just (-1), 3)-db_  = fromPitch $ PitchL (1, Just (-1), 3)-eb_  = fromPitch $ PitchL (2, Just (-1), 3)-fb_  = fromPitch $ PitchL (3, Just (-1), 3)-gb_  = fromPitch $ PitchL (4, Just (-1), 3)-ab_  = fromPitch $ PitchL (5, Just (-1), 3)-bb_  = fromPitch $ PitchL (6, Just (-1), 3)--cs__ = fromPitch $ PitchL (0, Just 1, 2)-ds__ = fromPitch $ PitchL (1, Just 1, 2)-es__ = fromPitch $ PitchL (2, Just 1, 2)-fs__ = fromPitch $ PitchL (3, Just 1, 2)-gs__ = fromPitch $ PitchL (4, Just 1, 2)-as__ = fromPitch $ PitchL (5, Just 1, 2)-bs__ = fromPitch $ PitchL (6, Just 1, 2)--c__  = fromPitch $ PitchL (0, Nothing, 2)-d__  = fromPitch $ PitchL (1, Nothing, 2)-e__  = fromPitch $ PitchL (2, Nothing, 2)-f__  = fromPitch $ PitchL (3, Nothing, 2)-g__  = fromPitch $ PitchL (4, Nothing, 2)-a__  = fromPitch $ PitchL (5, Nothing, 2)-b__  = fromPitch $ PitchL (6, Nothing, 2)--cb__ = fromPitch $ PitchL (0, Just (-1), 2)-db__ = fromPitch $ PitchL (1, Just (-1), 2)-eb__ = fromPitch $ PitchL (2, Just (-1), 2)-fb__ = fromPitch $ PitchL (3, Just (-1), 2)-gb__ = fromPitch $ PitchL (4, Just (-1), 2)-ab__ = fromPitch $ PitchL (5, Just (-1), 2)-bb__ = fromPitch $ PitchL (6, Just (-1), 2)-+import Music.Pitch.Literal.Pitch+import Music.Pitch.Literal.Interval
+ src/Music/Pitch/Literal/Interval.hs view
@@ -0,0 +1,141 @@++{-# LANGUAGE NoMonomorphismRestriction #-}++-------------------------------------------------------------------------------------+-- |+-- Copyright   : (c) Hans Hoglund 2012+--+-- License     : BSD-style+--+-- Maintainer  : hans@hanshoglund.se+-- Stability   : experimental+-- Portability : portable+--+-- Provides overloaded interval literals.+--+-------------------------------------------------------------------------------------++module Music.Pitch.Literal.Interval (++        IsInterval(..),+        IntervalL(..),++        d1,  _P1,  _A1,+        d2,   m2,  _M2,  _A2,+        d3,   m3,  _M3,  _A3,+        d4,  _P4,  _A4,+        d5,  _P5,  _A5,+        d6,   m6,  _M6,  _A6,+        d7,   m7,  _M7,  _A7,++        d8,  _P8,  _A8,+        d9,   m9,  _M9,  _A9,+        d10,  m10, _M10, _A10,+        d11, _P11, _A11,+        d12, _P12, _A12,+        d13,  m13, _M13, _A13,+        d14,  m14, _M14, _A14,++        d15, _P15,  _A15,++  ) where++import Data.Semigroup+import Data.Semigroup.Applicative ()+import Control.Applicative++newtype IntervalL = IntervalL (Integer, Integer, Integer)+-- (octaves, diatonic steps, chromatic steps)++class IsInterval a where+    fromInterval :: IntervalL -> a++instance IsInterval IntervalL where+    fromInterval = id++instance IsInterval a => IsInterval (Maybe a) where+    fromInterval = pure . fromInterval++instance IsInterval a => IsInterval (First a) where+    fromInterval = pure . fromInterval++instance IsInterval a => IsInterval (Last a) where+    fromInterval = pure . fromInterval++instance IsInterval Double where+    fromInterval = fromIntegral . asInteger . fromInterval++instance IsInterval Integer where+    fromInterval (IntervalL (o, d, c)) = o * 12 + c++d1   = fromInterval $ IntervalL (0,0,-1)+_P1  = fromInterval $ IntervalL (0,0,0)+_A1  = fromInterval $ IntervalL (0,0,1)++d2   = fromInterval $ IntervalL (0,1,0)+m2   = fromInterval $ IntervalL (0,1,1)+_M2  = fromInterval $ IntervalL (0,1,2)+_A2  = fromInterval $ IntervalL (0,1,3)++d3   = fromInterval $ IntervalL (0,2,2)+m3   = fromInterval $ IntervalL (0,2,3)+_M3  = fromInterval $ IntervalL (0,2,4)+_A3  = fromInterval $ IntervalL (0,2,5)++d4   = fromInterval $ IntervalL (0,3,4)+_P4  = fromInterval $ IntervalL (0,3,5)+_A4  = fromInterval $ IntervalL (0,3,6)++d5   = fromInterval $ IntervalL (0,4,6)+_P5  = fromInterval $ IntervalL (0,4,7)+_A5  = fromInterval $ IntervalL (0,4,8)++d6   = fromInterval $ IntervalL (0,5,7)+m6   = fromInterval $ IntervalL (0,5,8)+_M6  = fromInterval $ IntervalL (0,5,9)+_A6  = fromInterval $ IntervalL (0,5,10)++d7   = fromInterval $ IntervalL (0,6,9)+m7   = fromInterval $ IntervalL (0,6,10)+_M7  = fromInterval $ IntervalL (0,6,11)+_A7  = fromInterval $ IntervalL (0,6,12)++d8   = fromInterval $ IntervalL (1,0,-1)+_P8  = fromInterval $ IntervalL (1,0,0)+_A8  = fromInterval $ IntervalL (1,0,1)++d9   = fromInterval $ IntervalL (1,1,0)+m9   = fromInterval $ IntervalL (1,1,1)+_M9  = fromInterval $ IntervalL (1,1,2)+_A9  = fromInterval $ IntervalL (1,1,3)++d10  = fromInterval $ IntervalL (1,2,2)+m10  = fromInterval $ IntervalL (1,2,3)+_M10  = fromInterval $ IntervalL (1,2,4)+_A10 = fromInterval $ IntervalL (1,2,5)++d11  = fromInterval $ IntervalL (1,3,4)+_P11 = fromInterval $ IntervalL (1,3,5)+_A11 = fromInterval $ IntervalL (1,3,6)++d12  = fromInterval $ IntervalL (1,4,6)+_P12 = fromInterval $ IntervalL (1,4,7)+_A12 = fromInterval $ IntervalL (1,4,8)++d13  = fromInterval $ IntervalL (1,5,7)+m13  = fromInterval $ IntervalL (1,5,8)+_M13 = fromInterval $ IntervalL (1,5,9)+_A13 = fromInterval $ IntervalL (1,5,10)++d14  = fromInterval $ IntervalL (1,6,9)+m14  = fromInterval $ IntervalL (1,6,10)+_M14 = fromInterval $ IntervalL (1,6,11)+_A14 = fromInterval $ IntervalL (1,6,12)++d15  = fromInterval $ IntervalL (2,0,-1)+_P15 = fromInterval $ IntervalL (2,0,0)+_A15 = fromInterval $ IntervalL (2,0,1)+++asInteger :: Integer -> Integer+asInteger = id
+ src/Music/Pitch/Literal/Pitch.hs view
@@ -0,0 +1,224 @@++{-# LANGUAGE NoMonomorphismRestriction #-}++-------------------------------------------------------------------------------------+-- |+-- Copyright   : (c) Hans Hoglund 2012+--+-- License     : BSD-style+--+-- Maintainer  : hans@hanshoglund.se+-- Stability   : experimental+-- Portability : portable+--+-- Provides overloaded pitch literals.+--+-------------------------------------------------------------------------------------++module Music.Pitch.Literal.Pitch (++        IsPitch(..),+        PitchL(..),++        cs'', ds'', es'', fs'', gs'', as'', bs'',+        c'' , d'' , e'' , f'' , g'' , a'' , b'' ,+        cb'', db'', eb'', fb'', gb'', ab'', bb'',++        cs' , ds' , es' , fs' , gs' , as' , bs' ,+        c'  , d'  , e'  , f'  , g'  , a'  , b'  ,+        cb' , db' , eb' , fb' , gb' , ab' , bb' ,++        cs  , ds  , es  , fs  , gs  , as  , bs  ,+        c   , d   , e   , f   , g   , a   , b   ,+        cb  , db  , eb  , fb  , gb  , ab  , bb  ,++        cs_ , ds_ , es_ , fs_ , gs_ , as_ , bs_ ,+        c_  , d_  , e_  , f_  , g_  , a_  , b_  ,+        cb_ , db_ , eb_ , fb_ , gb_ , ab_ , bb_ ,++        cs__, ds__, es__, fs__, gs__, as__, bs__,+        c__ , d__ , e__ , f__ , g__ , a__ , b__ ,+        cb__, db__, eb__, fb__, gb__, ab__, bb__++  ) where++import Data.Semigroup+import Data.Semigroup.Applicative ()+import Control.Applicative++-- Pitch literal, defined as @(class, alteration, octave)@, where+--+--     * @class@      is a pitch class number in @[0..6]@, starting from C.+--+--     * @alteration@ is the number of semitones, i.e. 0 is natural, 1 for sharp 2 for double sharp, -1 for flat and -2 for double flat.+--       Alteration is in 'Maybe' because some pitch representations differ between explicit and explicit accidentals, i.e. a diatonic+--       pitch type may assume @(0,Nothing,4)@ to mean C sharp rather than C.+--+--     * @octave@     is octave number in scientific pitch notation.+--+-- Middle C is represented by the pitch literal @(0, Nothing, 4)@.+--+newtype PitchL = PitchL { getPitchL :: (Int, Maybe Double, Int) }+    deriving (Eq, Show, Ord)++class IsPitch a where+    fromPitch :: PitchL -> a++instance IsPitch PitchL where+    fromPitch = id++instance IsPitch a => IsPitch (Maybe a) where+    fromPitch = pure . fromPitch++instance IsPitch a => IsPitch (First a) where+    fromPitch = pure . fromPitch++instance IsPitch a => IsPitch (Last a) where+    fromPitch = pure . fromPitch++instance IsPitch Double where+    fromPitch (PitchL (pc, sem, oct)) = fromIntegral $ semitones sem + diatonic pc + (oct+1) * 12+        where+            semitones = maybe 0 round+            diatonic pc = case pc of+                0 -> 0+                1 -> 2+                2 -> 4+                3 -> 5+                4 -> 7+                5 -> 9+                6 -> 11++instance IsPitch Integer where+    fromPitch (PitchL (pc, sem, oct)) = fromIntegral $ semitones sem + diatonic pc + (oct+1) * 12+        where+            semitones = maybe 0 round+            diatonic pc = case pc of+                0 -> 0+                1 -> 2+                2 -> 4+                3 -> 5+                4 -> 7+                5 -> 9+                6 -> 11++cs'' = fromPitch $ PitchL (0, Just 1, 6)+ds'' = fromPitch $ PitchL (1, Just 1, 6)+es'' = fromPitch $ PitchL (2, Just 1, 6)+fs'' = fromPitch $ PitchL (3, Just 1, 6)+gs'' = fromPitch $ PitchL (4, Just 1, 6)+as'' = fromPitch $ PitchL (5, Just 1, 6)+bs'' = fromPitch $ PitchL (6, Just 1, 6)++c''  = fromPitch $ PitchL (0, Nothing, 6)+d''  = fromPitch $ PitchL (1, Nothing, 6)+e''  = fromPitch $ PitchL (2, Nothing, 6)+f''  = fromPitch $ PitchL (3, Nothing, 6)+g''  = fromPitch $ PitchL (4, Nothing, 6)+a''  = fromPitch $ PitchL (5, Nothing, 6)+b''  = fromPitch $ PitchL (6, Nothing, 6)++cb'' = fromPitch $ PitchL (0, Just (-1), 6)+db'' = fromPitch $ PitchL (1, Just (-1), 6)+eb'' = fromPitch $ PitchL (2, Just (-1), 6)+fb'' = fromPitch $ PitchL (3, Just (-1), 6)+gb'' = fromPitch $ PitchL (4, Just (-1), 6)+ab'' = fromPitch $ PitchL (5, Just (-1), 6)+bb'' = fromPitch $ PitchL (6, Just (-1), 6)++cs'  = fromPitch $ PitchL (0, Just 1, 5)+ds'  = fromPitch $ PitchL (1, Just 1, 5)+es'  = fromPitch $ PitchL (2, Just 1, 5)+fs'  = fromPitch $ PitchL (3, Just 1, 5)+gs'  = fromPitch $ PitchL (4, Just 1, 5)+as'  = fromPitch $ PitchL (5, Just 1, 5)+bs'  = fromPitch $ PitchL (6, Just 1, 5)++c'   = fromPitch $ PitchL (0, Nothing, 5)+d'   = fromPitch $ PitchL (1, Nothing, 5)+e'   = fromPitch $ PitchL (2, Nothing, 5)+f'   = fromPitch $ PitchL (3, Nothing, 5)+g'   = fromPitch $ PitchL (4, Nothing, 5)+a'   = fromPitch $ PitchL (5, Nothing, 5)+b'   = fromPitch $ PitchL (6, Nothing, 5)++cb'  = fromPitch $ PitchL (0, Just (-1), 5)+db'  = fromPitch $ PitchL (1, Just (-1), 5)+eb'  = fromPitch $ PitchL (2, Just (-1), 5)+fb'  = fromPitch $ PitchL (3, Just (-1), 5)+gb'  = fromPitch $ PitchL (4, Just (-1), 5)+ab'  = fromPitch $ PitchL (5, Just (-1), 5)+bb'  = fromPitch $ PitchL (6, Just (-1), 5)++cs   = fromPitch $ PitchL (0, Just 1, 4)+ds   = fromPitch $ PitchL (1, Just 1, 4)+es   = fromPitch $ PitchL (2, Just 1, 4)+fs   = fromPitch $ PitchL (3, Just 1, 4)+gs   = fromPitch $ PitchL (4, Just 1, 4)+as   = fromPitch $ PitchL (5, Just 1, 4)+bs   = fromPitch $ PitchL (6, Just 1, 4)++c    = fromPitch $ PitchL (0, Nothing, 4)+d    = fromPitch $ PitchL (1, Nothing, 4)+e    = fromPitch $ PitchL (2, Nothing, 4)+f    = fromPitch $ PitchL (3, Nothing, 4)+g    = fromPitch $ PitchL (4, Nothing, 4)+a    = fromPitch $ PitchL (5, Nothing, 4)+b    = fromPitch $ PitchL (6, Nothing, 4)++cb   = fromPitch $ PitchL (0, Just (-1), 4)+db   = fromPitch $ PitchL (1, Just (-1), 4)+eb   = fromPitch $ PitchL (2, Just (-1), 4)+fb   = fromPitch $ PitchL (3, Just (-1), 4)+gb   = fromPitch $ PitchL (4, Just (-1), 4)+ab   = fromPitch $ PitchL (5, Just (-1), 4)+bb   = fromPitch $ PitchL (6, Just (-1), 4)++cs_  = fromPitch $ PitchL (0, Just 1, 3)+ds_  = fromPitch $ PitchL (1, Just 1, 3)+es_  = fromPitch $ PitchL (2, Just 1, 3)+fs_  = fromPitch $ PitchL (3, Just 1, 3)+gs_  = fromPitch $ PitchL (4, Just 1, 3)+as_  = fromPitch $ PitchL (5, Just 1, 3)+bs_  = fromPitch $ PitchL (6, Just 1, 3)++c_   = fromPitch $ PitchL (0, Nothing, 3)+d_   = fromPitch $ PitchL (1, Nothing, 3)+e_   = fromPitch $ PitchL (2, Nothing, 3)+f_   = fromPitch $ PitchL (3, Nothing, 3)+g_   = fromPitch $ PitchL (4, Nothing, 3)+a_   = fromPitch $ PitchL (5, Nothing, 3)+b_   = fromPitch $ PitchL (6, Nothing, 3)++cb_  = fromPitch $ PitchL (0, Just (-1), 3)+db_  = fromPitch $ PitchL (1, Just (-1), 3)+eb_  = fromPitch $ PitchL (2, Just (-1), 3)+fb_  = fromPitch $ PitchL (3, Just (-1), 3)+gb_  = fromPitch $ PitchL (4, Just (-1), 3)+ab_  = fromPitch $ PitchL (5, Just (-1), 3)+bb_  = fromPitch $ PitchL (6, Just (-1), 3)++cs__ = fromPitch $ PitchL (0, Just 1, 2)+ds__ = fromPitch $ PitchL (1, Just 1, 2)+es__ = fromPitch $ PitchL (2, Just 1, 2)+fs__ = fromPitch $ PitchL (3, Just 1, 2)+gs__ = fromPitch $ PitchL (4, Just 1, 2)+as__ = fromPitch $ PitchL (5, Just 1, 2)+bs__ = fromPitch $ PitchL (6, Just 1, 2)++c__  = fromPitch $ PitchL (0, Nothing, 2)+d__  = fromPitch $ PitchL (1, Nothing, 2)+e__  = fromPitch $ PitchL (2, Nothing, 2)+f__  = fromPitch $ PitchL (3, Nothing, 2)+g__  = fromPitch $ PitchL (4, Nothing, 2)+a__  = fromPitch $ PitchL (5, Nothing, 2)+b__  = fromPitch $ PitchL (6, Nothing, 2)++cb__ = fromPitch $ PitchL (0, Just (-1), 2)+db__ = fromPitch $ PitchL (1, Just (-1), 2)+eb__ = fromPitch $ PitchL (2, Just (-1), 2)+fb__ = fromPitch $ PitchL (3, Just (-1), 2)+gb__ = fromPitch $ PitchL (4, Just (-1), 2)+ab__ = fromPitch $ PitchL (5, Just (-1), 2)+bb__ = fromPitch $ PitchL (6, Just (-1), 2)+