Safe Haskell | Safe-Inferred |
---|
Synopsis
- type Ratios = Vector.Vector (Ratio.Ratio Int)
- just_base_control :: ScoreT.Control
- data ScaleMap = ScaleMap {}
- type Tuning = Text
- type Keys = Map Pitch.Key Key
- scale_map :: Keys -> Key -> Maybe Tuning -> TheoryFormat.Format -> ScaleMap
- layout :: Theory.Layout
- make_scale :: Pitch.ScaleId -> ScaleMap -> Doc.Doc -> [(Doc.Doc, Doc.Doc)] -> Scale
- default_call_doc :: DocumentedCall
- group_relative_keys :: [(Pitch.Key, Key)] -> [(Doc.Doc, Doc.Doc)]
- show_ratios :: Map Tuning Ratios -> Text
- just_doc :: Doc.Doc
- enharmonics :: Theory.Layout -> TheoryFormat.Format -> Enharmonics
- input_to_note :: ScaleMap -> Scales.InputToNote
- transpose :: TheoryFormat.Format -> Transpose
- note_to_call :: DeriveT.Scale -> ScaleMap -> Pitch.Note -> Maybe ValCall
- pitch_nn :: ScaleMap -> TheoryFormat.RelativePitch -> Scale.PitchNn
- pitch_note :: TheoryFormat.Format -> TheoryFormat.RelativePitch -> Scale.PitchNote
- transpose_to_hz :: Pitch.PitchClass -> Pitch.Hz -> TheoryFormat.Tonic -> Ratios -> Double -> Pitch.Pitch -> Pitch.Hz
- split_fraction :: (RealFrac a, Integral b) => a -> (b, a)
- degree_to_hz :: Ratios -> Pitch.Hz -> Pitch.Pitch -> Pitch.Hz
- index_mod :: Vector.Vector a -> Int -> a
- data Key = Key {}
- read_key :: ScaleMap -> Maybe Pitch.Key -> Either DeriveT.PitchError Key
- make_keys :: [Text] -> [(Text, [(Tuning, Ratios)])] -> Keys
- make_relative_fmt :: Keys -> Key -> TheoryFormat.RelativeFormat TheoryFormat.Tonic
- default_named_intervals :: ScaleDegree.NamedIntervals
Documentation
type Ratios = Vector.Vector (Ratio.Ratio Int) Source #
just_base_control :: ScoreT.Control Source #
Hz frequency of 1/1.
Bundle up data needed to construct a just scale.
ScaleMap | |
|
scale_map :: Keys -> Key -> Maybe Tuning -> TheoryFormat.Format -> ScaleMap Source #
Make a just scale with the given set of keys. A "key" in a just scale
is the set of ratios and the tonic. The number of ratios should be the same
as the number of scale degrees as defined by the TheoryFormat.Format
. If
there are too many, the extras will never be reached, if too few, they'll
wrap around.
layout :: Theory.Layout Source #
TODO this should be 'repeat 2', but as long as this is also controlling the input layout, it has to be piano layout, or it won't work properly with kbd and midi entry.
make_scale :: Pitch.ScaleId -> ScaleMap -> Doc.Doc -> [(Doc.Doc, Doc.Doc)] -> Scale Source #
default_call_doc :: DocumentedCall Source #
Call doc that assumes I'm using default_named_intervals
.
group_relative_keys :: [(Pitch.Key, Key)] -> [(Doc.Doc, Doc.Doc)] Source #
Group keys and format them into fields suitable to pass to make_scale
.
The Key
s are expected to be relative, so their key_tonic
s are ignored.
input_to_note
transpose
note_to_call
note_to_call :: DeriveT.Scale -> ScaleMap -> Pitch.Note -> Maybe ValCall Source #
To modulate to another scale: just-base = (hz (4g)) | key = g-maj
The order is important, so the (hz (4g))
happens in the context of the old
key.
transpose_to_hz :: Pitch.PitchClass -> Pitch.Hz -> TheoryFormat.Tonic -> Ratios -> Double -> Pitch.Pitch -> Pitch.Hz Source #
split_fraction :: (RealFrac a, Integral b) => a -> (b, a) Source #
Like properFraction
, but the fraction is always positive.
:: Ratios | |
-> Pitch.Hz | |
-> Pitch.Pitch | should be relative to scale's tonic |
-> Pitch.Hz |
Given a Key, convert a pitch in that key to its hz value, calculated as a ratio from the given base hz.
index_mod :: Vector.Vector a -> Int -> a Source #
key
format
:: Keys | |
-> Key | only |
-> TheoryFormat.RelativeFormat TheoryFormat.Tonic |