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

Derive.Scale

Contents

Description

Scale is actually defined in Derive.Deriver.Monad to avoid circular imports. But you should refer to it from here.

The difference between this and Derive.Scale.Scales is that this is intended for using scales, while Scales is intended for implementing them.

Synopsis

# Documentation

data Make Source #

Constructors

 Make !Pitch.ScaleId !(Text, DocumentedCall) !(BaseTypes.Environ -> LookupScale -> Either BaseTypes.PitchError Scale) Fancy scales can configure themselves. Since you can't just look at the Scale directly, it has the ScaleId (pattern, doc) extracted. Simple !Scale

I would much rather pass a more specific value than Environ. Unfortunately, ChromaticScales.SemisToNoteNumber needs a per-scale value (e.g. Environ.key or Environ.tuning). So pitch_nn needs to be parameterized with a "get_key" function, but it also needs Environ.key. I think it's doable by parameterizing pitch_nn and hence note_to_call and moving smap_semis_to_nn into note_to_call, but it seems complicated.

Number of chromatic steps in an octave. Nothing if this scale doesn't have octaves.

Number of diatonic steps in an octave. Nothing if this scale doesn't have octaves. This is the same as semis_per_octave for scales without a diatonic/chromatic distinction.

# Range

data Range Source #

This is an inclusive pitch range, intended for instrument ranges.

Constructors

 Range Fields

Instances

 # MethodsshowsPrec :: Int -> Range -> ShowS #show :: Range -> String #showList :: [Range] -> ShowS # # MethodsformatList :: [Range] -> Doc Source #

# pitches

Return the pitches in the scale. If the scale has an unbounded range, this may go on forever, so zip with note_numbers if you want the usable range. ALso, not all scales actually have defined degrees.

Return the notes in the scale. As with pitches, it may be unbounded.

Return pitches of the scale's degrees.

Make a patch scale from the NoteNumbers.

assign_keys :: Int -> [Pitch.NoteNumber] -> [(Int, Pitch.NoteNumber)] Source #

Try to assign MIDI keys that correspond to the NoteNumbers, but they won't line up if there are too many NoteNumbers.