Pitch.Class
Pitch classes.
In the naming scheme, f
stands for flat (♭) and s
is for sharp (♯).
type t = [
]
The type for pitch classes. The representation is not unique, for example Css
(C♯♯) and D
are the same pitch class.
val to_int : t -> int
to_int c
is c
as an integer on a non-modular semitone scale. `C
is 0, `Cff
is -2
and `Bss
is 13
. See also to_mod_int
.
val to_mod_int : t -> int
XXX. Should the default equal
and compare
be the modular one ?
equal c0 c1
is true
iff to_int c0 = to_int c1
. Note that this does not equate enharmonics like `C
and `Bs
, use mod_equal
for that.
compare c0 c1
orders c0
and c1
according to to_int
. Note that this does not equate enharmonics like `C
and `Bs
, use mod_compare
for that.
mod_equal c0 c1
is true
iff c0
and c1
represent the same pitch class. Equates enharmonics like `C
and `Bs
.
mod_compare c0 c1
is a total order on pitches compatible with mod_equal
.
val pp : Stdlib.Format.formatter -> t -> unit
pp
formats pitch classes. Uses the Unicode ♭ and ♯ characters.