summaryrefslogtreecommitdiff
path: root/opcodes/ftgenonce.xml
blob: 3a209c9c3ac0964bd4c41bfd83267859c905c68a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<refentry id="ftgenonce">
<indexterm id="Indexftgenonce"><primary>ftgenonce</primary></indexterm>
<refentryinfo><title>Signal Flow Graph Opcodes</title></refentryinfo>
  <refmeta>
    <refentrytitle>ftgenonce</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>ftgenonce</refname>
    <refpurpose>
       Generate a score function table from within the orchestra, which is deleted at the end of the note.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Enables the creation of function tables entirely inside 
      instrument definitions, without any duplication of data.
    </para>
    
    <para>
      The ftgenonce opcode is designed to simplify writing instrument definitions 
      that can be re-used in different orchestras simply by #including them
      and plugging them into some output instrument. There is no need to define 
      function tables either in the score, or in the orchestra header.
    </para>
    
    <para>
      The ftgenonce opcode is similar to ftgentmp, and has identical arguments.
      However, function tables are neither duplicated nor deleted. Instead, 
      all of the arguments to the opcode are concatenated to form the key to a 
      lookup table that points to the function table number. Thus, every request 
      to ftgenonce with the same arguments receives the same instance of the 
      function table data. Every change in the value of any ftgenonce argument
      causes the creation of a new function table.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ifno <command>ftgenonce</command> ip1, ip2dummy, isize, igen, iarga, iargb, ...</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifno</emphasis> --  an automatically
      assigned table number.
    </para>
    <para>
      <emphasis>ip1</emphasis> -- the number of the table to be
      generated or 0 if the number is to be assigned.
    </para>
    <para>

    <emphasis>ip2dummy</emphasis> -- ignored.
    </para>
    <para>
      <emphasis>isize</emphasis> -- table size. Corresponds to p3 of the score <emphasis>f statement</emphasis>.
    </para>

    <para>
      <emphasis>igen</emphasis> -- function table <emphasis>GEN</emphasis> routine. Corresponds to p4 of the score <emphasis>f statement</emphasis>.
    </para>

    <para>
      <emphasis>iarga, iargb, ...</emphasis> -- function table arguments. Correspond to p5 through p<emphasis>n</emphasis> of the score <emphasis>f statement</emphasis>.
    </para>
    <note>
      <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>
    </note>
  </refsect1>
<!--
  <refsect1>
    <title>Performance</title>
  </refsect1>-->


  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Authors: &namemichael;</member>
        <member>2009</member>
      </simplelist>
    </para>
  </refsect1>
</refentry>