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



Define a few inhabitants of Environ which are used by the built-in set of calls. Expected types are in hardcoded_types.



type Key = Text Source #

Symbols to look up a val in the ValMap.

directly supported by core derivers

args :: Key Source #

VList: arguments for a requires_postproc call. Also see make_delayed.

attributes :: Key Source #

VAttributes: Default set of attrs.

block_end :: Key Source #

ScoreTime: the block deriver sets it to the ScoreTime end of the block. Blocks always start at zero, but this is the only way for a call to know if an event is at the end of the block.

control :: Key Source #

VStr: Set to the control that is being derived, inside of a control track.

instrument :: Key Source #

VInstrument: Default instrument.

key :: Key Source #

VStr: Many scales use this for scale-specific configuration. Some scales conceptually have a separate key and mode, e.g. C minor, in which case they're combined into key.

note_end :: Key Source #

VNum (ScoreTime): End time of the note event. This is set when evaluating note events so that inverted control tracks know when their parent event ends.

note_start :: Key Source #

This is just like note_end, except, you know, the other end.

merge :: Key Source #

VStr: Set along with control to the Merge function which will be used for this control track. Calls can use this to subvert the merge function and emit an absolute value.

Values are compose for tempo tracks, set, or any of the names from ControlOp.

scale :: Key Source #

VStr: Default scale, used by pitch tracks with a * title.

seed :: Key Source #

VNum: Random seed used by randomization functions. Can be explicitly initialized to capture a certain "random" variation.

This is rounded to an integer, so only integral values make sense.

srate :: Key Source #

VNum: Sampling rate used by signal interpolators.

tempo :: Key Source #

VNum: Set the default tempo, overriding default_tempo. This only applies if there is no toplevel tempo track, and generally only has an effect if the block is played as a toplevel block since it's a constant tempo.

Previously I would directly set the tempo warp in the equal call, but tempo setting has to be at the toplevel tempo track for it to interact properly with block call stretching.

track_voice :: Key Source #

VNum: this is the count of the tracks with the same instrument, starting from 0 on the left. So three tracks named >pno would be 0, 1, and 2, respectively. Used with Derive.Call.InferTrackVoice.


suppress_until :: Key Source #

RealTime: suppress other notes until this time, inclusive. Only events without a suppress-until will be retained. Applied by infer-duration, see Derive.Call.Post.Move.

dynamic_val :: Key Source #

VNum: This is a bit of a hack for the dynamic to velocity conversion in Perform.Midi.Convert. The default note deriver stashes the control function output here so it can use it for note on velocity. Otherwise I couldn't use ControlFunctions (e.g. randomization) for note on velocity because control functions don't exist after MIDI conversion.

Details in NOTE [EnvKey.dynamic_val].

release_val :: Key Source #

Like dynamic_val, but for the release velocity. Set from release_velocity.

attack_val :: Key Source #

VNum: Set from attack_velocity in the same way as release_val.

start_offset_val :: Key Source #

RealTime: This stores the RealTime sum of start_s and start_t, and is later applied by the apply-start-offset postproc.

control_gt_0 :: Key Source #

Bool: Control tracks normally range from 0 to 1, or -1 to 1. This is set for control tracks which range >0. That's just the tempo track for now.

supported by not so core derivers

instrument_top :: Key Source #

VNotePitch or VNum (NN): The top of the instrument's range.

It's a VNotePitch for instruments that are tied to a particular family of scales, and have an upper note that is independent of any particular frequency. For instance, a kantilan's top note will have a different NoteNumber depending on its scale, or even within a single scale, depending if it is pengumbang or pengisep.

For instruments with less complicated scale requirements, NoteNumber is simpler.

open_strings :: Key Source #

List VPitch: tuning of open strings for this instrument. The pitches should be probably absolute NNs, not in any scale, so they work regardless of which scale you happen to be in.

TODO maybe it should be VNotePitch as with instrument_top?

string :: Key Source #

VPitch: Select a string to play on. Presumably it should be from one of the open_strings. TODO currently I address strings by pitch. It's convenient because general purpose string calls work with pitches, but will be ambiguous for instruments where multiple strings have the same pitch.

tuning :: Key Source #

VStr: Kind of tuning for the scale in scope. The meaning is dependent on the scale, e.g. ngumbang ngisep for Balinese scales.

voice :: Key Source #

VNum: Separate notes into different voices. This is used by integrate to put them on their own tracks, and by the lilypond backend to split them into their own voices. Should be an integer from 1 to 4.

hand :: Key Source #

VStr: right, r, left, or l. Used by the lilypond backend, and also by any call that relies on an instrument's parts being divided by hand.

hold :: Key Source #

VNum: hold the start of a call for a certain amount of ScoreTime or RealTime.


element :: Key Source #

VStr: Used by the im backend to put into element.


polos :: Text Source #

Instrument role.

sangsih :: Text Source #

Instrument role.