| 1 | |
| 2 | <refentry id="transegr"> |
| 3 | <indexterm id="IndexTransegr"><primary>transegr</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Linear and Exponential Generators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>transegr</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>transegr</refname> |
| 11 | <refpurpose> |
| 12 | Constructs a user-definable envelope with extended release segment. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Constructs a user-definable envelope. It is the same |
| 20 | as <link linkend="transeg"><citetitle>transeg</citetitle></link>, |
| 21 | with an extended release segment. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>transegr</command> ia, idur, itype, ib [, idur2] [, itype] [, ic] ...</synopsis> |
| 28 | <synopsis>kres <command>transegr</command> ia, idur, itype, ib [, idur2] [, itype] [, ic] ...</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para> |
| 34 | <emphasis>ia</emphasis> -- starting value. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>ib, ic,</emphasis> etc. -- value after <emphasis>idur</emphasis> seconds. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>idur</emphasis> -- duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped. |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <emphasis>idur2,... idurx</emphasis> etc. -- duration in seconds of segment |
| 47 | </para> |
| 48 | |
| 49 | <para> |
| 50 | <emphasis>itype, itype2,</emphasis> etc. -- if 0, a straight line is produced. If non-zero, then <emphasis>transegr</emphasis> creates the following curve, for <emphasis>n</emphasis> steps: |
| 51 | |
| 52 | <literallayout> |
| 53 | ibeg + (ivalue - ibeg) * (1 - exp( i*itype/(n-1) )) / (1 - exp(itype)) |
| 54 | </literallayout> |
| 55 | </para> |
| 56 | </refsect1> |
| 57 | |
| 58 | <refsect1> |
| 59 | <title>Performance</title> |
| 60 | <para> |
| 61 | If <emphasis>itype</emphasis> > 0, there is a slowly rising (concave) or slowly decaying |
| 62 | (convex) curve, while if <emphasis>itype</emphasis> < 0, the curve is fast rising (convex) or |
| 63 | fast decaying (concave). See also <link linkend="GEN16"><citetitle>GEN16</citetitle></link>. |
| 64 | </para> |
| 65 | <para> |
| 66 | This opcode is the same as |
| 67 | of <link linkend="transeg"><citetitle>transeg</citetitle></link> |
| 68 | with an additional release segment triggered by a MIDI noteoff |
| 69 | event, a negative p1 <link linkend="i"><citetitle>note event</citetitle></link> in the score or |
| 70 | a <link linkend="turnoff2"><citetitle>turnoff2</citetitle></link> |
| 71 | opcode. |
| 72 | </para> |
| 73 | </refsect1> |
| 74 | |
| 75 | <refsect1> |
| 76 | <title>Examples</title> |
| 77 | <para> |
| 78 | Here is an example of the transegr opcode. It uses the file <ulink url="examples/transegr.csd"><citetitle>transegr.csd</citetitle></ulink>. |
| 79 | <example> |
| 80 | <title>Example of the transegr opcode.</title> |
| 81 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 82 | <xi:include href="examples-xml/transegr.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 83 | </example> |
| 84 | </para> |
| 85 | </refsect1> |
| 86 | |
| 87 | <refsect1> |
| 88 | <title>See also</title> |
| 89 | <para><link linkend="SiggenLineexp"><citetitle>Linear and Exponential Generators</citetitle></link></para> |
| 90 | </refsect1> |
| 91 | |
| 92 | <refsect1> |
| 93 | <title>Credits</title> |
| 94 | <para> |
| 95 | <simplelist> |
| 96 | <member>Author: &namejohn;</member> |
| 97 | <member>january 2010</member> |
| 98 | </simplelist> |
| 99 | </para> |
| 100 | |
| 101 | <para>New in Csound version 5.12</para> |
| 102 | </refsect1> |
| 103 | </refentry> |