| 1 | |
| 2 | <refentry id="rms"> |
| 3 | <indexterm id="IndexRms"><primary>rms</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>rms</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>rms</refname> |
| 11 | <refpurpose> |
| 12 | Determines the root-mean-square amplitude of an audio signal. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Determines the root-mean-square amplitude of an audio signal. It low-pass filters the actual value, to average in the manner of a VU meter. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>kres <command>rms</command> asig [, 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 | <para> |
| 45 | <emphasis>kres</emphasis> -- low-pass filtered rms value of the input signal |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>rms</emphasis> output values <emphasis>kres</emphasis> will trace the root-mean-square value of the audio input <emphasis>asig</emphasis>. This unit is not a signal modifier, but functions rather as a signal power-gauge. It uses an internal low-pass filter to make the response smoother. <emphasis>ihp</emphasis> can be used to control this smoothing. The higher the value, the "snappier" the measurement. |
| 50 | </para> |
| 51 | <para> |
| 52 | This opcode can also be used as an evelope follower. |
| 53 | </para> |
| 54 | <para> |
| 55 | The <emphasis>kres</emphasis> output from this opcode is given in amplitude and depends on <link linkend="Zerodbfs"><citetitle>0dbfs</citetitle></link>. If you want the output in decibels, you can use <link linkend="dbamp"><citetitle>dbamp</citetitle></link> |
| 56 | </para> |
| 57 | </refsect1> |
| 58 | |
| 59 | <refsect1> |
| 60 | <title>Examples</title> |
| 61 | <para> |
| 62 | Here is an example of the rms opcode. It uses the file <ulink url="examples/rms.csd"><citetitle>rms.csd</citetitle></ulink>. |
| 63 | |
| 64 | <example> |
| 65 | <title>Example of the rms opcode.</title> |
| 66 | <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> |
| 67 | <xi:include href="examples-xml/rms.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 68 | </example> |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <para> |
| 74 | Here is another example of the rms opcode. It uses the file <ulink url="examples/rms-FLTK.csd"><citetitle>rms-FLTK.csd</citetitle></ulink>. |
| 75 | <example> |
| 76 | <title>Advanced example of the rms opcode.</title> |
| 77 | <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> |
| 78 | <xi:include href="examples-xml/rms-FLTK.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 79 | </example> |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>See also</title> |
| 85 | <para><link linkend="ControlSensing"><citetitle>Sensing and Control: Envelope followers</citetitle></link></para> |
| 86 | </refsect1> |
| 87 | |
| 88 | </refentry> |