music-pitch-1.9.0: Musical pitch representation.

Safe HaskellNone
LanguageHaskell2010

Music.Pitch.Common.Types

Contents

Description

Common (Western classical) pitches, intervals and related types.

Synopsis

Even octaves and steps

data Octaves Source

Number of octaves. May be negative, indicating a downward interval.

type Semitones = ChromaticSteps Source

Number of semitones. May be negative, indicating a downward interval.

Intervals

data Number Source

The number component of an interval (fourth, fifth) etc. May be negative, indicating a downward interval.

data Quality Source

The quality component of an interval (minor, major, augmented). Generalized from single/double augmented/diminished to any number of steps.

Instances

Eq Quality 
Ord Quality 
Show Quality 
Augmentable Quality

Augmentable Quality instance

This Augmentable instance exists solely for use of the extractQuality function, which ensures that there is never any ambiguity around diminishedaugmented intervals turning into majorminor/perfect intervals.

HasQuality Quality 

data QualityType Source

The alteration implied by a quality is dependent on whether it is attached to a major/minor vs. a perfect-style number. This type represents the two possibilities.

data IntervalBasis Source

This type represents standard basis for intervbals.

Constructors

Chromatic 
Diatonic 

newtype Interval Source

Interval type.

Instances

Eq Interval 
Num Interval

Avoid using '(*)', or signum on intervals.

Ord Interval

Lexicographical ordering, comparing the d2 component of the Interval first, as it's tied to the Number which is expected to be bigger than the Quality, assuming ordinary tuning systems

Show Interval 
ToJSON Interval 
Monoid Interval 
Semigroup Interval 
IsInterval Interval 
Augmentable Interval 
HasBasis Interval 
VectorSpace Interval 
AdditiveGroup Interval 
HasNumber Interval 
HasQuality Interval 
HasSemitones Interval 
Typeable * Interval 
type Basis Interval = IntervalBasis 
type Scalar Interval = Integer 

Pitch

data Name Source

Pitch name component.

Constructors

C 
D 
E 
F 
G 
A 
B 

Instances

data Accidental Source

Accidental, represented as number of alterations. Generalized from natural and single/double sharp/flat to any number of steps.

Instances

Enum Accidental 
Eq Accidental 
Integral Accidental 
Num Accidental 
Ord Accidental 
Real Accidental 
Show Accidental 
Alterable Accidental 
(IsPitch a, Alterable a) => IsPitch (Accidental -> a)

Magic instance that allow us to write c sharp instead of sharpen c.