chrdi
Generates a series of concurrent score events separated by intervals.
Syntax
Usage
chrdi generates 'chords' from a note, and an array of pitches.
Given an array of values representing a score event (p-fields), chrdi generates additional score events.
An array specifies pitch intervals around p5 in the event. Other than pitches, all other parameters in the event are duplicated.
Arguments
i/kevent[] -- An array with values holding p-fields for a score event. kevent must have at least five p-fields representing the following values: p1=instrument, p2=onset, p3=duration, p4=amplitude(0-1), p5=pitch
Additional pfields up to p10 are optional (lenarray(kevent) <= 10)
P-fields
For p1 i/kevent[], the number of the instrument is required (rather than the name). For named instruments, it is recommended to extract this using n (e.g. n("piano")).
For p2 and p3, note that onset time and duration are assumed to be in 'beats' rather than seconds.
For p5. pitch is assumed to be a scale degree index in gi_CurrentScale.
i/kintervals[] -- Intervals (as specified in iscale). The pitches of generated events sum the pitch from p5 in i/kevent with the values in i/kintervals.
idbamp (optional, default=0) -- reduces the p4 values of events as the number of concurrent events increases. Assuming p4 is amplitude, a value of -3 reduces this by 3db every doubling of notes. Default is 0 (no reduction)
iturnofftm (optional, default=0) -- When greater than zero (iturnofftm > 0), turns off the most recent instance after iturnofftm seconds.
When less than zero (iturnofftm < 0), turns off the oldest instance after abs(iturnofftm)
This can be useful if using i/kevent[] with negative p3 (always on).
iautoinvert (optional, default=-1, no inversion) -- constrains pitches to pitch classes within n octaves, starting from zero (within one octave).
For example, if kintervals[] fillarray 4,6,8, and iautoinvert = 0 in a diatonic major scale, then the resultant pitches 1,4,6 are generated (the 8 drops an octave).
irndspread (optional, default=0) -- Add some randomisation to the onsets of generated events.
The onset is calculated as i/kevent onset + betarand:i(ievent[2],irndspread,2-irndspread.
Expected values between 0 - 1. Small values (c.a. 0.05) are useful to 'humanise' chord onsets.
insincr (optional, default=0, -p3 default=0.01) -- Increment the p1 value of generated events by a fractional amount. Useful for 'always on' events.
Expected values are between 0 < 1. A value of 1 is converted to 0.01. If a negative p3 is detected in i/kevent, insincr uses 0.01.
i/kscale (optional, default=gi_CurrentScale) -- Use this scale for pitch generation.