lpshold
Prev | Orchestra Opcodes and Operators | Next

## lpshold

lpshold — Generate control signal consisting of held segments.

## Description

Generate control signal consisting of held segments delimited by two or more specified points. The entire envelope is looped at kfreq rate. Each parameter can be varied at k-rate.

## Syntax

    ksig lpshold kfreq, ktrig, iphase, ktime0, kvalue0  [, ktime1] [, kvalue1] [, ktime2] [, kvalue2] [...]

## Performance

ksig -- Output signal

kfreq -- Repeat rate in Hz or fraction of Hz

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.

ktime0...ktimeN -- Times of points; expressed in fraction of a cycle

kvalue0...kvalueN -- Values of points

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.

Example 429. Example of the lpshold opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <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 = 44100
    ksmps = 32
    nchnls = 2
    0dbfs  = 1

    instr 1

    kfrq line 15, p3, .1
    klp  lpshold kfrq, 0, 0, p3*0.25, 220, p3*0.5, 440, p3*0.25, 0
    asig oscili .6, 440+klp, 1
         outs asig, asig

    endin
    </CsInstruments>
    <CsScore>
    ; sine wave.
    f 1 0 16384 10 1

    i 1 0 10

    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

loopseg

## Credits

Author: Gabriel Maldonado

New in Version 4.13

Prev | Up | Next
lpreson | Home | lpsholdp