| 1 | |
| 2 | <refentry id="tablefilteri"> |
| 3 | <indexterm id="IndexTablefilteri"><primary>tablefilteri</primary></indexterm> |
| 4 | <refentryinfo><title>Table Control:Read/Write Operations</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>tablefilteri</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>tablefilteri</refname> |
| 11 | <refpurpose> |
| 12 | Filters a source table and writes result into a destination table. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode can be used in order to filter values from function |
| 20 | tables following certain algorithms. The filtered output is |
| 21 | written into a destination table and the number of elements that |
| 22 | have passed the filter is returned. |
| 23 | </para> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>inumpassed <command>tablefilteri</command> iouttable, iintatble, imode, iparam</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para> |
| 34 | <emphasis>inumpassed</emphasis> -- the number of elements that |
| 35 | have passed the filter. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>iouttable</emphasis> -- the number of the table containing the values that have passed. |
| 40 | </para> |
| 41 | |
| 42 | <para> |
| 43 | <emphasis>iintatble</emphasis> -- the number of the table used as filter input. |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | <emphasis>imode</emphasis> -- mode of the filter: |
| 48 | <itemizedlist> |
| 49 | <listitem> |
| 50 | 1 -- tests the weight of the denominators of the fractions |
| 51 | in the source table. Letting pass only values from the |
| 52 | source that are less heavy than the weight of the threshold. |
| 53 | </listitem> |
| 54 | <listitem> |
| 55 | 2 -- tests the weight of the denominators of the fractions |
| 56 | in the source table. Letting pass only values from the |
| 57 | source that are heavier than or equal to the weight of the |
| 58 | threshold. |
| 59 | </listitem> |
| 60 | </itemizedlist> |
| 61 | </para> |
| 62 | |
| 63 | <para> |
| 64 | <emphasis>iparam</emphasis> -- integer threshold parameter for |
| 65 | the filter. It means that denominators whose weights are heavier |
| 66 | than the weight of this threshold are not passed through the |
| 67 | filter. The weight of an integer is calculated using Clarence |
| 68 | Barlow's function of indigestibility of a number. According to |
| 69 | this function, higher prime numbers contribute to an increased |
| 70 | weight of any natural integer they divide. The order of the |
| 71 | first 16 integers according to their indigestibility is: 1, 2, |
| 72 | 4, 3, 8, 6, 16, 12, 9, 5, 10, 15, 7, 14. |
| 73 | </para> |
| 74 | </refsect1> |
| 75 | |
| 76 | <refsect1> |
| 77 | <title>Examples</title> |
| 78 | <para> |
| 79 | Here is an example of the tablefilteri opcode. It uses the file <ulink url="examples/tablefilter.csd"><citetitle>tablefilter.csd</citetitle></ulink>. |
| 80 | <example> |
| 81 | <title>Example of the tablefilteri opcode.</title> |
| 82 | <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> |
| 83 | <xi:include href="examples-xml/tablefilter.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 84 | </example> |
| 85 | </para> |
| 86 | </refsect1> |
| 87 | |
| 88 | <refsect1> |
| 89 | <title>See also</title> |
| 90 | <para><link linkend="TableReadwrit"><citetitle>Read/Write Operations</citetitle></link></para> |
| 91 | </refsect1> |
| 92 | |
| 93 | <refsect1> |
| 94 | <title>Credits</title> |
| 95 | <para> |
| 96 | <simplelist> |
| 97 | <member>Author: Georg Boenn </member> |
| 98 | <member>University of Glamorgan, UK</member> |
| 99 | </simplelist> |
| 100 | </para> |
| 101 | <para>New in Csound version 5.13</para> |
| 102 | </refsect1> |
| 103 | </refentry> |