| 1 | <refentry id="pvsbuffer"> |
| 2 | <indexterm id="Indexpvsbuffer"><primary>pvsbuffer</primary></indexterm> |
| 3 | |
| 4 | <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>pvsbuffer</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>pvsbuffer</refname> |
| 11 | <refpurpose> |
| 12 | This opcode creates and writes to a circular buffer for f-signals (streaming PV signals). |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode sets up and writes to a circular buffer of length ilen (secs), |
| 20 | giving a handle for the buffer and a time pointer, which holds the |
| 21 | current write position (also in seconds). It can be used with one or |
| 22 | more <link linkend="pvsbufread"><citetitle>pvsbufread</citetitle></link> opcodes. Writing is circular, wrapping around at the |
| 23 | end of the buffer. |
| 24 | </para> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Syntax</title> |
| 29 | <synopsis>ihandle, ktime <command>pvsbuffer</command> fsig, ilen </synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Initialisation</title> |
| 34 | <para> |
| 35 | <emphasis>ihandle</emphasis> -- handle identifying this particular buffer, which should be passed to a reader opcode. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | <emphasis>ilen</emphasis> -- buffer length in seconds. |
| 40 | </para> |
| 41 | |
| 42 | <title>Performance</title> |
| 43 | <para> |
| 44 | <emphasis>fsig</emphasis> -- an input pv stream |
| 45 | </para> |
| 46 | <para> |
| 47 | <emphasis>ktime</emphasis> -- the current time of writing in the buffer |
| 48 | </para> |
| 49 | <para> |
| 50 | <emphasis>pvsbuffer</emphasis> stores <emphasis>fsig</emphasis> in a buffer which can be read by <link linkend="pvsbufread"><citetitle>pvsbufread</citetitle></link> using the handle <emphasis>ihandle</emphasis>. Different buffers will have different handles so they can be read independently by different <link linkend="pvsbufread"><citetitle>pvsbufread</citetitle></link> opcodes. <emphasis>pvsbuffer</emphasis> gives in its output the current time (<emphasis>ktime</emphasis>) inside the ring buffer which has just been written. |
| 51 | </para> |
| 52 | </refsect1> |
| 53 | |
| 54 | <refsect1> |
| 55 | <title>Examples</title> |
| 56 | <para> |
| 57 | Here is an example of the use of the <emphasis>pvsbuffer</emphasis> opcode. It uses the file <ulink url="examples/pvsbuffer.csd"><citetitle>pvsbuffer.csd</citetitle></ulink>. |
| 58 | <example> |
| 59 | <title>Example of the <emphasis>pvsbuffer</emphasis> opcode.</title> |
| 60 | <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> |
| 61 | <xi:include href="examples-xml/pvsbuffer.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 62 | </example> |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | |
| 66 | <refsect1> |
| 67 | <title>See also</title> |
| 68 | <para><link linkend="SpectralRealTime"><citetitle>Tools for Real-time Spectral Processing (pvs opcodes)</citetitle></link></para> |
| 69 | </refsect1> |
| 70 | |
| 71 | <refsect1> |
| 72 | <title>Credits</title> |
| 73 | <para> |
| 74 | <simplelist> |
| 75 | <member>Author: &namevictor;</member> |
| 76 | <member>July 2007</member> |
| 77 | </simplelist> |
| 78 | </para> |
| 79 | |
| 80 | </refsect1> |
| 81 | </refentry> |