ktrig -- If non-zero, retriggers the envelope from start (see trigger opcode), before the envelope cycle is completed.
iphase -- A vaue between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.
kvalue0...kvalueN -- Values of points
ktime0...ktimeN -- Times between points; expressed in fractions of a cycle (see below). The final time designates a ramp between the final value and the first value.
lpshold is similar to loopseg, but can generate only horizontal segments, i.e. holds values for each time interval placed between ktimeN and ktimeN+1. It can be useful, among other things, for melodic control, like old analog sequencers.
Examples
Here is an example of the lpshold opcode. It uses the file lpshold.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac;;;realtime audio out;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o lpshold.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1instr1kfrqinitp4; frequency of the loop ifrac=p5; fraction of frequency at which to force retriggeripan=p6; pan positionktrigmetrokfrq*ifrac; trigger to force restart the loopiphs=0; initial phase of the loop; a loop of midi note numbers: note duration etc...knotelpsholdkfrq,ktrig,iphs,61,0.0625,60,0.9375,61,1,58,1,\
63,2,65,3aenvlinseg0,0.01,1,p3-0.11,1,0.1,0; amplitude envelopekrndrspline-0.05,0.05,0.5,1; random detuneasiggbuzz0.2*aenv,cpsmidinn(knote+krnd),30,1,0.5,1outsasig*ipan,asig*(1-ipan)endin</CsInstruments><CsScore>; cosine wave.f1016384111; 3 layers of the loop are played, each at a different speed, ; - with different retriggering rate, and pan location.i10600.5[8/10]0.5i10600.375[8/11]0.1i10600.25[8/13]0.9e</CsScore></CsoundSynthesizer>