music-pitch-1.9.0: Musical pitch representation.

Safe HaskellNone
LanguageHaskell2010

Music.Pitch.Common.Pitch

Contents

Description

Common pitch.

Synopsis

Accidentals

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.

natural :: Accidental Source

The natural accidental.

flat :: Accidental Source

The flat accidental.

sharp :: Accidental Source

The sharp accidental.

doubleFlat :: Accidental Source

The double flat accidental.

doubleSharp :: Accidental Source

The double sharp accidental.

Inspecting accidentals

isNatural :: Accidental -> Bool Source

Returns whether this is a natural accidental.

isFlattened :: Accidental -> Bool Source

Returns whether this is a flat, double flat etc.

isSharpened :: Accidental -> Bool Source

Returns whether this is a sharp, double sharp etc.

isStandardAccidental :: Accidental -> Bool Source

Returns whether this is a standard accidental, i.e. either a double flat, flat, natural, sharp or double sharp.

Name

data Name Source

Pitch name component.

Constructors

C 
D 
E 
F 
G 
A 
B 

Instances

Pitch

data Pitch Source

Pitch type.

Instances

Enum Pitch 
Eq Pitch 
Num Pitch 
Ord Pitch 
Show Pitch 
IsPitch Pitch 
Alterable Pitch 
AffineSpace Pitch 
ToJSON Pitch 
FromJSON Pitch 
Typeable * Pitch 
type Diff Pitch = Interval 

mkPitch :: Name -> Accidental -> Pitch Source

Creates a pitch from name accidental.

name :: Pitch -> Name Source

Returns the name of a pitch.

To convert a pitch to a numeric type, use octaves, steps or semitones on the relevant interval type, for example:

semitones ('a\'' .-. c)

accidental :: Pitch -> Accidental Source

Returns the accidental of a pitch.

See also octaves, and steps and semitones.

Diatonic and chromatic pitch