| 1 | |
| 2 | <refentry id="octave"> |
| 3 | <indexterm id="IndexOctave"><primary>octave</primary></indexterm> |
| 4 | <refentryinfo><title>Pitch Converters:Functions</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>octave</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>octave</refname> |
| 13 | <refpurpose> |
| 14 | Calculates a factor to raise/lower a frequency by a given amount of octaves. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Calculates a factor to raise/lower a frequency by a given amount of octaves. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>octave</command>(x)</synopsis> |
| 28 | |
| 29 | <para> |
| 30 | This function works at a-rate, i-rate, and k-rate. |
| 31 | </para> |
| 32 | </refsect1> |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Initialization</title> |
| 36 | <para> |
| 37 | <emphasis>x</emphasis> -- a value expressed in octaves. |
| 38 | </para> |
| 39 | </refsect1> |
| 40 | |
| 41 | <refsect1> |
| 42 | <title>Performance</title> |
| 43 | <para> |
| 44 | The value returned by the <emphasis>octave</emphasis> function is a factor. You can multiply a frequency by this factor to raise/lower it by the given amount of octaves. |
| 45 | </para> |
| 46 | </refsect1> |
| 47 | |
| 48 | <refsect1> |
| 49 | <title>Examples</title> |
| 50 | <para> |
| 51 | Here is an example of the octave opcode. It uses the file <ulink url="examples/octave.csd"><citetitle>octave.csd</citetitle></ulink>. |
| 52 | <example> |
| 53 | <title>Example of the octave opcode.</title> |
| 54 | <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> |
| 55 | <xi:include href="examples-xml/octave.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 56 | </example> |
| 57 | |
| 58 | Its output should include lines like: |
| 59 | <screen> |
| 60 | i1 3520.00000 |
| 61 | i1 1760.00000 |
| 62 | i1 880.00000 |
| 63 | i1 440.00000 |
| 64 | i1 7040.00000 |
| 65 | i1 3520.00000 |
| 66 | i1 1760.00000 |
| 67 | i1 880.00000 |
| 68 | i1 440.00000 |
| 69 | .......</screen> |
| 70 | </para> |
| 71 | </refsect1> |
| 72 | |
| 73 | <refsect1> |
| 74 | <title>See also</title> |
| 75 | <para><link linkend="PitchFuncs"><citetitle>Pitch Converters: Functions</citetitle></link></para> |
| 76 | </refsect1> |
| 77 | |
| 78 | <refsect1> |
| 79 | <title>Credits</title> |
| 80 | <para>New in version 4.16</para> |
| 81 | </refsect1> |
| 82 | </refentry> |