| 1 | |
| 2 | <refentry id="fareylen"> |
| 3 | <indexterm id="IndexFareylen"><primary>fareylen</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Models and Emulations</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>fareylen</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>fareylen</refname> |
| 11 | <refpurpose> |
| 12 | returns the length of a Farey Sequence. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode can be used in conjunction with <link linkend="GENfarey"><citetitle>GENfarey</citetitle></link>. |
| 20 | It calculates the length of Farey Sequence F<subscript>n</subscript>. Its length is given by: |
| 21 | |F<subscript>n</subscript>| = 1 + SUM over n phi(m) |
| 22 | where phi(m) is Euler's totient function, which gives the number of integers ≤ m that are coprime to m. |
| 23 | </para> |
| 24 | <para> |
| 25 | Some values for the length of F<subscript>n</subscript> given n: |
| 26 | <informaltable> |
| 27 | <tgroup cols="2"> |
| 28 | <thead> |
| 29 | <row> |
| 30 | <entry>n</entry> |
| 31 | <entry>F<subscript>n</subscript></entry> |
| 32 | </row> |
| 33 | </thead> |
| 34 | <tbody> |
| 35 | <row> |
| 36 | <entry>1</entry> |
| 37 | <entry>2</entry> |
| 38 | </row> |
| 39 | <row> |
| 40 | <entry>2</entry> |
| 41 | <entry>3</entry> |
| 42 | </row> |
| 43 | <row> |
| 44 | <entry>3</entry> |
| 45 | <entry>5</entry> |
| 46 | </row> |
| 47 | <row> |
| 48 | <entry>4</entry> |
| 49 | <entry>7</entry> |
| 50 | </row> |
| 51 | <row> |
| 52 | <entry>5</entry> |
| 53 | <entry>11</entry> |
| 54 | </row> |
| 55 | <row> |
| 56 | <entry>6</entry> |
| 57 | <entry>13</entry> |
| 58 | </row> |
| 59 | <row> |
| 60 | <entry>7</entry> |
| 61 | <entry>19</entry> |
| 62 | </row> |
| 63 | <row> |
| 64 | <entry>8</entry> |
| 65 | <entry>23</entry> |
| 66 | </row> |
| 67 | <row> |
| 68 | <entry>9</entry> |
| 69 | <entry>29</entry> |
| 70 | </row> |
| 71 | <row> |
| 72 | <entry>10</entry> |
| 73 | <entry>33</entry> |
| 74 | </row> |
| 75 | <row> |
| 76 | <entry>11</entry> |
| 77 | <entry>43</entry> |
| 78 | </row> |
| 79 | <row> |
| 80 | <entry>12</entry> |
| 81 | <entry>47</entry> |
| 82 | </row> |
| 83 | <row> |
| 84 | <entry>13</entry> |
| 85 | <entry>59</entry> |
| 86 | </row> |
| 87 | <row> |
| 88 | <entry>14</entry> |
| 89 | <entry>65</entry> |
| 90 | </row> |
| 91 | <row> |
| 92 | <entry>15</entry> |
| 93 | <entry>73</entry> |
| 94 | </row> |
| 95 | <row> |
| 96 | <entry>16</entry> |
| 97 | <entry>81</entry> |
| 98 | </row> |
| 99 | <row> |
| 100 | <entry>17</entry> |
| 101 | <entry>97</entry> |
| 102 | </row> |
| 103 | <row> |
| 104 | <entry>18</entry> |
| 105 | <entry>103</entry> |
| 106 | </row> |
| 107 | <row> |
| 108 | <entry>19</entry> |
| 109 | <entry>121</entry> |
| 110 | </row> |
| 111 | <row> |
| 112 | <entry>20</entry> |
| 113 | <entry>129</entry> |
| 114 | </row> |
| 115 | </tbody> |
| 116 | </tgroup> |
| 117 | </informaltable> |
| 118 | </para> |
| 119 | |
| 120 | </refsect1> |
| 121 | |
| 122 | <refsect1> |
| 123 | <title>Syntax</title> |
| 124 | <synopsis>kfl <command>fareylen</command> kfn</synopsis> |
| 125 | </refsect1> |
| 126 | |
| 127 | <refsect1> |
| 128 | <title>Performance</title> |
| 129 | <para> |
| 130 | The length of the identified Farey sequence is returned. |
| 131 | </para> |
| 132 | |
| 133 | <para> |
| 134 | <emphasis>kfn</emphasis> -- Integer identifying the sequence. |
| 135 | </para> |
| 136 | </refsect1> |
| 137 | |
| 138 | <refsect1> |
| 139 | <title>Examples</title> |
| 140 | <para> |
| 141 | Here is an example of the fareylen opcode. It uses the file <ulink url="examples/fareylen.csd"><citetitle>fareylen.csd</citetitle></ulink>. |
| 142 | <example> |
| 143 | <title>Example of the fareylen opcode.</title> |
| 144 | <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> |
| 145 | <xi:include href="examples-xml/fareylen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 146 | </example> |
| 147 | </para> |
| 148 | </refsect1> |
| 149 | |
| 150 | <refsect1> |
| 151 | <title>See Also</title> |
| 152 | <para> |
| 153 | <link linkend="SiggenModels"><citetitle>Models and Emulations</citetitle></link> |
| 154 | </para> |
| 155 | </refsect1> |
| 156 | |
| 157 | <refsect1> |
| 158 | <title>Credits</title> |
| 159 | <para> |
| 160 | <simplelist> |
| 161 | <member>Author: Georg Boenn </member> |
| 162 | <member>University of Glamorgan, UK</member> |
| 163 | </simplelist> |
| 164 | </para> |
| 165 | |
| 166 | <para>New in Csound version 5.13</para> |
| 167 | </refsect1> |
| 168 | </refentry> |