musicology-pitch-0.1.0.0
CopyrightChristoph Finkensiep 2021
LicenseBSD
Maintainerchfin@chfin.de
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010
Extensions
  • UndecidableInstances
  • MonoLocalBinds
  • TypeFamilies
  • DeriveGeneric
  • DeriveAnyClass
  • TypeSynonymInstances
  • FlexibleContexts
  • FlexibleInstances
  • KindSignatures
  • ExplicitNamespaces

Musicology.Pitch.Spelled

Description

This module defines pitch and interval types for spelled pitch, i.e. Western notation.

Synopsis

Interval Types

data SInterval Source #

Constructors

SInterval 

Fields

Instances

Instances details
FromJSON SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

ToJSON SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Generic SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type Rep SInterval :: Type -> Type #

Show SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Show SPitch Source # 
Instance details

Defined in Musicology.Pitch.Spelled

NFData SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

rnf :: SInterval -> () #

Eq SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Ord SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Hashable SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Chromatic SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Diatonic SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Interval SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type ICOf SInterval Source #

Notation SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Notation SPitch Source # 
Instance details

Defined in Musicology.Pitch.Spelled

ToMidi SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

toMidi :: SInterval -> Int Source #

ToMidi SPitch Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

toMidi :: SPitch -> Int Source #

Spelled SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

AdditiveGroup SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

VectorSpace SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type Scalar SInterval #

type Rep SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type Rep SInterval = D1 ('MetaData "SInterval" "Musicology.Pitch.Spelled" "musicology-pitch-0.1.0.0-2ecZDh3I239EsXSbHoAISx" 'False) (C1 ('MetaCons "SInterval" 'PrefixI 'True) (S1 ('MetaSel ('Just "siFifths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "siOctaves") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
type ICOf SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type Scalar SInterval Source # 
Instance details

Defined in Musicology.Pitch.Spelled

newtype SIC Source #

Constructors

SIC 

Fields

Instances

Instances details
FromJSON SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

ToJSON SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Generic SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type Rep SIC :: Type -> Type #

Methods

from :: SIC -> Rep SIC x #

to :: Rep SIC x -> SIC #

Show SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

showsPrec :: Int -> SIC -> ShowS #

show :: SIC -> String #

showList :: [SIC] -> ShowS #

Show SPC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

showsPrec :: Int -> SPC -> ShowS #

show :: SPC -> String #

showList :: [SPC] -> ShowS #

NFData SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

rnf :: SIC -> () #

Eq SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

(==) :: SIC -> SIC -> Bool #

(/=) :: SIC -> SIC -> Bool #

Ord SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

compare :: SIC -> SIC -> Ordering #

(<) :: SIC -> SIC -> Bool #

(<=) :: SIC -> SIC -> Bool #

(>) :: SIC -> SIC -> Bool #

(>=) :: SIC -> SIC -> Bool #

max :: SIC -> SIC -> SIC #

min :: SIC -> SIC -> SIC #

Hashable SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

hashWithSalt :: Int -> SIC -> Int #

hash :: SIC -> Int #

Chromatic SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Diatonic SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

isStep :: SIC -> Bool Source #

Interval SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type ICOf SIC Source #

IntervalClass SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type IOf SIC Source #

Methods

emb :: SIC -> IOf SIC Source #

Notation SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Notation SPC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

ToMidi SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

toMidi :: SIC -> Int Source #

ToMidi SPC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

toMidi :: SPC -> Int Source #

Spelled SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

AdditiveGroup SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Methods

zeroV :: SIC #

(^+^) :: SIC -> SIC -> SIC #

negateV :: SIC -> SIC #

(^-^) :: SIC -> SIC -> SIC #

VectorSpace SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

Associated Types

type Scalar SIC #

Methods

(*^) :: Scalar SIC -> SIC -> SIC #

type Rep SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type Rep SIC = D1 ('MetaData "SIC" "Musicology.Pitch.Spelled" "musicology-pitch-0.1.0.0-2ecZDh3I239EsXSbHoAISx" 'True) (C1 ('MetaCons "SIC" 'PrefixI 'True) (S1 ('MetaSel ('Just "sFifth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
type ICOf SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type ICOf SIC = SIC
type IOf SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type Scalar SIC Source # 
Instance details

Defined in Musicology.Pitch.Spelled

type Scalar SIC = Int

Pitch Types

Common Accessors

letter :: Spelled i => i -> Char Source #

Concrete Intervals

Concrete intervals come in two variants, one for intervals (e.g. fifth) and one for interval classes (fifth'). Imperfect intervals have a ImperfectInterval type and must be used with major or minor (e.g. minor third). All (fully applied) intervals can be used with aug, dim and down

Concrete pitches

Concrete pitches are constructed from an accidental (flt, nat, or shp) and (for non-class pitches) and octave number.

newtype Accidental Source #

Constructors

Acc Int