limit1
Prev | Orchestra Opcodes and Operators | Next

## limit1

limit1 — Limiting function

## Description

Limits the value of an argument to the range [0,1].

## Syntax

    ires[] limit1 iarg

    kres[] limit1 karg

## Initialization

iarg[] -- the argument.

## Performance

karg[] -- the argument.

## Examples

Here is an example of the limit1 opcode. It uses the file limit1.csd.

Example 469. Example of the limit1 opcode.

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

    <CsoundSynthesizer>
    <CsOptions>
    </CsOptions>
    <CsInstruments>

    instr 1

    iArg1[] fillarray 1,2,3
    iRes[] limit1 iArg1/2.5
    ik init 0

    while ik < lenarray(iRes) do
     print iRes[ik]
     ik += 1
    od

    endin

    </CsInstruments>
    <CsScore>
    i1 0 0
    </CsScore>
    </CsoundSynthesizer>

## Credits

Author: Victor Lazzarini
2017

Prev | Up | Next
limit | Home | line