Safe Haskell | Safe-Inferred |
---|
Create val calls for scale degrees. These are the calls that a scale
brings into scope, so they should be referenced from
scale_note_to_call
implementations.
Synopsis
- scale_degree :: DeriveT.Scale -> Scale.PitchNn -> Scale.PitchNote -> ValCall
- pitch_expr :: Double -> Pitch.Note -> Pitch.Note
- type NamedIntervals = Map Text Rational
- scale_degree_just :: DeriveT.Scale -> NamedIntervals -> Pitch.Hz -> Scale.PitchNn -> Scale.PitchNote -> ValCall
- scale_degree_interval :: DeriveT.Scale -> NamedIntervals -> Pitch.Note -> Maybe ValCall
- interval_arg_doc :: NamedIntervals -> Doc.Doc
- resolve_intervals :: NamedIntervals -> [Either Pitch.Hz Text] -> Deriver Pitch.Hz
equal tempered
scale_degree :: DeriveT.Scale -> Scale.PitchNn -> Scale.PitchNote -> ValCall Source #
Create a pitch val call for the given scale degree. This is intended to be used by scales to generate their calls, but of course each scale may define calls in its own way.
pitch_expr :: Double -> Pitch.Note -> Pitch.Note Source #
Convert a note and frac
arg into a tracklang expression representing
that note.
TODO This is actually totally wrong, because a Pitch.Note isn't expected an
expression, but just the call part of the expression. Other functions want
to parse it, and they're not expecting spaces in there. What this should
actually do is return a real Expr Text
, or a specialized version where
the Call is known to be a Pitch.Note. But for that, scale_input_to_note
would have to change, and that would probably touch a lot of things. So
for the moment, I leave this function in place to document where a
hypothetical pitch_expr should be called, but it doesn't actually do
anything.
just
:: DeriveT.Scale | |
-> NamedIntervals | |
-> Pitch.Hz | add an arbitrary extra interval to the output |
-> Scale.PitchNn | |
-> Scale.PitchNote | |
-> ValCall |
A fancier version of scale_degree
that takes interval arguments.
resolve_intervals :: NamedIntervals -> [Either Pitch.Hz Text] -> Deriver Pitch.Hz Source #