Closed hanshoglund closed 10 years ago
This is easy to define for Common:
Common
upDiatonic :: Pitch -> Number -> Pitch -> Pitch upDiatonic origin n = relative origin $ \x -> mkInterval (quality x) (number x + n)
Is there a more generic notion, i.e. using another type function?
upSteps :: LargeStep a -> a -> a ...
Inversion is similar
invertPitchesDiatonically :: Pitch -> Pitch -> Pitch invertPitchesDiatonically origin n = relative origin $ \x -> mkInterval (quality x) (negate (number x))
More generally
diatonically :: Pitch -> (Number -> Number) -> Pitch -> Pitch diatonically origin f = relative origin $ \x -> mkInterval (quality x) (f (number x))
TODO use an Iso Interval (Quality, Number) for more elegant definitions.
Iso Interval (Quality, Number)
TODO neither of these work at the moment, as mkInterval is now strict enough to complain when given perfect instead of major and vice versa.
mkInterval
This is easy to define for
Common
:Is there a more generic notion, i.e. using another type function?
Inversion is similar
More generally
TODO use an
Iso Interval (Quality, Number)
for more elegant definitions.TODO neither of these work at the moment, as
mkInterval
is now strict enough to complain when given perfect instead of major and vice versa.