| 1 |
|
| 2 |
<refentry id="ftgentmp"> |
| 3 |
<indexterm id="Indexftgentmp"><primary>ftgentmp</primary></indexterm> |
| 4 |
<refentryinfo><title>Table Control</title></refentryinfo> |
| 5 |
<refmeta> |
| 6 |
<refentrytitle>ftgentmp</refentrytitle> |
| 7 |
</refmeta> |
| 8 |
|
| 9 |
<refnamediv> |
| 10 |
<refname>ftgentmp</refname> |
| 11 |
<refpurpose> |
| 12 |
Generate a score function table from within the orchestra, which is deleted at the end of the note. |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Generate a score function table from within the orchestra, |
| 20 |
which is optionally deleted at the end of the note. |
| 21 |
</para> |
| 22 |
</refsect1> |
| 23 |
|
| 24 |
<refsect1> |
| 25 |
<title>Syntax</title> |
| 26 |
<synopsis>ifno <command>ftgentmp</command> ip1, ip2dummy, isize, igen, iarga, iargb, ...</synopsis> |
| 27 |
</refsect1> |
| 28 |
|
| 29 |
<refsect1> |
| 30 |
<title>Initialization</title> |
| 31 |
<para> |
| 32 |
<emphasis>ifno</emphasis> -- either a requested or automatically |
| 33 |
assigned table number above 100. |
| 34 |
</para> |
| 35 |
<para> |
| 36 |
<emphasis>ip1</emphasis> -- the number of the table to be |
| 37 |
generated or 0 if the number is to be assigned, in which case the |
| 38 |
table is deleted at the end of the note activation. |
| 39 |
</para> |
| 40 |
<para> |
| 41 |
|
| 42 |
<emphasis>ip2dummy</emphasis> -- ignored. |
| 43 |
</para> |
| 44 |
<para> |
| 45 |
<emphasis>isize</emphasis> -- table size. Corresponds to p3 of the score <emphasis>f statement</emphasis>. |
| 46 |
</para> |
| 47 |
|
| 48 |
<para> |
| 49 |
<emphasis>igen</emphasis> -- function table <emphasis>GEN</emphasis> routine. Corresponds to p4 of the score <emphasis>f statement</emphasis>. |
| 50 |
</para> |
| 51 |
|
| 52 |
<para> |
| 53 |
<emphasis>iarga, iargb, ...</emphasis> -- function table arguments. Correspond to p5 through p<emphasis>n</emphasis> of the score <emphasis>f statement</emphasis>. |
| 54 |
</para> |
| 55 |
<note> |
| 56 |
<para>Csound was originally designed to support tables with power of two sizes only. Though this has changed in recent versions (you can use any size by using a negative number), many opcodes will not accept them.</para> |
| 57 |
</note> |
| 58 |
</refsect1> |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
<refsect1> |
| 65 |
<title>Examples</title> |
| 66 |
<para> |
| 67 |
Here is an example of the ftgentmp opcode. It uses the file <ulink url="examples/ftgentmp.csd"><citetitle>ftgentmp.csd</citetitle></ulink>. |
| 68 |
<example> |
| 69 |
<title>Example of the ftgentmp opcode.</title> |
| 70 |
<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> |
| 71 |
<xi:include href="examples-xml/ftgentmp.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 72 |
</example> |
| 73 |
The output of this csd shows that the tables are destroyed after the instrument instances that created them terminates, causing an init error if the tables are queried. |
| 74 |
<screen> |
| 75 |
SECTION 1: |
| 76 |
new alloc for instr 1: |
| 77 |
ftable 101: |
| 78 |
instr 1: ifno = 101.000 |
| 79 |
B 0.000 .. 2.000 T 2.000 TT 2.000 M: 0.00000 0.00000 |
| 80 |
new alloc for instr 2: |
| 81 |
instr 2: #i0 = 512.000 |
| 82 |
B 2.000 .. 5.000 T 5.001 TT 5.001 M: 0.00000 0.00000 |
| 83 |
new alloc for instr 1: |
| 84 |
ftable 102: |
| 85 |
instr 1: ifno = 102.000 |
| 86 |
B 5.000 .. 7.000 T 7.001 TT 7.001 M: 0.00000 0.00000 |
| 87 |
instr 2: #i0 = 512.000 |
| 88 |
B 7.000 .. 12.000 T 11.999 TT 11.999 M: 0.00000 0.00000 |
| 89 |
INIT ERROR in instr 2: Invalid ftable no. 101.000000 |
| 90 |
#i0 ftlen.i p4 |
| 91 |
instr 2: #i0 = -1.000 |
| 92 |
B 12.000 - note deleted. i2 had 1 init errors |
| 93 |
B 12.000 .. 17.000 T 17.000 TT 17.000 M: 0.00000 0.00000 |
| 94 |
INIT ERROR in instr 2: Invalid ftable no. 102.000000 |
| 95 |
#i0 ftlen.i p4 |
| 96 |
instr 2: #i0 = -1.000 |
| 97 |
B 17.000 - note deleted. i2 had 1 init errors |
| 98 |
</screen> |
| 99 |
</para> |
| 100 |
</refsect1> |
| 101 |
|
| 102 |
<refsect1> |
| 103 |
<title>See also</title> |
| 104 |
<para><link linkend="TableTop"><citetitle>Function Table Control</citetitle></link></para> |
| 105 |
</refsect1> |
| 106 |
|
| 107 |
<refsect1> |
| 108 |
<title>Credits</title> |
| 109 |
<para> |
| 110 |
<simplelist> |
| 111 |
<member>Authors: &nameistvan;</member> |
| 112 |
<member>2005</member> |
| 113 |
</simplelist> |
| 114 |
</para> |
| 115 |
</refsect1> |
| 116 |
</refentry> |