| 1 | |
| 2 | <chapter id="ScoregensTop"> |
| 3 | <title>Score Statements and GEN Routines</title> |
| 4 | |
| 5 | <section id="ScoreStatementsRef"> |
| 6 | <title>Score Statements</title> |
| 7 | <para> |
| 8 | The statements used in scores are: |
| 9 | <itemizedlist> |
| 10 | <listitem><para> |
| 11 | <link linkend="a"><citetitle>a</citetitle></link> - Advance score time by a specified amount |
| 12 | </para></listitem> |
| 13 | <listitem><para> |
| 14 | <link linkend="b"><citetitle>b</citetitle></link> - Resets the clock |
| 15 | </para></listitem> |
| 16 | <listitem><para> |
| 17 | <link linkend="capB"><citetitle>B</citetitle></link> - Adjusts the clock |
| 18 | </para></listitem> |
| 19 | <listitem><para> |
| 20 | <link linkend="C"><citetitle>C</citetitle></link> - Control |
| 21 | automatic carry of p-args |
| 22 | </para></listitem> |
| 23 | <listitem><para> |
| 24 | <link linkend="d"><citetitle>d</citetitle></link> - Deletes |
| 25 | an infinite instrument |
| 26 | </para></listitem> |
| 27 | <listitem><para> |
| 28 | <link linkend="e"><citetitle>e</citetitle></link> - Marks the end of the last section of the score |
| 29 | </para></listitem> |
| 30 | <listitem><para> |
| 31 | <link linkend="f"><citetitle>f</citetitle></link> - Causes a <link linkend="ScoreGenRef"><citetitle>GEN subroutine</citetitle></link> to place values in a stored function table |
| 32 | </para></listitem> |
| 33 | <listitem><para> |
| 34 | <link linkend="i"><citetitle>i</citetitle></link> - Makes an instrument active at a specific time and for a certain duration |
| 35 | </para></listitem> |
| 36 | <listitem><para> |
| 37 | <link linkend="m"><citetitle>m</citetitle></link> - Sets a named mark in the score |
| 38 | </para></listitem> |
| 39 | <listitem><para> |
| 40 | <link linkend="n"><citetitle>n</citetitle></link> - Repeats a marked section |
| 41 | </para></listitem> |
| 42 | <listitem><para> |
| 43 | <link linkend="q"><citetitle>q</citetitle></link> - Used to quiet an instrument |
| 44 | </para></listitem> |
| 45 | <listitem><para> |
| 46 | <link linkend="r"><citetitle>r</citetitle></link> - Starts a repeated section |
| 47 | </para></listitem> |
| 48 | <listitem><para> |
| 49 | <link linkend="s"><citetitle>s</citetitle></link> - Marks the end of a section |
| 50 | </para></listitem> |
| 51 | <listitem><para> |
| 52 | <link linkend="t"><citetitle>t</citetitle></link> - Sets the tempo |
| 53 | </para></listitem> |
| 54 | <listitem><para> |
| 55 | <link linkend="v"><citetitle>v</citetitle></link> - Provides for locally variable time warping of score events |
| 56 | </para></listitem> |
| 57 | <listitem><para> |
| 58 | <link linkend="x"><citetitle>x</citetitle></link> - Skip the rest of the current section |
| 59 | </para></listitem> |
| 60 | <listitem><para> |
| 61 | <link linkend="y"><citetitle>y</citetitle></link> - Set seed |
| 62 | for random numbers, either from p1 or, if omitted, the clock |
| 63 | </para></listitem> |
| 64 | <listitem><para> |
| 65 | <link linkend="leftbrace"><citetitle>{</citetitle></link> - Begins a non-sectional, nestable loop |
| 66 | </para></listitem> |
| 67 | <listitem><para> |
| 68 | <link linkend="rightbrace"><citetitle>}</citetitle></link> - Ends a non-sectional, nestable loop |
| 69 | </para></listitem> |
| 70 | </itemizedlist> |
| 71 | </para> |
| 72 | |
| 73 | </section> |
| 74 | &scoregensa; |
| 75 | &scoregensb; |
| 76 | &scoregensB; |
| 77 | &scoregensC; |
| 78 | &scoregensd; |
| 79 | &scoregense; |
| 80 | &scoregensf; |
| 81 | &scoregensi; |
| 82 | &scoregensm; |
| 83 | &scoregensn; |
| 84 | &scoregensq; |
| 85 | &scoregensr; |
| 86 | &scoregenss; |
| 87 | &scoregenst; |
| 88 | &scoregensv; |
| 89 | &scoregensx; |
| 90 | &scoregensy; |
| 91 | &scoregensleftbrace; |
| 92 | &scoregensrightbrace; |
| 93 | |
| 94 | <section id="ScoreGenRef"> |
| 95 | <title>GEN Routines</title> |
| 96 | <para>GEN routines are used as data generators for function tables. When a function table is created using the <link linkend="f"><citetitle>f score statement</citetitle></link> the GEN function is given as its fourth argument. A negative GEN number implies that the function is not rescaled, and maintains its original values.</para> |
| 97 | |
| 98 | <bridgehead>Sine/Cosine Generators: </bridgehead> |
| 99 | <itemizedlist> |
| 100 | <listitem> |
| 101 | <simpara><link linkend="GEN09"><citetitle>GEN09</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 102 | </listitem> |
| 103 | <listitem> |
| 104 | <simpara><link linkend="GEN10"><citetitle>GEN10</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 105 | </listitem> |
| 106 | <listitem> |
| 107 | <simpara><link linkend="GEN11"><citetitle>GEN11</citetitle></link> - Additive set of cosine partials.</simpara> |
| 108 | </listitem> |
| 109 | <listitem> |
| 110 | <simpara><link linkend="GEN19"><citetitle>GEN19</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 111 | </listitem> |
| 112 | <listitem> |
| 113 | <simpara><link linkend="GEN30"><citetitle>GEN30</citetitle></link> - Generates harmonic partials by analyzing an existing table.</simpara> |
| 114 | </listitem> |
| 115 | <listitem> |
| 116 | <simpara><link linkend="GEN33"><citetitle>GEN33</citetitle></link> - Generate composite waveforms by mixing simple sinusoids.</simpara> |
| 117 | </listitem> |
| 118 | <listitem> |
| 119 | <simpara><link linkend="GEN34"><citetitle>GEN34</citetitle></link> - Generate composite waveforms by mixing simple sinusoids.</simpara> |
| 120 | </listitem> |
| 121 | </itemizedlist> |
| 122 | |
| 123 | <bridgehead> |
| 124 | Line/Exponential Segment Generators: |
| 125 | </bridgehead> |
| 126 | <itemizedlist> |
| 127 | <listitem> |
| 128 | <simpara><link linkend="GEN05"><citetitle>GEN05</citetitle></link> - Constructs functions from segments of exponential curves.</simpara> |
| 129 | </listitem> |
| 130 | <listitem> |
| 131 | <simpara><link linkend="GEN06"><citetitle>GEN06</citetitle></link> - Generates a function comprised of segments of cubic polynomials.</simpara> |
| 132 | </listitem> |
| 133 | <listitem> |
| 134 | <simpara><link linkend="GEN07"><citetitle>GEN07</citetitle></link> - Constructs functions from segments of straight lines.</simpara> |
| 135 | </listitem> |
| 136 | <listitem> |
| 137 | <simpara><link linkend="GEN08"><citetitle>GEN08</citetitle></link> - Generate a piecewise cubic spline curve.</simpara> |
| 138 | </listitem> |
| 139 | <listitem> |
| 140 | <simpara><link linkend="GEN16"><citetitle>GEN16</citetitle></link> - Creates a table from a starting value to an ending value.</simpara> |
| 141 | </listitem> |
| 142 | <listitem> |
| 143 | <simpara><link linkend="GEN25"><citetitle>GEN25</citetitle></link> - Construct functions from segments of exponential curves in breakpoint fashion.</simpara> |
| 144 | </listitem> |
| 145 | <listitem> |
| 146 | <simpara><link linkend="GEN27"><citetitle>GEN27</citetitle></link> - Construct functions from segments of straight lines in breakpoint fashion.</simpara> |
| 147 | </listitem> |
| 148 | </itemizedlist> |
| 149 | |
| 150 | |
| 151 | |
| 152 | <bridgehead> |
| 153 | File Access GEN Routines: |
| 154 | </bridgehead> |
| 155 | <itemizedlist> |
| 156 | <listitem> |
| 157 | <simpara><link linkend="GEN01"><citetitle>GEN01</citetitle></link> - Transfers data from a soundfile into a function table.</simpara> |
| 158 | </listitem> |
| 159 | <listitem> |
| 160 | <simpara><link linkend="GEN23"><citetitle>GEN23</citetitle></link> - Reads numeric values from a text file.</simpara> |
| 161 | </listitem> |
| 162 | <listitem> |
| 163 | <simpara><link linkend="GEN28"><citetitle>GEN28</citetitle></link> - Reads a text file which contains a time-tagged trajectory.</simpara> |
| 164 | </listitem> |
| 165 | <listitem> |
| 166 | <simpara><link linkend="GEN43"><citetitle>GEN43</citetitle></link> - Loads a PVOCEX file containing a PV analysis.</simpara> |
| 167 | </listitem> |
| 168 | <listitem> |
| 169 | <simpara><link linkend="GEN49"><citetitle>GEN49</citetitle></link> |
| 170 | - Transfers data from an MP3 soundfile into a function table.</simpara> |
| 171 | </listitem> |
| 172 | </itemizedlist> |
| 173 | |
| 174 | <bridgehead> |
| 175 | Numeric Value Access GEN Routines |
| 176 | </bridgehead> |
| 177 | <itemizedlist> |
| 178 | <listitem> |
| 179 | <simpara><link linkend="GEN02"><citetitle>GEN02</citetitle></link> - Transfers data from immediate pfields into a function table.</simpara> |
| 180 | </listitem> |
| 181 | <listitem> |
| 182 | <simpara><link linkend="GEN17"><citetitle>GEN17</citetitle></link> - Creates a step function from given x-y pairs.</simpara> |
| 183 | </listitem> |
| 184 | <listitem> |
| 185 | <simpara><link linkend="GEN44"><citetitle>GEN44</citetitle></link> - Creates a stifness matrix for scan/scanu.</simpara> |
| 186 | </listitem> |
| 187 | <listitem> |
| 188 | <simpara><link linkend="GEN52"><citetitle>GEN52</citetitle></link> - Creates an interleaved multichannel table from the specified source tables, in the format expected by the <emphasis>ftconv</emphasis> opcode.</simpara> |
| 189 | </listitem> |
| 190 | </itemizedlist> |
| 191 | |
| 192 | <bridgehead> |
| 193 | Window Function GEN Routines |
| 194 | </bridgehead> |
| 195 | <itemizedlist> |
| 196 | <listitem> |
| 197 | <simpara><link linkend="GEN20"><citetitle>GEN20</citetitle></link> - Generates functions of different windows.</simpara> |
| 198 | </listitem> |
| 199 | </itemizedlist> |
| 200 | |
| 201 | |
| 202 | |
| 203 | <bridgehead> |
| 204 | Random Function GEN Routines |
| 205 | </bridgehead> |
| 206 | <itemizedlist> |
| 207 | <listitem> |
| 208 | <simpara><link linkend="GEN21"><citetitle>GEN21</citetitle></link> - Generates tables of different random distributions.</simpara> |
| 209 | </listitem> |
| 210 | <listitem> |
| 211 | <simpara><link linkend="GEN40"><citetitle>GEN40</citetitle></link> - Generates a random distribution using a distribution histogram.</simpara> |
| 212 | </listitem> |
| 213 | <listitem> |
| 214 | <simpara><link linkend="GEN41"><citetitle>GEN41</citetitle></link> - Generates a random list of numerical pairs.</simpara> |
| 215 | </listitem> |
| 216 | <listitem> |
| 217 | <simpara><link linkend="GEN42"><citetitle>GEN42</citetitle></link> - Generates a random distribution of discrete ranges of values.</simpara> |
| 218 | </listitem> |
| 219 | </itemizedlist> |
| 220 | |
| 221 | <bridgehead> |
| 222 | Waveshaping GEN Routines |
| 223 | </bridgehead> |
| 224 | <itemizedlist> |
| 225 | <listitem> |
| 226 | <simpara><link linkend="GEN03"><citetitle>GEN03</citetitle></link> - Generates a stored function table by evaluating a polynomial.</simpara> |
| 227 | </listitem> |
| 228 | <listitem> |
| 229 | <simpara><link linkend="GEN13"><citetitle>GEN13</citetitle></link> - Stores a polynomial whose coefficients derive from the Chebyshev polynomials of the first kind.</simpara> |
| 230 | </listitem> |
| 231 | <listitem> |
| 232 | <simpara><link linkend="GEN14"><citetitle>GEN14</citetitle></link> - Stores a polynomial whose coefficients derive from Chebyshevs of the second kind.</simpara> |
| 233 | </listitem> |
| 234 | <listitem> |
| 235 | <simpara><link linkend="GEN15"><citetitle>GEN15</citetitle></link> - Creates two tables of stored polynomial functions.</simpara> |
| 236 | </listitem> |
| 237 | </itemizedlist> |
| 238 | |
| 239 | <bridgehead> |
| 240 | Amplitude Scaling GEN Routines |
| 241 | </bridgehead> |
| 242 | <itemizedlist> |
| 243 | <listitem> |
| 244 | <simpara><link linkend="GEN04"><citetitle>GEN04</citetitle></link> - Generates a normalizing function.</simpara> |
| 245 | </listitem> |
| 246 | <listitem> |
| 247 | <simpara><link linkend="GEN12"><citetitle>GEN12</citetitle></link> - Generates the log of a modified Bessel function of the second kind.</simpara> |
| 248 | </listitem> |
| 249 | <listitem> |
| 250 | <simpara><link linkend="GEN24"><citetitle>GEN24</citetitle></link> - Reads numeric values from another allocated function-table and rescales them.</simpara> |
| 251 | </listitem> |
| 252 | </itemizedlist> |
| 253 | |
| 254 | <bridgehead> |
| 255 | Mixing GEN Routines |
| 256 | </bridgehead> |
| 257 | <itemizedlist> |
| 258 | <listitem> |
| 259 | <simpara><link linkend="GEN18"><citetitle>GEN18</citetitle></link> - Writes composite waveforms made up of pre-existing waveforms.</simpara> |
| 260 | </listitem> |
| 261 | <listitem> |
| 262 | <simpara><link linkend="GEN31"><citetitle>GEN31</citetitle></link> - Mixes any waveform specified in an existing table.</simpara> |
| 263 | </listitem> |
| 264 | <listitem> |
| 265 | <simpara><link linkend="GEN32"><citetitle>GEN32</citetitle></link> - Mixes any waveform, resampled with either FFT or linear interpolation.</simpara> |
| 266 | </listitem> |
| 267 | </itemizedlist> |
| 268 | |
| 269 | <bridgehead> |
| 270 | Pitch and Tuning GEN Routines |
| 271 | </bridgehead> |
| 272 | <itemizedlist> |
| 273 | <listitem> |
| 274 | <simpara><link linkend="GEN51"><citetitle>GEN51</citetitle></link> - fills a table with a fully customized micro-tuning scale, in the manner of Csound opcodes <emphasis>cpstun</emphasis>, <emphasis>cpstuni</emphasis> and <emphasis>cpstmid</emphasis>.</simpara> |
| 275 | </listitem> |
| 276 | </itemizedlist> |
| 277 | <bridgehead> |
| 278 | Named GEN Routines |
| 279 | </bridgehead> |
| 280 | <para>Csound's GEN routines can be extended with GEN function |
| 281 | plugins. There is currently a simple GEN plugin that provides |
| 282 | exponential and hyperbolic tangent functions, and the sone |
| 283 | function. There is also a generator called farey for the Farey |
| 284 | sequence operations, and a Bézier curve generator. These GEN |
| 285 | functions are not called by number, but by name.</para> |
| 286 | <itemizedlist> |
| 287 | <listitem> |
| 288 | <simpara><link linkend="GENtanh"><citetitle>"tanh"</citetitle></link> - fills a table from a hyperbolic tangent formula.</simpara> |
| 289 | </listitem> |
| 290 | <listitem> |
| 291 | <simpara><link linkend="GENexp"><citetitle>"exp"</citetitle></link> - fills a table from an exponential formula.</simpara> |
| 292 | </listitem> |
| 293 | <listitem> |
| 294 | <simpara><link linkend="GENsone"><citetitle>"sone"</citetitle></link> - fills a table from a sone function formula.</simpara> |
| 295 | </listitem> |
| 296 | <listitem> |
| 297 | <simpara><link |
| 298 | linkend="GENfarey"><citetitle>"farey"</citetitle></link> |
| 299 | - fills a table from a Farey sequence.</simpara> |
| 300 | </listitem> |
| 301 | <listitem> |
| 302 | <simpara> |
| 303 | <link linkend="GENquadbezier"><citetitle>"quadbezier"</citetitle></link> |
| 304 | - fills a table with a quadratic Bézier curve.</simpara> |
| 305 | </listitem> |
| 306 | <listitem> |
| 307 | <simpara><link linkend="GENwave"><citetitle>"wave"</citetitle></link> |
| 308 | - fills a table from a wavelet transform.</simpara> |
| 309 | </listitem> |
| 310 | <listitem> |
| 311 | <simpara><link linkend="GENpadsynth"><citetitle>"padsynth"</citetitle></link> |
| 312 | - fills a table using the padsynth algorithm.</simpara> |
| 313 | </listitem> |
| 314 | </itemizedlist> |
| 315 | </section> |
| 316 | &scoregensgen01; |
| 317 | &scoregensgen02; |
| 318 | &scoregensgen03; |
| 319 | &scoregensgen04; |
| 320 | &scoregensgen05; |
| 321 | &scoregensgen06; |
| 322 | &scoregensgen07; |
| 323 | &scoregensgen08; |
| 324 | &scoregensgen09; |
| 325 | &scoregensgen10; |
| 326 | &scoregensgen11; |
| 327 | &scoregensgen12; |
| 328 | &scoregensgen13; |
| 329 | &scoregensgen14; |
| 330 | &scoregensgen15; |
| 331 | &scoregensgen16; |
| 332 | &scoregensgen17; |
| 333 | &scoregensgen18; |
| 334 | &scoregensgen19; |
| 335 | &scoregensgen20; |
| 336 | &scoregensgen21; |
| 337 | &scoregensgen23; |
| 338 | &scoregensgen24; |
| 339 | &scoregensgen25; |
| 340 | &scoregensgen27; |
| 341 | &scoregensgen28; |
| 342 | &scoregensgen30; |
| 343 | &scoregensgen31; |
| 344 | &scoregensgen32; |
| 345 | &scoregensgen33; |
| 346 | &scoregensgen34; |
| 347 | &scoregensgen40; |
| 348 | &scoregensgen41; |
| 349 | &scoregensgen42; |
| 350 | &scoregensgen43; |
| 351 | &scoregensgen44; |
| 352 | &scoregensgen49; |
| 353 | &scoregensgen51; |
| 354 | &scoregensgen52; |
| 355 | &scoregensgen53; |
| 356 | &scoregenstanh; |
| 357 | &scoregensexp; |
| 358 | &scoregenssone; |
| 359 | &scoregensquadbezier; |
| 360 | &scoregensfarey; |
| 361 | &scoregenswave; |
| 362 | &scoregenspadsynth; |
| 363 | </chapter> |