Safe Haskell | None |
---|---|
Language | Haskell2010 |
Common interval quality.
- data Quality
- qualityTypes :: Quality -> [QualityType]
- class HasQuality a where
- invertQuality :: Quality -> Quality
- isPerfect :: HasQuality a => a -> Bool
- isMajor :: HasQuality a => a -> Bool
- isMinor :: HasQuality a => a -> Bool
- isAugmented :: HasQuality a => a -> Bool
- isDiminished :: HasQuality a => a -> Bool
- data QualityType
- expectedQualityType :: Number -> QualityType
- data Direction
- qualityToAlteration :: Direction -> QualityType -> Quality -> Maybe ChromaticSteps
- qualityToDiff :: Bool -> QualityType -> Quality -> ChromaticSteps
Quality
The quality component of an interval (minor, major, augmented). Generalized from single/double augmented/diminished to any number of steps.
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
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