Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype Check a = Check {}
- (<=>) :: a -> a -> Check a -> Bool
- (>$<) :: (a -> b) -> Check b -> Check a
- (>$) :: (a -> a) -> Check a -> Check a
- ($<) :: (a -> a) -> Check a -> Check a
- type ApproxCheck a = (?p :: Float) => Check a
- (~~) :: ((?p :: Float) => r) -> Float -> r
- exactOf :: ApproxCheck Pattern
- transpositionOf :: ApproxCheck Pattern
- transpositionOfPitchOnly :: ApproxCheck Pattern
- inversionOf :: ApproxCheck Pattern
- retrogradeOf :: ApproxCheck Pattern
- rotationOf :: ApproxCheck Pattern
- augmentationOf :: ApproxCheck Pattern
- tonalTranspOf :: ApproxCheck Pattern
- tonalTranspOfCan :: ApproxCheck Pattern
- tonalTransCanOfCore :: Check Pattern
- tonalInversionOfCan :: ApproxCheck Pattern
- trInversionOf :: ApproxCheck Pattern
- trAugmentationOf :: ApproxCheck Pattern
- trRetrogradeOf :: ApproxCheck Pattern
- trtonRotationOf :: ApproxCheck Pattern
- trtonAugmentationOf :: ApproxCheck Pattern
- equal :: Eq a => Check a
- maxLookahead :: Int
- approxEqWith :: forall b. (Show b, Num b, Eq b) => (b -> [b] -> Int -> Maybe (Int, [b])) -> ApproxCheck [b]
- approxEq :: (Show a, Num a, Eq a) => ApproxCheck [a]
- approxEq2 :: (Show a, Ord a, Num a, Eq a) => ApproxCheck [a]
Documentation
Check | Checks two patterns (horizontal translation in time is always assumed). |
type ApproxCheck a = (?p :: Float) => Check a Source #
exactOf :: ApproxCheck Pattern Source #
Exact repetition: move a pattern in time. (AKA horizontal translation)
transpositionOf :: ApproxCheck Pattern Source #
Transposition: move a pattern in pitch. (AKA horizontal+vertical translation)
inversionOf :: ApproxCheck Pattern Source #
Inversion: negate all pitch intervals (starting from the same base pitch).
retrogradeOf :: ApproxCheck Pattern Source #
Retrograde: mirror a pattern in both pitch and rhythm. (AKA vertical reflection)
rotationOf :: ApproxCheck Pattern Source #
Rotation: reversal of pitch intervals and reversal of rhythm. (AKA retrograde inversion)
augmentationOf :: ApproxCheck Pattern Source #
Augmentation: speed-up/slow-down the rhythmic structure of a pattern.
tonalTranspOf :: ApproxCheck Pattern Source #
Octave-agnostic tonal transposition, wrt a scale that fits
the base pattern
e.g. [I, IV, V] tonalTranspOf [III, VI, VII]
tonalTranspOfCan :: ApproxCheck Pattern Source #
Taking into account of multiple possibilities of scales like in tonalTransCanofCore, but with approximation in the checking
tonalTransCanOfCore :: Check Pattern Source #
Instead guess one scale, then check the scale degrees, we guess three scales, and fold over all the possible scale degree checks with || The core is a version that does not allow for approximation
trInversionOf :: ApproxCheck Pattern Source #
Transposition + Inversion.
trAugmentationOf :: ApproxCheck Pattern Source #
Transposition + Augmentation.
trRetrogradeOf :: ApproxCheck Pattern Source #
Transposition + Retrograde.
trtonRotationOf :: ApproxCheck Pattern Source #
New tonal versions
equal :: Eq a => Check a Source #
Check that two elements are exactly equal (using eq
).
e.g. [a, c, b] equal [a, c, b]
maxLookahead :: Int Source #
Influences the accuracy of approxEq
, but also dramatically reduces
execution time of the analysis.
approxEq :: (Show a, Num a, Eq a) => ApproxCheck [a] Source #
First-order approximate equality of lists.
Check that two lists are approximately equal, wrt a certain percentage.
A base pattern and an occurence are approximately equal with percentage p
when:
1. The occurence ignores (1-p)% notes of the base pattern
2. (1-p)% notes of the occurence are additional notes (not in the base pattern)
e.g. [A,C,F,A,B] (approxEq 80%) [A,C,G,A,B]
approxEq2 :: (Show a, Ord a, Num a, Eq a) => ApproxCheck [a] Source #
Second-order approximate equality of lists.
The essential difference with first-order approximate equality is the ability to equate consecutive elements with their sum, hence the Ord/Num constraint.
NB: motivated by lists which are the result of pairing an initial list and we count approximation by checking the initial lists e.g. * intervals from pitches * rhythm from durations