Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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

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

 # Methods(==) :: Key -> Key -> Bool #(/=) :: Key -> Key -> Bool # # MethodsshowsPrec :: Int -> Key -> ShowS #show :: Key -> String #showList :: [Key] -> ShowS # # MethodsformatList :: [Key] -> Doc Source #

# named intervals

Default named intervals.