Debian Codegraph @

opcodes/ftlen.xml

raw symbols SCIP
1
2 <refentry id="ftlen">
3 <indexterm id="IndexFtlen"><primary>ftlen</primary></indexterm>
4 <refentryinfo><title>Table Control:Table Queries</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>ftlen</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>ftlen</refname>
13 <refpurpose>
14 Returns the size of a stored function table.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Returns the size of a stored function table.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis><command>ftlen</command>(x) (init-rate args only)</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Performance</title>
32 <para>
33 Returns the size (number of points, excluding guard point) of stored function table, number <emphasis>x</emphasis>. While most units referencing a stored table will automatically take its size into account (so tables can be of arbitrary length), this function reports the actual size if that is needed. Note that <emphasis>ftlen</emphasis> will always return a power-of-2 value, i.e. the function table guard point (see <link linkend="f"><citetitle>f Statement</citetitle></link>) is not included.As of Csound version 3.53, <emphasis>ftlen</emphasis> works with deferred function tables (see <link linkend="GEN01"><citetitle>GEN01</citetitle></link>).
34 </para>
35 <para>
36 <emphasis>ftlen</emphasis> differs from <emphasis>nsamp</emphasis> in that <emphasis>nsamp</emphasis> gives the number of sample frames loaded, while <emphasis>ftlen</emphasis> gives the total number of samples without the guard point. For example, with a stereo sound file of 10000 samples, ftlen() would return 19999 (i.e. a total of 20000 mono samples, not including a guard point), but nsamp() returns 10000.
37 </para>
38 </refsect1>
39
40 <refsect1>
41 <title>Examples</title>
42 <para>
43 Here is an example of the ftlen opcode. It uses the file <ulink url="examples/ftlen.csd"><citetitle>ftlen.csd</citetitle></ulink>, <ulink url="examples/fox.wav"><citetitle>fox.wav</citetitle></ulink> and <ulink url="examples/drumsMlp.wav"><citetitle>drumsMlp.wav</citetitle></ulink>.
44
45 <example>
46 <title>Example of the ftlen opcode.</title>
47
48
49
50 <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>
51 <xi:include href="examples-xml/ftlen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
52 </example>
53
54 The audio file <quote>fox.wav</quote> is 121569 samples long, <quote>drumsMlp.wav</quote> has a length of 88200 samples. The ftlen opcode reports them as 121568 and 88199 samples, because it reserves 1 point for the guard point. Its output should include lines like these:
55 <screen>
56 instr 1: ift = 121568.000
57 instr 1: ift = 88199.000
58 </screen>
59 </para>
60 </refsect1>
61
62 <refsect1>
63 <title>See also</title>
64 <para><link linkend="TableQueries"><citetitle>Table Control:Table Queries</citetitle></link></para>
65 </refsect1>
66
67 <refsect1>
68 <title>Credits</title>
69 <para>
70 <simplelist>
71 <member>Author: &namebarry;</member>
72 <member>MIT</member>
73 <member>Cambridge, Massachussetts</member>
74 <member>1997</member>
75 </simplelist>
76 </para>
77 </refsect1>
78 </refentry>