<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>pcount</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="pconvolve.html" title="pconvolve" /> <link rel="next" href="pdclip.html" title="pdclip" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">pcount</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="pconvolve.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="pdclip.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="pcount"> <a id="pcount"></a> <div class="titlepage"></div> <a id="IndexPcount" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">pcount</span> </h2> <p>pcount — Returns the number of pfields belonging to a note event. </p> </div> <div class="refsect1" title="Description"> <a id="id3094950"></a> <h2>Description</h2> <p> <span class="emphasis"><em>pcount</em></span> returns the number of pfields belonging to a note event. </p> </div> <div class="refsect1" title="Syntax"> <a id="id3095573"></a> <h2>Syntax</h2> <pre class="synopsis">icount <span class="command"><strong>pcount</strong></span></pre> </div> <div class="refsect1" title="Initialization"> <a id="id3095590"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>icount</em></span> - stores the number of pfields for the current note event. </p> <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table border="0" summary="Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"> <img alt="[Note]" src="images/note.png" /> </td> <th align="left">Note</th> </tr> <tr> <td align="left" valign="top"> <p> Note that the reported number of pfields is not necessarily what's explicitly written in the score, but the pfields available to the instrument through mechanisms like <a class="link" href="ScoreTop.html#ScoreCarry" title="Carry"><em class="citetitle">pfield carry</em></a>. </p> </td> </tr> </table> </div> </div> <div class="refsect1" title="Examples"> <a id="id3095628"></a> <h2>Examples</h2> <p> Here is an example of the pcount opcode. It uses the file <a class="ulink" href="examples/pcount.csd" target="_top"><em class="citetitle">pcount.csd</em></a>. </p> <div class="example"> <a id="id3095643"></a> <p class="title"> <b>Example 425. Example of the pcount opcode.</b> </p> <div class="example-contents"> <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> <span class="comment">; Select audio/midi flags here according to platform</span> <span class="comment">; Audio out Audio in No messages MIDI in</span> -odac -iadc <span class="comment">; -d -M0 ;;;RT audio I/O with MIDI in</span> <span class="comment">; For Non-realtime ouput leave only the line below:</span> <span class="comment">;-o pcount.wav -W ;;; for file output any platform</span> <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></span> <span class="comment">;Example by Anthony Kozar Dec 2006</span> <span class="oblock">instr</span> 1 inum <span class="opc">pcount</span> <span class="opc">print</span> inum <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">i</span>1 0 3 4 5 <span class="comment">; has 5 pfields</span> <span class="stamnt">i</span>1 1 3 <span class="comment">; has 5 due to carry</span> <span class="stamnt">i</span>1 2 3 4 5 6 7 <span class="comment">; has 7</span> <span class="stamnt">e</span> <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> </p> <p> The example will produce the following output: </p> <pre class="screen"> SECTION 1: new alloc for instr 1: WARNING: instr 1 uses 3 p-fields but is given 5 instr 1: inum = 5.000 B 0.000 .. 1.000 T 1.000 TT 1.000 M: 0.0 new alloc for instr 1: WARNING: instr 1 uses 3 p-fields but is given 5 instr 1: inum = 5.000 B 1.000 .. 2.000 T 2.000 TT 2.000 M: 0.0 new alloc for instr 1: WARNING: instr 1 uses 3 p-fields but is given 7 instr 1: inum = 7.000 </pre> <p> The warnings occur because pfields are not used explicitly by the instrument. </p> </div> <div class="refsect1" title="See Also"> <a id="id3095704"></a> <h2>See Also</h2> <p> <a class="link" href="pindex.html" title="pindex"><em class="citetitle">pindex</em></a> </p> </div> <div class="refsect1" title="Credits"> <a id="id3095723"></a> <h2>Credits</h2> <p>Example by: Anthony Kozar</p> <p>Dec. 2006</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="pconvolve.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="pdclip.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">pconvolve </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> pdclip</td> </tr> </table> </div> </body> </html>