module Pitch where
import Prelude ( Integer, (+), (), (*) )
type Pitch = Integer ;
type Octave = Integer ;
type Class = Integer ;
pitch :: Class -> Octave -> Pitch ;
pitch cls octave = cls + (octave+1)*12 ;
cb, db, eb, fb, gb, ab, bb :: Class ;
c, cis, ces, cs, cf,
d, dis, des, ds, df,
e, eis, ees, es, ef,
f, fis, fes, fs, ff,
g, gis, ges, gs, gf,
a, ais, aes, as, af,
b, bis, bes, bs, bf :: Octave -> Pitch ;
cb = 0 ; c = pitch cb ; cis = cs ; ces = cf ;
db = 2 ; d = pitch db ; dis = ds ; des = df ;
eb = 4 ; e = pitch eb ; eis = es ; ees = ef ;
fb = 5 ; f = pitch fb ; fis = fs ; fes = ff ;
gb = 7 ; g = pitch gb ; gis = gs ; ges = gf ;
ab = 9 ; a = pitch ab ; ais = as ; aes = af ;
bb = 11 ; b = pitch bb ; bis = bs ; bes = bf ;
cs = pitch (cb+1) ; cf = pitch (cb1) ;
ds = pitch (db+1) ; df = pitch (db1) ;
es = pitch (eb+1) ; ef = pitch (eb1) ;
fs = pitch (fb+1) ; ff = pitch (fb1) ;
gs = pitch (gb+1) ; gf = pitch (gb1) ;
as = pitch (ab+1) ; af = pitch (ab1) ;
bs = pitch (bb+1) ; bf = pitch (bb1) ;