passing
Returns an array with additional 'passing notes'
Syntax
Usage
The idea behind passing is to generate passing notes from a chord.passing takes an array with scale degree values and returns a larger array with interpolated values interleaved between the original scale degrees (and a neighbour note on top). The interleaved values are drawn from gi_CurrentScale.
For example, passing(fillarray(0,3,6)) may return an array => [0,2,3,5,6,10].
passing can be useful for event generation UDO's that accept an array of pitches such as arpi, chrdi, orn and loopevent
Outputs and Arguments
i/kinArr -- An array with pitch indices.
i/kskew (optional, default=0.5) -- A preference to select interpolated scale degrees closer to the scale note (toward 0), or to the neighbour note (toward 1).
Example
passing.orc
| passing |
|---|
| scalemode31 0,"major"
instr Sound101
;; Sound source
ares vco2 p4,p5
kfr transeg 4000, 0.4, 3, p5*4, p3-0.4, 2, p5*2
ares moogladder2 ares,kfr,0.4
ares *= xadsr(0.001,p3*0.4,0.5,p3*0.5)
send ares
endin
patchsig "Sound101", "outs"
instr Sched12
;; recursive trigger instrument.
ipitchselection[] = rndpick(fillarray_i(0,1,2,3,4,5,6), 3)
;; pick 3 random pitches from an array
indx = 0
until indx == lenarray(ipitchselection) do
schedule "Sound101",0,5,0.5,cpstuni(ipitchselection[indx], gi_CurrentScale)
indx += 1
od
;; play a chord
ifrills[] passing ipitchselection
;; get embellishments
ifrillndx = 0
until ifrillndx == lenarray(ifrills) do
schedule "Sound101",ifrillndx*0.25,2,0.4,cpstuni(ifrills[ifrillndx] + 7, gi_CurrentScale)
schedule "Sound101",ifrillndx*0.25 + 2,0.25,0.4,cpstuni(ifrills[ifrillndx], gi_CurrentScale)
;; play the embellishments
ifrillndx += 1
od
schedule p1, nextbeat(4), 1
turnoff
endin
schedule "Sched12", 0,1
;; start the show.
|