Safe Haskell | None |
---|
- class Augmentable a where
- data Quality
- class HasQuality a where
- 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
- diffToQuality :: Bool -> Int -> Quality
- qualityToDiff :: Bool -> Quality -> Int
- invertQuality :: Quality -> Quality
- replicate' :: Integral a1 => a1 -> a -> [a]
Augmentable class
class Augmentable a whereSource
Class of types that can be augmented.
Increase the size of this interval by one.
Decrease the size of this interval by one.
Quality
Interval quality is either perfect, major, minor, augmented, and
diminished. This representation allows for an arbitrary number of
augmentation or diminishions, so augmented is represented by Augmented
1
, doubly augmented by Augmented 2
and so on.
The quality of a compound interval is the quality of the simple interval on which it is based.
isPerfect :: HasQuality a => a -> BoolSource
Returns whether the given quality is perfect.
isMajor :: HasQuality a => a -> BoolSource
Returns whether the given quality is major.
isMinor :: HasQuality a => a -> BoolSource
Returns whether the given quality is minor.
isAugmented :: HasQuality a => a -> BoolSource
Returns whether the given quality is augmented (including double augmented etc).
isDiminished :: HasQuality a => a -> BoolSource
Returns whether the given quality is diminished (including double diminished etc).
diffToQuality :: Bool -> Int -> QualitySource
Convert an offset to a quality.
This is different for perfect and imperfect interals:
Imperfect Perfect === === -3 dd ddd -2 d dd -1 m d 0 M P 1 a a 2 aa aa
qualityToDiff :: Bool -> Quality -> IntSource
replicate' :: Integral a1 => a1 -> a -> [a]Source