| 1 | |
| 2 | <refentry id="gain"> |
| 3 | <indexterm id="IndexGain"><primary>gain</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Amplitude Modifiers</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>gain</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>gain</refname> |
| 11 | <refpurpose> |
| 12 | Adjusts the amplitude audio signal according to a root-mean-square value. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Adjusts the amplitude audio signal according to a root-mean-square value. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ares <command>gain</command> asig, krms [, ihp] [, iskip]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <emphasis>ihp</emphasis> (optional, default=10) -- half-power point (in Hz) of a special internal low-pass filter. The default value is 10. |
| 32 | </para> |
| 33 | |
| 34 | <para> |
| 35 | <emphasis>iskip</emphasis> (optional, default=0) -- initial disposition of internal data space (see <link linkend="reson"><citetitle>reson</citetitle></link>). The default value is 0. |
| 36 | </para> |
| 37 | </refsect1> |
| 38 | |
| 39 | <refsect1> |
| 40 | <title>Performance</title> |
| 41 | <para> |
| 42 | <emphasis>asig</emphasis> -- input audio signal |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <emphasis>gain</emphasis> provides an amplitude modification of <emphasis>asig</emphasis> so that the output <emphasis>ares</emphasis> has rms power equal to <emphasis>krms</emphasis>. <link linkend="rms"><citetitle>rms</citetitle></link> and <emphasis>gain</emphasis> used together (and given matching <emphasis>ihp</emphasis> values) will provide the same effect as <link linkend="balance"><citetitle>balance</citetitle></link>. |
| 47 | </para> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Examples</title> |
| 52 | <para> |
| 53 | Here is an example of the gain opcode. It uses the file <ulink url="examples/gain.csd"><citetitle>gain.csd</citetitle></ulink>. |
| 54 | |
| 55 | <example> |
| 56 | <title>Example of the gain opcode.</title> |
| 57 | <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> |
| 58 | <xi:include href="examples-xml/gain.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 59 | </example> |
| 60 | </para> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>See also</title> |
| 65 | <para><link linkend="SigProcAmpMod"><citetitle>Amplitude Modifiers and Dynamic processing</citetitle></link></para> |
| 66 | </refsect1> |
| 67 | |
| 68 | <refsect1> |
| 69 | <title>See Also</title> |
| 70 | <para> |
| 71 | <link linkend="balance"><citetitle>balance</citetitle></link>, |
| 72 | <link linkend="rms"><citetitle>rms</citetitle></link> |
| 73 | </para> |
| 74 | </refsect1> |
| 75 | </refentry> |