| 1 | |
| 2 | <refentry id="tb"> |
| 3 | <indexterm id="IndexTb15_init"><primary>tb15_init</primary></indexterm> |
| 4 | |
| 5 | <indexterm id="IndexTb14_init"><primary>tb14_init</primary></indexterm> |
| 6 | |
| 7 | <indexterm id="IndexTb13_init"><primary>tb13_init</primary></indexterm> |
| 8 | |
| 9 | <indexterm id="IndexTb12_init"><primary>tb12_init</primary></indexterm> |
| 10 | |
| 11 | <indexterm id="IndexTb11_init"><primary>tb11_init</primary></indexterm> |
| 12 | |
| 13 | <indexterm id="IndexTb10_init"><primary>tb10_init</primary></indexterm> |
| 14 | |
| 15 | <indexterm id="IndexTb9_init"><primary>tb9_init</primary></indexterm> |
| 16 | |
| 17 | <indexterm id="IndexTb8_init"><primary>tb8_init</primary></indexterm> |
| 18 | |
| 19 | <indexterm id="IndexTb7_init"><primary>tb7_init</primary></indexterm> |
| 20 | |
| 21 | <indexterm id="IndexTb6_init"><primary>tb6_init</primary></indexterm> |
| 22 | |
| 23 | <indexterm id="IndexTb5_init"><primary>tb5_init</primary></indexterm> |
| 24 | |
| 25 | <indexterm id="IndexTb4_init"><primary>tb4_init</primary></indexterm> |
| 26 | |
| 27 | <indexterm id="IndexTb3_init"><primary>tb3_init</primary></indexterm> |
| 28 | |
| 29 | <indexterm id="IndexTb2_init"><primary>tb2_init</primary></indexterm> |
| 30 | |
| 31 | <indexterm id="IndexTb1_init"><primary>tb1_init</primary></indexterm> |
| 32 | |
| 33 | <indexterm id="IndexTb0_init"><primary>tb0_init</primary></indexterm> |
| 34 | |
| 35 | <indexterm id="IndexTb15"><primary>tb15</primary></indexterm> |
| 36 | |
| 37 | <indexterm id="IndexTb14"><primary>tb14</primary></indexterm> |
| 38 | |
| 39 | <indexterm id="IndexTb13"><primary>tb13</primary></indexterm> |
| 40 | |
| 41 | <indexterm id="IndexTb12"><primary>tb12</primary></indexterm> |
| 42 | |
| 43 | <indexterm id="IndexTb11"><primary>tb11</primary></indexterm> |
| 44 | |
| 45 | <indexterm id="IndexTb10"><primary>tb10</primary></indexterm> |
| 46 | |
| 47 | <indexterm id="IndexTb9"><primary>tb9</primary></indexterm> |
| 48 | |
| 49 | <indexterm id="IndexTb8"><primary>tb8</primary></indexterm> |
| 50 | |
| 51 | <indexterm id="IndexTb7"><primary>tb7</primary></indexterm> |
| 52 | |
| 53 | <indexterm id="IndexTb6"><primary>tb6</primary></indexterm> |
| 54 | |
| 55 | <indexterm id="IndexTb5"><primary>tb5</primary></indexterm> |
| 56 | |
| 57 | <indexterm id="IndexTb4"><primary>tb4</primary></indexterm> |
| 58 | |
| 59 | <indexterm id="IndexTb3"><primary>tb3</primary></indexterm> |
| 60 | |
| 61 | <indexterm id="IndexTb2"><primary>tb2</primary></indexterm> |
| 62 | |
| 63 | <indexterm id="IndexTb1"><primary>tb1</primary></indexterm> |
| 64 | |
| 65 | <indexterm id="IndexTb0"><primary>tb0</primary></indexterm> |
| 66 | <refentryinfo><title>Table Control:Table Queries</title></refentryinfo> |
| 67 | <refmeta> |
| 68 | <refentrytitle>tb</refentrytitle> |
| 69 | </refmeta> |
| 70 | |
| 71 | <refnamediv> |
| 72 | <refname>tb0, tb1, tb2, tb3, tb4, tb5, tb6, tb7, tb8, tb9, tb10, tb11, tb12, tb13, tb14, tb15</refname> |
| 73 | <refname>tb0_init, tb1_init, tb2_init, tb3_init, tb4_init, tb5_init, tb6_init, tb7_init, tb8_init, tb9_init, tb10_init, tb11_init, tb12_init, tb13_init, tb14_init, tb15_init</refname> |
| 74 | <refpurpose> |
| 75 | Table Read Access inside expressions. |
| 76 | </refpurpose> |
| 77 | </refnamediv> |
| 78 | |
| 79 | <refsect1> |
| 80 | <title>Description</title> |
| 81 | <para> |
| 82 | <note> These opcodes have been largely superceded by the |
| 83 | functional form of the opcode tab</note> |
| 84 | Allow to read tables in function fashion, to be used inside expressions. |
| 85 | |
| 86 | At earlier times Csound only supported functions with a single input |
| 87 | argument. However, to access table elements, user must provide two |
| 88 | numbers, i.e. the number of table and the index of element. So, in |
| 89 | order to allow to access a table element with a function, a |
| 90 | previous preparation step should be done. |
| 91 | </para> |
| 92 | </refsect1> |
| 93 | |
| 94 | <refsect1> |
| 95 | <title>Syntax</title> |
| 96 | <synopsis><command>tb0_init</command> ifn</synopsis> |
| 97 | <synopsis><command>tb1_init</command> ifn</synopsis> |
| 98 | <synopsis><command>tb2_init</command> ifn</synopsis> |
| 99 | <synopsis><command>tb3_init</command> ifn</synopsis> |
| 100 | <synopsis><command>tb4_init</command> ifn</synopsis> |
| 101 | <synopsis><command>tb5_init</command> ifn</synopsis> |
| 102 | <synopsis><command>tb6_init</command> ifn</synopsis> |
| 103 | <synopsis><command>tb7_init</command> ifn</synopsis> |
| 104 | <synopsis><command>tb8_init</command> ifn</synopsis> |
| 105 | <synopsis><command>tb9_init</command> ifn</synopsis> |
| 106 | <synopsis><command>tb10_init</command> ifn</synopsis> |
| 107 | <synopsis><command>tb11_init</command> ifn</synopsis> |
| 108 | <synopsis><command>tb12_init</command> ifn</synopsis> |
| 109 | <synopsis><command>tb13_init</command> ifn</synopsis> |
| 110 | <synopsis><command>tb14_init</command> ifn</synopsis> |
| 111 | <synopsis><command>tb15_init</command> ifn</synopsis> |
| 112 | |
| 113 | <synopsis>iout = <command>tb0</command>(iIndex)</synopsis> |
| 114 | <synopsis>kout = <command>tb0</command>(kIndex)</synopsis> |
| 115 | <synopsis>iout = <command>tb1</command>(iIndex)</synopsis> |
| 116 | <synopsis>kout = <command>tb1</command>(kIndex)</synopsis> |
| 117 | <synopsis>iout = <command>tb2</command>(iIndex)</synopsis> |
| 118 | <synopsis>kout = <command>tb2</command>(kIndex)</synopsis> |
| 119 | <synopsis>iout = <command>tb3</command>(iIndex)</synopsis> |
| 120 | <synopsis>kout = <command>tb3</command>(kIndex)</synopsis> |
| 121 | <synopsis>iout = <command>tb4</command>(iIndex)</synopsis> |
| 122 | <synopsis>kout = <command>tb4</command>(kIndex)</synopsis> |
| 123 | <synopsis>iout = <command>tb5</command>(iIndex)</synopsis> |
| 124 | <synopsis>kout = <command>tb5</command>(kIndex)</synopsis> |
| 125 | <synopsis>iout = <command>tb6</command>(iIndex)</synopsis> |
| 126 | <synopsis>kout = <command>tb6</command>(kIndex)</synopsis> |
| 127 | <synopsis>iout = <command>tb7</command>(iIndex)</synopsis> |
| 128 | <synopsis>kout = <command>tb7</command>(kIndex)</synopsis> |
| 129 | <synopsis>iout = <command>tb8</command>(iIndex)</synopsis> |
| 130 | <synopsis>kout = <command>tb8</command>(kIndex)</synopsis> |
| 131 | <synopsis>iout = <command>tb9</command>(iIndex)</synopsis> |
| 132 | <synopsis>kout = <command>tb9</command>(kIndex)</synopsis> |
| 133 | <synopsis>iout = <command>tb10</command>(iIndex)</synopsis> |
| 134 | <synopsis>kout = <command>tb10</command>(kIndex)</synopsis> |
| 135 | <synopsis>iout = <command>tb11</command>(iIndex)</synopsis> |
| 136 | <synopsis>kout = <command>tb11</command>(kIndex)</synopsis> |
| 137 | <synopsis>iout = <command>tb12</command>(iIndex)</synopsis> |
| 138 | <synopsis>kout = <command>tb12</command>(kIndex)</synopsis> |
| 139 | <synopsis>iout = <command>tb13</command>(iIndex)</synopsis> |
| 140 | <synopsis>kout = <command>tb13</command>(kIndex)</synopsis> |
| 141 | <synopsis>iout = <command>tb14</command>(iIndex)</synopsis> |
| 142 | <synopsis>kout = <command>tb14</command>(kIndex)</synopsis> |
| 143 | <synopsis>iout = <command>tb15</command>(iIndex)</synopsis> |
| 144 | <synopsis>kout = <command>tb15</command>(kIndex)</synopsis> |
| 145 | </refsect1> |
| 146 | |
| 147 | <refsect1> |
| 148 | <title>Performance</title> |
| 149 | <para> |
| 150 | There are 16 different opcodes whose name is associated with a |
| 151 | number from 0 to 15. User can associate a specific table with each |
| 152 | opcode (so the maximum number of tables that can be accessed in |
| 153 | function fashion is 16). Prior to access a table, user must |
| 154 | associate the table with one of the 16 opcodes by means of an |
| 155 | opcode chosen among <emphasis>tb0_init</emphasis>, ..., |
| 156 | <emphasis>tb15_init</emphasis>. For example, |
| 157 | <programlisting> |
| 158 | <emphasis role="opc">tb0_init</emphasis> 1</programlisting> |
| 159 | associates table 1 with tb0( ) function, so that, each element of |
| 160 | table 1 can be accessed (in function fashion) with: |
| 161 | <programlisting> |
| 162 | kvar <emphasis role="op">=</emphasis> <emphasis role="opc">tb0</emphasis>(k_some_index_of_table1) <emphasis role="op">*</emphasis> k_some_other_var</programlisting> |
| 163 | <programlisting> |
| 164 | ivar <emphasis role="op">=</emphasis> <emphasis role="opc">tb0</emphasis>(i_some_index_of_table1) <emphasis role="op">+</emphasis> i_some_other_var</programlisting> |
| 165 | etc... |
| 166 | </para> |
| 167 | <para> |
| 168 | By using these opcodes, user can drastically reduce the number of |
| 169 | lines of an orchestra, improving its readability. |
| 170 | </para> |
| 171 | </refsect1> |
| 172 | |
| 173 | <refsect1> |
| 174 | <title>Credits</title> |
| 175 | <para>Written by &namegabriel;.</para> |
| 176 | </refsect1> |
| 177 | </refentry> |