| 1 | <refentry id="sterrain"> |
| 2 | <indexterm id="IndexSterrain"><primary>sterrain</primary></indexterm> |
| 3 | <refentryinfo><title>Signal Generators:Wave Terrain Synthesis</title></refentryinfo> |
| 4 | <refmeta> |
| 5 | <refentrytitle>sterrain</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>sterrain</refname> |
| 10 | <refpurpose> |
| 11 | A wave-terrain synthesis opcode using curves computed with the superformula |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | A wave-terrain synthesis opcode using curves computed with the superformula (see <ulink url="https://en.wikipedia.org/wiki/Superformula"><citetitle>Wikipedia</citetitle></ulink> for more information). |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis>aout <command>sterrain</command> kamp, kcps, kx, ky, krx, kry, krot, ktab0, ktab1, km1, km2, kn1, kn2, kn3, ka, kb, kperiod |
| 25 | </synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | <emphasis>ktabx, ktaby</emphasis> -- The two tables that define the terrain - they can be changed at krate. |
| 32 | </para> |
| 33 | <para> |
| 34 | The output is the result of drawing the superformula curve with |
| 35 | parameters <emphasis>km1, km2, kn1, kn2, kn3, ka, kb</emphasis> |
| 36 | (see on wikipedia), scaled with <emphasis>krx</emphasis> and |
| 37 | <emphasis>kry</emphasis> and centered at |
| 38 | <emphasis>kx</emphasis>, <emphasis>ky</emphasis> on the terrain, |
| 39 | rotated around the center with <emphasis>krot</emphasis> |
| 40 | radians, and traversing it at frequency |
| 41 | <emphasis>kcps/kperiod</emphasis>.<emphasis>km1,km2</emphasis> |
| 42 | are converted to integers. |
| 43 | </para> |
| 44 | <para> |
| 45 | As the speed of the point can change considerably for some |
| 46 | parameter classes when drawing curve on the terrain some |
| 47 | different sounds can be produced compared with other standard |
| 48 | curves e.g. it can make triangle like parts in the output wave. |
| 49 | </para> |
| 50 | <para> |
| 51 | The following ranges are supported and useful: |
| 52 | </para> |
| 53 | <para> |
| 54 | <emphasis>kn1, ka, kb</emphasis> -- !=0 and continous. |
| 55 | </para> |
| 56 | <para> |
| 57 | <emphasis>kn2, kn3</emphasis> -- continous. |
| 58 | </para> |
| 59 | <para> |
| 60 | <emphasis>km1, km2</emphasis> -- positive integer > 0: note that the curves are not on all combinations of km1,km2 closed |
| 61 | and have poles (closed in infinity) for example if kn1>0 and there exists an n,m in Z with 2*km1/km2 = 2m+1/n |
| 62 | i.e curves with (3,2) (5,2) (7,2) etc and (5,4) (6,4) (7,4) (9,4) etc. have a pole which is noticeable when listening. |
| 63 | If kn1 < 0 then the curve is reversed and the poles go towards zero in this case. |
| 64 | If km1 and km2 are zero silence is produced (a plain circ - same effect occurs with the tuple 2,2,2,2,2,1,1). |
| 65 | </para> |
| 66 | <para> |
| 67 | <emphasis>kperiod</emphasis> -- some km1 and km2 ratios may cause pitch shifts. With the kperiod parameter this can be fixed. If the ratio is 1 then the kperiod value should also be set to km1 to get the incoming pitch out. |
| 68 | </para> |
| 69 | |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Examples</title> |
| 74 | <para> |
| 75 | Here is an example of the sterrain opcode wich shows the impact of letting kn1 running towards zero. It uses the file <ulink url="examples/sterrain.csd"><citetitle>sterrain.csd</citetitle></ulink>. |
| 76 | |
| 77 | <example> |
| 78 | <title>Example of the sterrain opcode.</title> |
| 79 | |
| 80 | <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> |
| 81 | <xi:include href="examples-xml/sterrain.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 82 | </example> |
| 83 | </para> |
| 84 | <para> |
| 85 | Here is an other example of the sterrain opcode showing overtone building. |
| 86 | It uses the file <ulink url="examples/sterrain2.csd"><citetitle>sterrain2.csd</citetitle></ulink>. |
| 87 | |
| 88 | <example> |
| 89 | <title>Another Example of the sterrain opcode showing overtone building</title> |
| 90 | |
| 91 | <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> |
| 92 | <xi:include href="examples-xml/sterrain2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 93 | </example> |
| 94 | </para> |
| 95 | </refsect1> |
| 96 | |
| 97 | <refsect1> |
| 98 | <title>See Also</title> |
| 99 | <para><link linkend="SiggenWaveterr"><citetitle>Wave Terrain Synthesis</citetitle></link></para> |
| 100 | </refsect1> |
| 101 | |
| 102 | <refsect1> |
| 103 | <title>Credits</title> |
| 104 | <para> |
| 105 | <simplelist> |
| 106 | <member>Author: Christian Bacher</member> |
| 107 | <member>New in version 6.15</member> |
| 108 | </simplelist> |
| 109 | </para> |
| 110 | </refsect1> |
| 111 | </refentry> |