| 1 | |
| 2 | <refentry id="puts"> |
| 3 | <indexterm id="Indexputs"><primary>puts</primary></indexterm> |
| 4 | <refentryinfo><title>Strings:Manipulation</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>puts</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>puts</refname> |
| 13 | <refpurpose> |
| 14 | Print a string constant or variable |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | puts prints a string with an optional newline at the end whenever the trigger signal is positive and changes. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>puts</command> Sstr, ktrig[, inonl]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>Sstr</emphasis> -- string to be printed |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>inonl</emphasis> (optional, defaults to 0) -- if non-zero, disables the default printing of a newline character at the end of the string |
| 38 | </para> |
| 39 | </refsect1> |
| 40 | |
| 41 | <refsect1> |
| 42 | <title>Performance</title> |
| 43 | <para> |
| 44 | <emphasis>ktrig</emphasis> -- trigger signal, should be valid at i-time. The string is printed at initialization time if ktrig is positive, and at performance time whenever ktrig is both positive and different from the previous value. Use a constant value of 1 to print once at note initialization. |
| 45 | </para> |
| 46 | </refsect1> |
| 47 | |
| 48 | <refsect1> |
| 49 | <title>Examples</title> |
| 50 | <para> |
| 51 | Here is an example of the puts opcode. It uses the file <ulink url="examples/puts.csd"><citetitle>puts.csd</citetitle></ulink>. |
| 52 | <example> |
| 53 | <title>Example of the puts opcode.</title> |
| 54 | <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> |
| 55 | <xi:include href="examples-xml/puts.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 56 | </example> |
| 57 | Its output should include lines like these: |
| 58 | <screen> |
| 59 | frequency in Hertz : 440 |
| 60 | frequency in Hertz : 441 |
| 61 | frequency in Hertz : 442 |
| 62 | .... |
| 63 | frequency in Hertz : 459 |
| 64 | frequency in Hertz : 460 </screen> |
| 65 | </para> |
| 66 | </refsect1> |
| 67 | |
| 68 | <refsect1> |
| 69 | <title>See Also</title> |
| 70 | <para><link linkend="stringmanipulate"><citetitle></citetitle>String Manipulation Opcodes</link></para> |
| 71 | </refsect1> |
| 72 | |
| 73 | <refsect1> |
| 74 | <title>Credits</title> |
| 75 | <para> |
| 76 | <simplelist> |
| 77 | <member>Author: Istvan Varga</member> |
| 78 | <member>2005</member> |
| 79 | </simplelist> |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | </refentry> |