| 1 | |
| 2 | <refentry id="scanu2"> |
| 3 | <indexterm id="IndexScanu2"><primary>scanu2</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Scanned Synthesis</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>scanu2</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>scanu2</refname> |
| 11 | <refpurpose> |
| 12 | Compute the waveform and the wavetable for use in scanned synthesis. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para>Plugin opcode in scansyn.</para> |
| 19 | <para> |
| 20 | Compute the waveform and the wavetable for use in scanned synthesis. |
| 21 | </para> |
| 22 | </refsect1> |
| 23 | |
| 24 | <refsect1> |
| 25 | <title>Syntax</title> |
| 26 | <synopsis><command>scanu2</command> init, irate, ifndisplace, |
| 27 | ifnmass, ifnmatrix, ifncentr, ifndamp, kmass, kmtrxstiff, kcentr, |
| 28 | kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para> |
| 34 | <emphasis>init</emphasis> -- the initial position of the masses. |
| 35 | If this is a negative number, then the absolute of |
| 36 | <emphasis>init</emphasis> signifies the table to use as a hammer |
| 37 | shape. If <emphasis>init</emphasis> > 0, the length of it |
| 38 | should be the same as the intended mass number, otherwise it can |
| 39 | be anything. If <emphasis>init</emphasis> is not an integer the |
| 40 | initial state is white noise with the fractional part being a scaling.. |
| 41 | </para> |
| 42 | <para> |
| 43 | <emphasis>irate</emphasis> -- the amount of time between |
| 44 | successive updates of the mass state. Kind of like the sample |
| 45 | period of the system. If the number is big, the string will |
| 46 | update at a slow rate showing little timbral variability; |
| 47 | otherwise it will change rapidly resulting in a more dynamic |
| 48 | sound. |
| 49 | </para> |
| 50 | <para> |
| 51 | <emphasis>ifndisplace</emphasis> -- the ftable that contains the |
| 52 | initial velocity for each mass. It should have the same size as |
| 53 | the intended mass number. |
| 54 | </para> |
| 55 | |
| 56 | <para> |
| 57 | <emphasis>ifnmass</emphasis> -- ftable that contains the mass of |
| 58 | each mass. It should have the same size as the intended mass |
| 59 | number. |
| 60 | </para> |
| 61 | |
| 62 | <para> |
| 63 | <emphasis>ifnmatrix</emphasis> -- ftable that contains the spring |
| 64 | stiffness of each connection. It should have the same size as |
| 65 | the square of the intended mass number. The data ordering is a |
| 66 | row after row dump of the connection matrix of the system. |
| 67 | </para> |
| 68 | |
| 69 | <para> |
| 70 | <emphasis>ifncentr</emphasis> -- ftable that contains the |
| 71 | centering force of each mass. It should have the same size as |
| 72 | the intended mass number. |
| 73 | </para> |
| 74 | |
| 75 | <para> |
| 76 | <emphasis>ifndamp</emphasis> -- the ftable that contains the |
| 77 | damping factor of each mass. It should have the same size as the |
| 78 | intended mass number. |
| 79 | </para> |
| 80 | |
| 81 | <para> |
| 82 | <emphasis>ileft</emphasis> -- If <emphasis>init</emphasis> < |
| 83 | 0, the position of the positive pluck in the range 0 to 1. Ignored when <emphasis>init</emphasis> > 0. |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | <emphasis>iright</emphasis> -- If <emphasis>init</emphasis> < |
| 88 | 0, the position of the negative pluck in the range 0 to 1. Ignored when <emphasis>init</emphasis> > 0. |
| 89 | </para> |
| 90 | <para>If <emphasis>ileft</emphasis> is the same as |
| 91 | <emphasis>iright</emphasis> a single positive pluck is used as initial state. |
| 92 | </para> |
| 93 | |
| 94 | <para> |
| 95 | <emphasis>idisp</emphasis> -- If 0, no display of the masses is provided. |
| 96 | </para> |
| 97 | |
| 98 | <para> |
| 99 | <emphasis>id</emphasis> -- If positive, the ID of the opcode. |
| 100 | This will be used to point the scanning opcode to the proper |
| 101 | waveform maker. If this value is negative, the absolute of this |
| 102 | value is the wavetable on which to write the waveshape. That |
| 103 | wavetable can be used later from an other opcode to generate |
| 104 | sound. The initial contents of this table will be destroyed. |
| 105 | </para> |
| 106 | </refsect1> |
| 107 | |
| 108 | <refsect1> |
| 109 | <title>Performance</title> |
| 110 | <para> |
| 111 | <emphasis>kmass</emphasis> -- scales the masses |
| 112 | </para> |
| 113 | |
| 114 | <para> |
| 115 | <emphasis>kmtrxstiff</emphasis> -- scales the spring stiffness. Note |
| 116 | that larger numbers slow the evolution of the vibration, |
| 117 | which is the reciprocal of the coresponding parameter in scanu. |
| 118 | </para> |
| 119 | |
| 120 | <para> |
| 121 | <emphasis>kcentr</emphasis> -- scales the centering force |
| 122 | </para> |
| 123 | |
| 124 | <para> |
| 125 | <emphasis>kdamp</emphasis> -- scales the damping |
| 126 | </para> |
| 127 | |
| 128 | <para> |
| 129 | <emphasis>kpos</emphasis> -- position of an active hammer along |
| 130 | the string (<emphasis>kpos</emphasis> = 0 is leftmost, |
| 131 | <emphasis>kpos</emphasis> = 1 is rightmost). The shape of the |
| 132 | hammer is determined by <emphasis>init</emphasis> and the power |
| 133 | it pushes with is <emphasis>kdisplace</emphasis>. |
| 134 | </para> |
| 135 | |
| 136 | <para> |
| 137 | <emphasis>kdisplace</emphasis> -- power that the active hammer uses. |
| 138 | </para> |
| 139 | |
| 140 | <para> |
| 141 | <emphasis>ain</emphasis> -- audio input that adds to the |
| 142 | velocity of the masses. Amplitude should not be too great. |
| 143 | </para> |
| 144 | |
| 145 | <note> |
| 146 | <title>Note</title> |
| 147 | <para>Both scanu and scanu2 are capable of reading the binary (.matrxB) and text (.matrxT) matrix format. However, using scanu2 is to be preferred because of its accuracy and better sound quality. |
| 148 | </para> |
| 149 | </note> |
| 150 | </refsect1> |
| 151 | |
| 152 | <refsect1> |
| 153 | <title>Examples</title> |
| 154 | <para> |
| 155 | Here is an example of the scanu2 opcode. It uses the file <ulink url="examples/scanu2.csd"><citetitle>scanu2.csd</citetitle></ulink>. |
| 156 | </para> |
| 157 | <example> |
| 158 | <title>Example of the scanu2 opcode.</title> |
| 159 | <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> |
| 160 | <xi:include href="examples-xml/scanu2.csd.xml" |
| 161 | xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 162 | </example> |
| 163 | <para> |
| 164 | Here is another example of the scanu2 opcode. It uses the file <ulink url="examples/scanu2-2.csd"><citetitle>scanu2-2.csd</citetitle></ulink>. |
| 165 | <example> |
| 166 | <title>Second example of the scanu2 opcode.</title> |
| 167 | <xi:include href="examples-xml/scanu2-2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 168 | </example> |
| 169 | </para> |
| 170 | <para> |
| 171 | Yet another example of the scanu2 opcode. It uses the file <ulink url="examples/scanu2-3.csd"><citetitle>scanu2-3.csd</citetitle></ulink>. |
| 172 | <example> |
| 173 | <title>Third example of the scanu2 opcode.</title> |
| 174 | <xi:include href="examples-xml/scanu2-3.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 175 | </example> |
| 176 | </para> |
| 177 | </refsect1> |
| 178 | |
| 179 | <refsect1> |
| 180 | <title>See also</title> |
| 181 | <para><link linkend="SiggenScanTop"><citetitle>Scanned Synthesis</citetitle></link></para> |
| 182 | <para> More information on the Scanned Synthesis opcodes: <ulink url="http://www.csounds.com/stevenyi/scanned/yi_scannedSynthesis.html"><citetitle>Working with Scanned Synthesis</citetitle></ulink>, written by Steven Yi, and some <ulink url="http://www.csounds.com/scanned/"><citetitle>tutorials</citetitle></ulink> by Richard Boulanger.</para> |
| 183 | </refsect1> |
| 184 | |
| 185 | <refsect1> |
| 186 | <title>Credits</title> |
| 187 | <para> |
| 188 | <simplelist> |
| 189 | <member>Author: &namejohn;</member> after &nameparis; |
| 190 | <member>May 2021</member> |
| 191 | </simplelist> |
| 192 | </para> |
| 193 | |
| 194 | <para>New in Csound version 6.16</para> |
| 195 | </refsect1> |
| 196 | </refentry> |