Safe Haskell | Safe-Inferred |
---|
Affine
and instances.
module Util.Affine (Affine(..), (.-^)) where
Synopsis
- class Num (Diff p) => Affine p where
- (.-^) :: Affine p => p -> Diff p -> p
- newtype Chromatic = Chromatic Int
- newtype ChromaticSteps = ChromaticSteps Int
- newtype Diatonic = Diatonic Int
- newtype DiatonicSteps = DiatonicSteps Int
- newtype FChromatic = FChromatic Double
- newtype FChromaticSteps = FChromaticSteps Double
- newtype FDiatonic = FDiatonic Double
- newtype FDiatonicSteps = FDiatonicSteps Double
Documentation
class Num (Diff p) => Affine p where Source #
Simplified version of AffineSpace from the vector-space package.
Num gives access to negate and (+) and (*). It's probably technically too much because it also has fromInteger, but I don't think I need the whole AdditiveGroup etc. alternative numeric hierarchy.
Instances
Affine Chromatic Source # | |
Affine Diatonic Source # | |
Affine FChromatic Source # | |
Defined in Util.Affine type Diff FChromatic Source # (.-.) :: FChromatic -> FChromatic -> Diff FChromatic Source # (.+^) :: FChromatic -> Diff FChromatic -> FChromatic Source # | |
Affine FDiatonic Source # | |
Affine UTCTime Source # | |
base types
pitch
Absolute chromatic steps.
newtype ChromaticSteps Source #
Relative chromatic steps, modulo pc_per_octave.
Instances
newtype DiatonicSteps Source #
Instances
newtype FChromatic Source #
Instances
Show FChromatic Source # | |
Defined in Util.Affine showsPrec :: Int -> FChromatic -> ShowS # show :: FChromatic -> String # showList :: [FChromatic] -> ShowS # | |
Eq FChromatic Source # | |
Defined in Util.Affine (==) :: FChromatic -> FChromatic -> Bool # (/=) :: FChromatic -> FChromatic -> Bool # | |
Ord FChromatic Source # | |
Defined in Util.Affine compare :: FChromatic -> FChromatic -> Ordering # (<) :: FChromatic -> FChromatic -> Bool # (<=) :: FChromatic -> FChromatic -> Bool # (>) :: FChromatic -> FChromatic -> Bool # (>=) :: FChromatic -> FChromatic -> Bool # max :: FChromatic -> FChromatic -> FChromatic # min :: FChromatic -> FChromatic -> FChromatic # | |
Affine FChromatic Source # | |
Defined in Util.Affine type Diff FChromatic Source # (.-.) :: FChromatic -> FChromatic -> Diff FChromatic Source # (.+^) :: FChromatic -> Diff FChromatic -> FChromatic Source # | |
type Diff FChromatic Source # | |
Defined in Util.Affine |
newtype FChromaticSteps Source #
Instances
newtype FDiatonicSteps Source #