release
Prev | Orchestra Opcodes and Operators | Next

## release

release — Indicates whether a note is in its “release” stage.

## Description

Indicates whether a note is in its “release” stage.

## Syntax

    kflag release

## Performance

kflag -- indicates whether the note is in its “release” stage.

release outputs current note state. If current note is in the “release” stage (i.e. if its duration has been extended with xtratim opcode and if it has only just deactivated), then the kflag output argument is set to 1. Otherwise (in sustain stage of current note), kflag is set to 0.

This opcode is useful for implementing complex release-oriented envelopes.

## Examples

     instr 1 ;allows complex ADSR envelope with MIDI events
      inum notnum
      icps cpsmidi
      iamp ampmidi 4000
     ;
     ;------- complex envelope block ------
      xtratim 1 ;extra-time, i.e. release dur
      krel init 0
      krel release ;outputs release-stage flag (0 or 1 values)
      if (krel < .5) kgoto rel ;if in release-stage goto release section
     ;
     ;************ attack and sustain section ***********
      kmp1 linseg 0, .03, 1, .05, 1, .07, 0, .08, .5, 4, 1, 50, 1
      kmp = kmp1*iamp
       kgoto done
     ;
     ;--------- release section --------
       rel:
      kmp2 linseg 1, .3, .2, .7, 0
      kmp = kmp1*kmp2*iamp
      done:
     ;------
      a1 oscili kmp, icps, 1
      out a1
     endin

## See Also

xtratim

## Credits

Author: Gabriel Maldonado
Italy

New in Csound version 3.47

Prev | Up | Next
reinit | Home | repluck