## Pitch classes

`type t = [ `

`| ` ``Cff` | C^{♭♭} |

`| ` ``Cf` | C^{♭} |

`| ` ``C` | C |

`| ` ``Cs` | C^{♯} |

`| ` ``Css` | C^{♯♯} |

`| ` ``Dff` | D^{♭♭} |

`| ` ``Df` | D^{♭} |

`| ` ``D` | D |

`| ` ``Ds` | D^{♯} |

`| ` ``Dss` | D^{♯♯} |

`| ` ``Eff` | E^{♭♭} |

`| ` ``Ef` | E^{♭} |

`| ` ``E` | E |

`| ` ``Es` | E^{♯} |

`| ` ``Ess` | E^{♯♯} |

`| ` ``Fff` | F^{♭♭} |

`| ` ``Ff` | F^{♭} |

`| ` ``F` | F |

`| ` ``Fs` | F^{♯} |

`| ` ``Fss` | F^{♯♯} |

`| ` ``Gff` | G^{♭♭} |

`| ` ``Gf` | G^{♭} |

`| ` ``G` | G |

`| ` ``Gs` | G^{♯} |

`| ` ``Gss` | G^{♯♯} |

`| ` ``Aff` | F^{♭♭} |

`| ` ``Af` | A^{♭} |

`| ` ``A` | A |

`| ` ``As` | A^{♯} |

`| ` ``Ass` | A^{♯♯} |

`| ` ``Bff` | B^{♭♭} |

`| ` ``Bf` | B^{♭} |

`| ` ``B` | B |

`| ` ``Bs` | B^{♯} |

`| ` ``Bss` | B^{♯♯} |

` ]`

The type for pitch classes. The representation is not unique, for example `Css`

(C^{♯♯}) and `D`

are the same pitch class.

`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`

`to_mod_int c`

is like `to_int`

but the result is non-negative and modulo `12`

, ``C`

is `0`

. Enharmonics like ``C`

and ``Bs`

are mapped to the same integer. See also `to_int`

.

## Predicates and comparisons

**XXX.** Should the default `equal`

and `compare`

be the modular one ?

`val equal : t -> t -> bool`

`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.

`val compare : t -> t -> int`

`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.

`val mod_equal : t -> t -> bool`

`mod_equal c0 c1`

is `true`

iff `c0`

and `c1`

represent the same pitch class. Equates enharmonics like ``C`

and ``Bs`

.

`val mod_compare : t -> t -> int`

`mod_compare c0 c1`

is a total order on pitches compatible with `mod_equal`

.

## Formatters

`val pp : Stdlib.Format.formatter -> t -> unit`

`pp`

formats pitch classes. Uses the Unicode ♭ and ♯ characters.