music-pitch-1.9.0: Musical pitch representation.

Safe HaskellNone
LanguageHaskell2010

Music.Pitch.Common.Quality

Contents

Description

Common interval quality.

Synopsis

Quality

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 

qualityTypes :: Quality -> [QualityType] Source

Return all possible quality types for a given quality.

class HasQuality a where Source

Types of value that has an interval quality (mainly Interval and Quality itself).

Methods

quality :: a -> Quality Source

invertQuality :: Quality -> Quality Source

Invert a quality.

Perfect is unaffected, major becomes minor and vice versa, augmented becomes diminished and vice versa.

isPerfect :: HasQuality a => a -> Bool Source

Returns whether the given quality is perfect.

isMajor :: HasQuality a => a -> Bool Source

Returns whether the given quality is major.

isMinor :: HasQuality a => a -> Bool Source

Returns whether the given quality is minor.

isAugmented :: HasQuality a => a -> Bool Source

Returns whether the given quality is augmented (including double augmented etc).

isDiminished :: HasQuality a => a -> Bool Source

Returns whether the given quality is diminished (including double diminished etc).

Quality type

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.

expectedQualityType :: Number -> QualityType Source

  The quality type expected for a given number, i.e. perfect for unisons, fourths, and fifths and major/minor for everything else.

Quality to alteration

qualityToAlteration :: Direction -> QualityType -> Quality -> Maybe ChromaticSteps Source

Return the alteration in implied by the given quality to a number of a given quality type.

qualityToDiff :: Bool -> QualityType -> Quality -> ChromaticSteps Source

Deprecated: Use qualityToAlteration