Karya, built on 2018-03-16T03:22:32 (patch df7306861219887e676081746f4a4edfe05eb0b5)

Derive.EnvKey

Description

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

Synopsis

# Documentation

type Key = Text Source #

Symbols to look up a val in the ValMap.

# directly supported by core derivers

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

VAttributes: Default set of attrs.

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.

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

VInstrument: Default instrument.

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.

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.

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

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.

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

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.

VNum: Sampling rate used by signal interpolators.

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.

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.

# internal

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.

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

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

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

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

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

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.

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?

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.

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

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.

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.

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

# im-specific

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

Instrument role.

Instrument role.