| 1 | |
| 2 | <refentry id="release"> |
| 3 | <indexterm id="IndexRelease"><primary>release</primary></indexterm> |
| 4 | <refentryinfo><title>Real-time MIDI:Event Extenders</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>release</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>release</refname> |
| 13 | |
| 14 | <refpurpose> |
| 15 | Indicates whether a note is in its <quote>release</quote> stage. |
| 16 | </refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | <refsect1> |
| 20 | <title>Description</title> |
| 21 | <para> |
| 22 | Provides a way of knowing when a note off message for the current note is received. Only a noteoff message with the same MIDI note number as the one which triggered the note will be reported by <emphasis>release</emphasis>. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>kflag <command>release</command></synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Performance</title> |
| 33 | <para> |
| 34 | <emphasis>kflag</emphasis> -- indicates whether the note is in its <quote>release</quote> stage. (1 if a note off is received, otherwise 0) |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>release</emphasis> outputs current note state. If current note is in the <quote>release</quote> stage (i.e. if its duration has been extended with <link linkend="xtratim"><citetitle>xtratim</citetitle></link> opcode and if it has only just deactivated), then the <emphasis>kflag</emphasis> output argument is set to 1. Otherwise (in sustain stage of current note), <emphasis>kflag</emphasis> is set to 0. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | This opcode is useful for implementing complex release-oriented envelopes. When used in conjunction with <link linkend="xtratim"><citetitle>xtratim</citetitle></link> it can provide an alternative to the hard-coded behaviour of the "r" opcodes (<link linkend="linsegr"><citetitle>linsegr</citetitle></link>, <link linkend="expsegr"><citetitle>expsegr</citetitle></link> et al), where release time is set to the longest time specified in the active instrument. |
| 43 | |
| 44 | </para> |
| 45 | </refsect1> |
| 46 | |
| 47 | <refsect1> |
| 48 | <title>Examples</title> |
| 49 | <para> |
| 50 | See the examples for <link linkend="xtratim"><citetitle>xtratim</citetitle></link>. |
| 51 | </para> |
| 52 | </refsect1> |
| 53 | |
| 54 | <refsect1> |
| 55 | <title>See also</title> |
| 56 | <para><link linkend="MidiExtender"><citetitle>Event Extenders</citetitle></link></para> |
| 57 | </refsect1> |
| 58 | |
| 59 | <refsect1> |
| 60 | <title>Credits</title> |
| 61 | <para> |
| 62 | <simplelist> |
| 63 | <member>Author: &namegabriel;</member> |
| 64 | <member>Italy</member> |
| 65 | </simplelist> |
| 66 | </para> |
| 67 | |
| 68 | <para>New in Csound version 3.47</para> |
| 69 | </refsect1> |
| 70 | </refentry> |