kill
Prev | Orchestra Opcodes and Operators | Next

## kill

kill — Stops a given instrument instance.

## Description

Given a valid instrument instance, this opcode stops it.

## Syntax

    kill kinstance

## Performance

kinstance -- a valid instrument instance. Whether of finite duration or “held”, the instance currently being performed is immediately removed from the active instance list. No other instances are affected.

## Examples

The following example uses the kill opcode. It uses the file kill.csd.

Example 409. Example of the kill 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
    ; Audio out   Audio in
    -odac           -iadc    ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o kill.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    giHandleinstance 1, 0, 4
    ; Instrument #1.
    instr 1
      k1 expon 440, p3/10,880     ; begin gliss and continue
      if k1 < sr/2  kgoto contin  ; until Nyquist detected
        kill giHandle ; then quit

    contin:
      a1 oscili 10000, k1
      out a1
    endin

    </CsInstruments>
    <CsScore>
    </CsScore>
    </CsoundSynthesizer>

## See Also

ihold, turnon

Prev | Up | Next
kgoto | Home | kr