Safe Haskell | None |
---|---|
Language | Haskell2010 |
Absolute pitch representation.
- newtype Hertz = Hertz {}
- data Cents
- data Fifths
- class HasFrequency a where
- fifths :: HasFrequency a => a -> Fifths
- cents :: HasFrequency a => a -> Cents
Absolute pitch representation
Absolute frequency in Hertz.
Number of cents.
Cents are a logarithmic representation of frequency such that
f * (2/1) = frequency (cents f + 1200)
Number of pure fifths.
Fifths are a logarithmic representation of frequency.
f * (3/2) = frequency (fifths f + 1)
HasFrequency class
class HasFrequency a where Source
fifths :: HasFrequency a => a -> Fifths Source
Convert a frequency to fifths.
cents :: HasFrequency a => a -> Cents Source
Convert a frequency to cents.