| 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="e"><citetitle>e</citetitle></link> - Marks the end of the last section of the score |
| 18 |
</para></listitem> |
| 19 |
<listitem><para> |
| 20 |
<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 |
| 21 |
</para></listitem> |
| 22 |
<listitem><para> |
| 23 |
<link linkend="i"><citetitle>i</citetitle></link> - Makes an instrument active at a specific time and for a certain duration |
| 24 |
</para></listitem> |
| 25 |
<listitem><para> |
| 26 |
<link linkend="m"><citetitle>m</citetitle></link> - Sets a named mark in the score |
| 27 |
</para></listitem> |
| 28 |
<listitem><para> |
| 29 |
<link linkend="n"><citetitle>n</citetitle></link> - Repeats a marked section |
| 30 |
</para></listitem> |
| 31 |
<listitem><para> |
| 32 |
<link linkend="q"><citetitle>q</citetitle></link> - Used to quiet an instrument |
| 33 |
</para></listitem> |
| 34 |
<listitem><para> |
| 35 |
<link linkend="r"><citetitle>r</citetitle></link> - Starts a repeated section |
| 36 |
</para></listitem> |
| 37 |
<listitem><para> |
| 38 |
<link linkend="s"><citetitle>s</citetitle></link> - Marks the end of a section |
| 39 |
</para></listitem> |
| 40 |
<listitem><para> |
| 41 |
<link linkend="t"><citetitle>t</citetitle></link> - Sets the tempo |
| 42 |
</para></listitem> |
| 43 |
<listitem><para> |
| 44 |
<link linkend="v"><citetitle>v</citetitle></link> - Provides for locally variable time warping of score events |
| 45 |
</para></listitem> |
| 46 |
<listitem><para> |
| 47 |
<link linkend="x"><citetitle>x</citetitle></link> - Skip the rest of the current section |
| 48 |
</para></listitem> |
| 49 |
<listitem><para> |
| 50 |
<link linkend="leftbrace"><citetitle>{</citetitle></link> - Begins a non-sectional, nestable loop |
| 51 |
</para></listitem> |
| 52 |
<listitem><para> |
| 53 |
<link linkend="rightbrace"><citetitle>}</citetitle></link> - Ends a non-sectional, nestable loop |
| 54 |
</para></listitem> |
| 55 |
</itemizedlist> |
| 56 |
</para> |
| 57 |
|
| 58 |
</section> |
| 59 |
&scoregensa; |
| 60 |
&scoregensb; |
| 61 |
&scoregense; |
| 62 |
&scoregensf; |
| 63 |
&scoregensi; |
| 64 |
&scoregensm; |
| 65 |
&scoregensn; |
| 66 |
&scoregensq; |
| 67 |
&scoregensr; |
| 68 |
&scoregenss; |
| 69 |
&scoregenst; |
| 70 |
&scoregensv; |
| 71 |
&scoregensx; |
| 72 |
&scoregensleftbrace; |
| 73 |
&scoregensrightbrace; |
| 74 |
|
| 75 |
<section id="ScoreGenRef"> |
| 76 |
<title>GEN Routines</title> |
| 77 |
<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> |
| 78 |
|
| 79 |
<bridgehead>Sine/Cosine Generators: </bridgehead> |
| 80 |
<itemizedlist> |
| 81 |
<listitem> |
| 82 |
<simpara><link linkend="GEN09"><citetitle>GEN09</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 83 |
</listitem> |
| 84 |
<listitem> |
| 85 |
<simpara><link linkend="GEN10"><citetitle>GEN10</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 86 |
</listitem> |
| 87 |
<listitem> |
| 88 |
<simpara><link linkend="GEN11"><citetitle>GEN11</citetitle></link> - Additive set of cosine partials.</simpara> |
| 89 |
</listitem> |
| 90 |
<listitem> |
| 91 |
<simpara><link linkend="GEN19"><citetitle>GEN19</citetitle></link> - Composite waveforms made up of weighted sums of simple sinusoids.</simpara> |
| 92 |
</listitem> |
| 93 |
<listitem> |
| 94 |
<simpara><link linkend="GEN30"><citetitle>GEN30</citetitle></link> - Generates harmonic partials by analyzing an existing table.</simpara> |
| 95 |
</listitem> |
| 96 |
<listitem> |
| 97 |
<simpara><link linkend="GEN33"><citetitle>GEN33</citetitle></link> - Generate composite waveforms by mixing simple sinusoids.</simpara> |
| 98 |
</listitem> |
| 99 |
<listitem> |
| 100 |
<simpara><link linkend="GEN34"><citetitle>GEN34</citetitle></link> - Generate composite waveforms by mixing simple sinusoids.</simpara> |
| 101 |
</listitem> |
| 102 |
</itemizedlist> |
| 103 |
|
| 104 |
<bridgehead> |
| 105 |
Line/Exponential Segment Generators: |
| 106 |
</bridgehead> |
| 107 |
<itemizedlist> |
| 108 |
<listitem> |
| 109 |
<simpara><link linkend="GEN05"><citetitle>GEN05</citetitle></link> - Constructs functions from segments of exponential curves.</simpara> |
| 110 |
</listitem> |
| 111 |
<listitem> |
| 112 |
<simpara><link linkend="GEN06"><citetitle>GEN06</citetitle></link> - Generates a function comprised of segments of cubic polynomials.</simpara> |
| 113 |
</listitem> |
| 114 |
<listitem> |
| 115 |
<simpara><link linkend="GEN07"><citetitle>GEN07</citetitle></link> - Constructs functions from segments of straight lines.</simpara> |
| 116 |
</listitem> |
| 117 |
<listitem> |
| 118 |
<simpara><link linkend="GEN08"><citetitle>GEN08</citetitle></link> - Generate a piecewise cubic spline curve.</simpara> |
| 119 |
</listitem> |
| 120 |
<listitem> |
| 121 |
<simpara><link linkend="GEN16"><citetitle>GEN16</citetitle></link> - Creates a table from a starting value to an ending value.</simpara> |
| 122 |
</listitem> |
| 123 |
<listitem> |
| 124 |
<simpara><link linkend="GEN25"><citetitle>GEN25</citetitle></link> - Construct functions from segments of exponential curves in breakpoint fashion.</simpara> |
| 125 |
</listitem> |
| 126 |
<listitem> |
| 127 |
<simpara><link linkend="GEN27"><citetitle>GEN27</citetitle></link> - Construct functions from segments of straight lines in breakpoint fashion.</simpara> |
| 128 |
</listitem> |
| 129 |
</itemizedlist> |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
<bridgehead> |
| 134 |
File Access GEN Routines: |
| 135 |
</bridgehead> |
| 136 |
<itemizedlist> |
| 137 |
<listitem> |
| 138 |
<simpara><link linkend="GEN01"><citetitle>GEN01</citetitle></link> - Transfers data from a soundfile into a function table.</simpara> |
| 139 |
</listitem> |
| 140 |
<listitem> |
| 141 |
<simpara><link linkend="GEN23"><citetitle>GEN23</citetitle></link> - Reads numeric values from a text file.</simpara> |
| 142 |
</listitem> |
| 143 |
<listitem> |
| 144 |
<simpara><link linkend="GEN28"><citetitle>GEN28</citetitle></link> - Reads a text file which contains a time-tagged trajectory.</simpara> |
| 145 |
</listitem> |
| 146 |
</itemizedlist> |
| 147 |
|
| 148 |
<bridgehead> |
| 149 |
Numeric Value Access GEN Routines |
| 150 |
</bridgehead> |
| 151 |
<itemizedlist> |
| 152 |
<listitem> |
| 153 |
<simpara><link linkend="GEN02"><citetitle>GEN02</citetitle></link> - Transfers data from immediate pfields into a function table.</simpara> |
| 154 |
</listitem> |
| 155 |
<listitem> |
| 156 |
<simpara><link linkend="GEN17"><citetitle>GEN17</citetitle></link> - Creates a step function from given x-y pairs.</simpara> |
| 157 |
</listitem> |
| 158 |
<listitem> |
| 159 |
<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> |
| 160 |
</listitem> |
| 161 |
</itemizedlist> |
| 162 |
|
| 163 |
<bridgehead> |
| 164 |
Window Function GEN Routines |
| 165 |
</bridgehead> |
| 166 |
<itemizedlist> |
| 167 |
<listitem> |
| 168 |
<simpara><link linkend="GEN20"><citetitle>GEN20</citetitle></link> - Generates functions of different windows.</simpara> |
| 169 |
</listitem> |
| 170 |
</itemizedlist> |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
<bridgehead> |
| 175 |
Random Function GEN Routines |
| 176 |
</bridgehead> |
| 177 |
<itemizedlist> |
| 178 |
<listitem> |
| 179 |
<simpara><link linkend="GEN21"><citetitle>GEN21</citetitle></link> - Generates tables of different random distributions.</simpara> |
| 180 |
</listitem> |
| 181 |
<listitem> |
| 182 |
<simpara><link linkend="GEN40"><citetitle>GEN40</citetitle></link> - Generates a random distribution using a distribution histogram.</simpara> |
| 183 |
</listitem> |
| 184 |
<listitem> |
| 185 |
<simpara><link linkend="GEN41"><citetitle>GEN41</citetitle></link> - Generates a random list of numerical pairs.</simpara> |
| 186 |
</listitem> |
| 187 |
<listitem> |
| 188 |
<simpara><link linkend="GEN42"><citetitle>GEN42</citetitle></link> - Generates a random distribution of discrete ranges of values.</simpara> |
| 189 |
</listitem> |
| 190 |
<listitem> |
| 191 |
<simpara><link linkend="GEN43"><citetitle>GEN43</citetitle></link> - Loads a PVOCEX file containing a PV analysis.</simpara> |
| 192 |
</listitem> |
| 193 |
</itemizedlist> |
| 194 |
|
| 195 |
<bridgehead> |
| 196 |
Waveshaping GEN Routines |
| 197 |
</bridgehead> |
| 198 |
<itemizedlist> |
| 199 |
<listitem> |
| 200 |
<simpara><link linkend="GEN03"><citetitle>GEN03</citetitle></link> - Generates a stored function table by evaluating a polynomial.</simpara> |
| 201 |
</listitem> |
| 202 |
<listitem> |
| 203 |
<simpara><link linkend="GEN13"><citetitle>GEN13</citetitle></link> - Stores a polynomial whose coefficients derive from the Chebyshev polynomials of the first kind.</simpara> |
| 204 |
</listitem> |
| 205 |
<listitem> |
| 206 |
<simpara><link linkend="GEN14"><citetitle>GEN14</citetitle></link> - Stores a polynomial whose coefficients derive from Chebyshevs of the second kind.</simpara> |
| 207 |
</listitem> |
| 208 |
<listitem> |
| 209 |
<simpara><link linkend="GEN15"><citetitle>GEN15</citetitle></link> - Creates two tables of stored polynomial functions.</simpara> |
| 210 |
</listitem> |
| 211 |
</itemizedlist> |
| 212 |
|
| 213 |
<bridgehead> |
| 214 |
Amplitude Scaling GEN Routines |
| 215 |
</bridgehead> |
| 216 |
<itemizedlist> |
| 217 |
<listitem> |
| 218 |
<simpara><link linkend="GEN04"><citetitle>GEN04</citetitle></link> - Generates a normalizing function.</simpara> |
| 219 |
</listitem> |
| 220 |
<listitem> |
| 221 |
<simpara><link linkend="GEN12"><citetitle>GEN12</citetitle></link> - Generates the log of a modified Bessel function of the second kind.</simpara> |
| 222 |
</listitem> |
| 223 |
<listitem> |
| 224 |
<simpara><link linkend="GEN24"><citetitle>GEN24</citetitle></link> - Reads numeric values from another allocated function-table and rescales them.</simpara> |
| 225 |
</listitem> |
| 226 |
</itemizedlist> |
| 227 |
|
| 228 |
<bridgehead> |
| 229 |
Mixing GEN Routines |
| 230 |
</bridgehead> |
| 231 |
<itemizedlist> |
| 232 |
<listitem> |
| 233 |
<simpara><link linkend="GEN18"><citetitle>GEN18</citetitle></link> - Writes composite waveforms made up of pre-existing waveforms.</simpara> |
| 234 |
</listitem> |
| 235 |
<listitem> |
| 236 |
<simpara><link linkend="GEN31"><citetitle>GEN31</citetitle></link> - Mixes any waveform specified in an existing table.</simpara> |
| 237 |
</listitem> |
| 238 |
<listitem> |
| 239 |
<simpara><link linkend="GEN32"><citetitle>GEN32</citetitle></link> - Mixes any waveform, resampled with either FFT or linear interpolation.</simpara> |
| 240 |
</listitem> |
| 241 |
</itemizedlist> |
| 242 |
|
| 243 |
<bridgehead> |
| 244 |
Pitch and Tuning GEN Routines |
| 245 |
</bridgehead> |
| 246 |
<itemizedlist> |
| 247 |
<listitem> |
| 248 |
<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> |
| 249 |
</listitem> |
| 250 |
</itemizedlist> |
| 251 |
|
| 252 |
<bridgehead> |
| 253 |
Named GEN Routines |
| 254 |
</bridgehead> |
| 255 |
<para>Csound's GEN routines can be extended with GEN function plugins. There is currently a simple GEN plugin that provides exponential and hyperbolic tangent functions. These GEN functions are not called by number, but by name.</para> |
| 256 |
<itemizedlist> |
| 257 |
<listitem> |
| 258 |
<simpara>"tanh" - fills a table from a hyperbolic tangent formula.</simpara> |
| 259 |
</listitem> |
| 260 |
<listitem> |
| 261 |
<simpara>"exp" - fills a table from a hyperbolic tangent formula.</simpara> |
| 262 |
</listitem> |
| 263 |
</itemizedlist> |
| 264 |
</section> |
| 265 |
&scoregensgen01; |
| 266 |
&scoregensgen02; |
| 267 |
&scoregensgen03; |
| 268 |
&scoregensgen04; |
| 269 |
&scoregensgen05; |
| 270 |
&scoregensgen06; |
| 271 |
&scoregensgen07; |
| 272 |
&scoregensgen08; |
| 273 |
&scoregensgen09; |
| 274 |
&scoregensgen10; |
| 275 |
&scoregensgen11; |
| 276 |
&scoregensgen12; |
| 277 |
&scoregensgen13; |
| 278 |
&scoregensgen14; |
| 279 |
&scoregensgen15; |
| 280 |
&scoregensgen16; |
| 281 |
&scoregensgen17; |
| 282 |
&scoregensgen18; |
| 283 |
&scoregensgen19; |
| 284 |
&scoregensgen20; |
| 285 |
&scoregensgen21; |
| 286 |
|
| 287 |
&scoregensgen23; |
| 288 |
&scoregensgen24; |
| 289 |
&scoregensgen25; |
| 290 |
&scoregensgen27; |
| 291 |
&scoregensgen28; |
| 292 |
&scoregensgen30; |
| 293 |
&scoregensgen31; |
| 294 |
&scoregensgen32; |
| 295 |
&scoregensgen33; |
| 296 |
&scoregensgen34; |
| 297 |
&scoregensgen40; |
| 298 |
&scoregensgen41; |
| 299 |
&scoregensgen42; |
| 300 |
&scoregensgen43; |
| 301 |
&scoregensgen51; |
| 302 |
&scoregensgen52; |
| 303 |
|
| 304 |
</chapter> |