| 1 | |
| 2 | <refentry id="GEN44"> |
| 3 | <indexterm id="IndexGEN44"><primary>GEN44</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN44</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN44</refname> |
| 10 | <refpurpose> |
| 11 | Generates a stiffness (connection) matrix for use in scanu/scanu2. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | Generates a stiffness matrix from a text file of triples numbers. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size -44 "filename"</synopsis> |
| 25 | <synopsis><command>f</command> # time size -44 num</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | The file named in version 1 or the file stiff.num in the second case |
| 32 | is read to create the matrix.</para> |
| 33 | </refsect1> |
| 34 | |
| 35 | <refsect1> |
| 36 | <title>Matrix Format</title> |
| 37 | <para> |
| 38 | The first line of the file should be |
| 39 | <quote> |
| 40 | <MATRIX size=integer> |
| 41 | </quote> |
| 42 | and it creates a square matrix of the |
| 43 | indicated size. This is followed by lines of two or three numbers, |
| 44 | the first two denoting a connection from the first to the second. |
| 45 | The third number is a weight; a weight of 2 is like having two links so more |
| 46 | information gets distributed, while a zero weight means no link. If this third |
| 47 | number is omitted it is taken as value 1. The list is terminated by a |
| 48 | <quote> |
| 49 | </MATRIX> |
| 50 | </quote> |
| 51 | line or end of file. |
| 52 | </para> |
| 53 | <para> |
| 54 | Example of this matrix format: |
| 55 | <informalexample> |
| 56 | <programlisting> |
| 57 | <MATRIX size=16> |
| 58 | 1 2 2 |
| 59 | 2 3 1 |
| 60 | 3 4 3 |
| 61 | 4 5 1 |
| 62 | 5 6 4 |
| 63 | 6 7 1 |
| 64 | 7 8 5 |
| 65 | 8 9 6 |
| 66 | 9 10 7 |
| 67 | 10 11 6 |
| 68 | 11 12 5 |
| 69 | 12 13 4 |
| 70 | 13 14 3 |
| 71 | 14 15 2 |
| 72 | 15 16 1 |
| 73 | 16 1 9 |
| 74 | 14 13 2 |
| 75 | 10 3 6 |
| 76 | 6 4 2 |
| 77 | 2 14 7 |
| 78 | </MATRIX> |
| 79 | </programlisting> |
| 80 | </informalexample> |
| 81 | <para>can be given as zero in which case a size*size table is |
| 82 | created. If the size in the gen statememt is too small for the |
| 83 | matrix then space is re-allocated to the required size. |
| 84 | </para> |
| 85 | Note: to avoid confusion with other matrix formats, it is best to save this matrix format file using the extension <citetitle>file.matrxT.</citetitle> |
| 86 | </para> |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | <title>Examples</title> |
| 91 | <para> |
| 92 | Here is an example of the GEN44 generator. It uses the file <ulink url="examples/gen44.csd"><citetitle>gen44.csd</citetitle></ulink>. |
| 93 | <example> |
| 94 | <title>Example of the GEN44 generator.</title> |
| 95 | <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> |
| 96 | <xi:include href="examples-xml/gen44.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 97 | </example> |
| 98 | </para> |
| 99 | <para> |
| 100 | Here is another example of GEN44. It uses the file <ulink url="examples/gen44-2.csd"><citetitle>gen44-2.csd</citetitle></ulink>. The matrix file has 1024 masses. |
| 101 | <example> |
| 102 | <title>Second example of the GEN44 generator.</title> |
| 103 | <xi:include href="examples-xml/gen44-2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 104 | </example> |
| 105 | </para> |
| 106 | </refsect1> |
| 107 | |
| 108 | <refsect1> |
| 109 | <title>See also</title> |
| 110 | <para><link linkend="SiggenScanTop"><citetitle>Scanned Synthesis</citetitle></link></para> |
| 111 | <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> |
| 112 | </refsect1> |
| 113 | |
| 114 | <refsect1> |
| 115 | <title>Credits</title> |
| 116 | <para>Author: &namejohn;</para> |
| 117 | <para>New in Version 6.16</para> |
| 118 | <para>June 2021</para> |
| 119 | </refsect1> |
| 120 | </refentry> |