Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Derive.Call.ScaleDegree

Description

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

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

type NamedIntervals = Map Text Rational Source #

Map from named intervals to the interval's ratio.

scale_degree_just Source #

Arguments

:: 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.