| 1 | |
| 2 | <refentry id="xscanu"> |
| 3 | <indexterm id="IndexXscanu"><primary>xscanu</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Scanned Synthesis</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>xscanu</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>xscanu</refname> |
| 13 | <refpurpose> |
| 14 | Compute the waveform and the wavetable for use in scanned synthesis. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para>Plugin opcode in scansyn.</para> |
| 21 | <para> |
| 22 | Experimental version of <link linkend="scanu"><citetitle>scanu</citetitle></link>. Allows much larger matrices and is faster and smaller but removes some (unused?) flexibility. If liked, it will replace the older opcode as it is syntax compatible but extended. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis><command>xscanu</command> init, irate, ifndisplace, ifnmass, ifnmatrix, ifncentr, ifndamp, kmass, \ |
| 29 | kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialization</title> |
| 34 | <para> |
| 35 | <emphasis>init</emphasis> -- the initial position of the masses. If this is a negative number, then the absolute of init signifies the table to use as a hammer shape. If init > 0, the length of it should be the same as the intended mass number, otherwise it can be anything. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>irate</emphasis> -- update rate. |
| 40 | </para> |
| 41 | |
| 42 | <para> |
| 43 | <emphasis>ifndisplace</emphasis> -- the ftable that contains the initial velocity for each mass. It should have the same size as the intended mass number. |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <emphasis>ifnmass</emphasis> -- ftable that contains the mass of each mass. It should have the same size as the intended mass number. |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | <emphasis>ifnmatrix</emphasis> -- |
| 52 | <itemizedlist> |
| 53 | <listitem><para><emphasis>either</emphasis> an ftable that contains the spring stiffness of each connection. It should have the same size as the square of the intended mass number. The data ordering is a row after row dump of the connection matrix of the system.</para></listitem> |
| 54 | <listitem><para><emphasis>or</emphasis> a string giving the name of a file in the MATRIX format</para></listitem> |
| 55 | </itemizedlist> |
| 56 | </para> |
| 57 | |
| 58 | <para> |
| 59 | <emphasis>ifncentr</emphasis> -- ftable that contains the centering force of each mass. It should have the same size as the intended mass number. |
| 60 | </para> |
| 61 | |
| 62 | <para> |
| 63 | <emphasis>ifndamp</emphasis> -- the ftable that contains the damping factor of each mass. It should have the same size as the intended mass number. |
| 64 | </para> |
| 65 | |
| 66 | <para> |
| 67 | <emphasis>ileft</emphasis> -- If init < 0, the position of the left hammer (ileft = 0 is hit at leftmost, ileft = 1 is hit at rightmost). |
| 68 | </para> |
| 69 | |
| 70 | <para> |
| 71 | <emphasis>iright</emphasis> -- If init < 0, the position of the right hammer (iright = 0 is hit at leftmost, iright = 1 is hit at rightmost). |
| 72 | </para> |
| 73 | |
| 74 | <para> |
| 75 | <emphasis>idisp</emphasis> -- If 0, no display of the masses is provided. |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | <emphasis>id</emphasis> -- If positive, the ID of the opcode. This will be used to point the scanning opcode to the proper waveform maker. If this value is negative, the absolute of this value is the wavetable on which to write the waveshape. That wavetable can be used later from an other opcode to generate sound. The initial contents of this table will be destroyed. |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>Performance</title> |
| 85 | |
| 86 | <para> |
| 87 | <emphasis>kmass</emphasis> -- scales the masses |
| 88 | </para> |
| 89 | |
| 90 | <para> |
| 91 | <emphasis>kmtrxstiff</emphasis> -- scales the spring stiffness |
| 92 | </para> |
| 93 | |
| 94 | <para> |
| 95 | <emphasis>kcentr</emphasis> -- scales the centering force |
| 96 | </para> |
| 97 | |
| 98 | <para> |
| 99 | <emphasis>kdamp</emphasis> -- scales the damping |
| 100 | </para> |
| 101 | |
| 102 | <para> |
| 103 | <emphasis>kpos</emphasis> -- position of an active hammer along the string (kpos = 0 is leftmost, kpos = 1 is rightmost). The shape of the hammer is determined by init and the power it pushes with is kstrngth. |
| 104 | </para> |
| 105 | |
| 106 | <para> |
| 107 | <emphasis>kdisplace</emphasis> -- power that the active hammer uses |
| 108 | </para> |
| 109 | |
| 110 | <para> |
| 111 | <emphasis>ain</emphasis> -- audio input that adds to the velocity of the masses. Amplitude should not be too great. |
| 112 | </para> |
| 113 | </refsect1> |
| 114 | |
| 115 | <refsect1> |
| 116 | <title>Matrix Format</title> |
| 117 | |
| 118 | <para> |
| 119 | The xscanu matrix format is a list of connections, one per line linking point x to point y. There is no weight given to the link; it is assumed to be unity. The list is preceded by the line <MATRIX> and ends with a </MATRIX> line |
| 120 | </para> |
| 121 | |
| 122 | <para> |
| 123 | For example, a circular string of 8 would be coded as |
| 124 | |
| 125 | <informalexample> |
| 126 | <programlisting> |
| 127 | <MATRIX> |
| 128 | 0 1 |
| 129 | 1 0 |
| 130 | 1 2 |
| 131 | 2 1 |
| 132 | 2 3 |
| 133 | 3 2 |
| 134 | 3 4 |
| 135 | 4 3 |
| 136 | 4 5 |
| 137 | 5 4 |
| 138 | 5 6 |
| 139 | 6 5 |
| 140 | 6 7 |
| 141 | 7 6 |
| 142 | 0 7 |
| 143 | </MATRIX> |
| 144 | </programlisting> |
| 145 | </informalexample> |
| 146 | To avoid confusion with other matrix formats, it is best to save this matrix format file using the extension <citetitle>file.XmatrxT.</citetitle> |
| 147 | </para> |
| 148 | </refsect1> |
| 149 | |
| 150 | <refsect1> |
| 151 | <title>Examples</title> |
| 152 | <para> |
| 153 | Here is an example of the xscanu opcode. It uses the file <ulink url="examples/xscanu.csd"><citetitle>xscanu.csd</citetitle></ulink>. |
| 154 | <example> |
| 155 | <title>Example of the xscanu opcode.</title> |
| 156 | <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> |
| 157 | <xi:include href="examples-xml/xscanu.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 158 | </example> |
| 159 | <para> |
| 160 | For similar examples, see the documentation on <link linkend="scans"><citetitle>scans</citetitle></link>. |
| 161 | </para> |
| 162 | </para> |
| 163 | </refsect1> |
| 164 | |
| 165 | <refsect1> |
| 166 | <title>See Also</title> |
| 167 | <para> |
| 168 | More information on Scanned Synthesis (as well as several other matrices) is available on the <ulink url="http://www.csounds.com/scanned/"><citetitle>Scanned Synthesis page</citetitle></ulink> at cSounds.com. |
| 169 | </para> |
| 170 | <para> Also an article on these opcodes: <ulink url="http://www.csounds.com/stevenyi/scanned/yi_scannedSynthesis.html"><citetitle>http://www.csounds.com/stevenyi/scanned/yi_scannedSynthesis.html</citetitle></ulink> , written by Steven Yi </para> |
| 171 | <para> |
| 172 | <link linkend="scanu"><citetitle>scanu</citetitle></link>, |
| 173 | <link linkend="xscans"><citetitle>xscans</citetitle></link> |
| 174 | </para> |
| 175 | </refsect1> |
| 176 | |
| 177 | <refsect1> |
| 178 | <title>Credits</title> |
| 179 | <para>Written by &namejohn;.</para> |
| 180 | <para>New in version 4.20</para> |
| 181 | </refsect1> |
| 182 | </refentry> |