Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)

Derive.Scale.JustScales

Synopsis

# Documentation

Hz frequency of 1/1.

data ScaleMap Source #

Bundle up data needed to construct a just scale.

Constructors

 ScaleMap Fieldssmap_fmt :: TheoryFormat.Format smap_keys :: Keys smap_default_key :: Key smap_default_tuning :: Maybe TuningUse this Tuning if there is no EnvKey.tuning. If Nothing, don't even look for EnvKey.tuning, and use "" for key_ratios.smap_default_base_hz :: Pitch.HzPreviously I would default to the 12TET of the tonic when just-base isn't set, but that doesn't work when the scale doesn't use 12TET names.smap_named_intervals :: ScaleDegree.NamedIntervals smap_accidental_interval :: DoubleSharps multiply by this, flats divide by this.While these scales recognize sharps and flats, and input_to_note will create them, they are still considered diatonic scales, and the accidentals are not considered part of the scale. So chromatic transposition is treated the same as diatonic transposition, and you can't root a key on a note with an accidental.

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.

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.

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 Keys are expected to be relative, so their key_tonics are ignored.

# note_to_call

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.

split_fraction :: (RealFrac a, Integral b) => a -> (b, a) Source #

Like properFraction, but the fraction is always positive.

Arguments

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

# key

data Key Source #

Constructors

 Key Fields

#### Instances

Instances details
 Source # Instance detailsDefined in Derive.Scale.JustScales MethodsshowsPrec :: Int -> Key -> ShowS #show :: Key -> String #showList :: [Key] -> ShowS # Source # Instance detailsDefined in Derive.Scale.JustScales Methods(==) :: Key -> Key -> Bool #(/=) :: Key -> Key -> Bool # Source # Instance detailsDefined in Derive.Scale.JustScales MethodsformatList :: [Key] -> Doc Source #

make_keys :: [Text] -> [(Text, [(Tuning, Ratios)])] -> Keys Source #

# format

Arguments

 :: Keys -> Key only key_tonic is used -> TheoryFormat.RelativeFormat TheoryFormat.Tonic