<?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>push</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="puts.html" title="puts" /> <link rel="next" href="push_f.html" title="push_f" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">push</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="puts.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="push_f.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="push"> <a id="push"></a> <div class="titlepage"></div> <a id="Indexpush" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">push</span> </h2> <p>push — Pushes a value into the global stack. </p> </div> <div class="refsect1" title="Description"> <a id="id3119027"></a> <h2>Description</h2> <p> Pushes a value into the global stack. </p> </div> <div class="refsect1" title="Syntax"> <a id="id3119044"></a> <h2>Syntax</h2> <pre class="synopsis"><span class="command"><strong>push</strong></span> xval1, [xval2, ... , xval31]</pre> <pre class="synopsis"><span class="command"><strong>push</strong></span> ival1, [ival2, ... , ival31]</pre> </div> <div class="refsect1" title="Initialization"> <a id="id3119072"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>ival1 ... ival31 </em></span> - values to be pushed into the stack. </p> </div> <div class="refsect1" title="Performance"> <a id="id3119086"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>xval1 ... xval31 </em></span> - values to be pushed into the stack. </p> <p> The given values are pushed into the global stack as a bundle. The global stack works in LIFO order: after multiple <a class="link" href="push.html" title="push"><em class="citetitle">push</em></a> calls, <a class="link" href="pop.html" title="pop"><em class="citetitle">pop</em></a> should be used in reverse order. </p> <p> Each <span class="emphasis"><em>push</em></span> or <a class="link" href="pop.html" title="pop"><em class="citetitle">pop</em></a> operation can work on a "bundle" of multiple variables. When using <a class="link" href="pop.html" title="pop"><em class="citetitle">pop</em></a>, the number, type, and order of items must match those used by the corresponding <span class="emphasis"><em>push</em></span>. That is, after a 'push Sfoo, ibar', you must call something like 'Sbar, ifoo pop', and not e.g. two separate 'pop' statements. </p> <p> <span class="emphasis"><em>push</em></span> and <a class="link" href="pop.html" title="pop"><em class="citetitle">pop</em></a> opcodes can take variables of any type (i-, k-, a- and strings). Use of any combination of i, k, a, and S types is allowed. Variables of type 'a' and 'k' are passed at performance time only, while 'i' and 'S' are passed at init time only. </p> <p> push/pop for a, k, i, and S types copy data by value. By contrast, <a class="link" href="push_f.html" title="push_f"><em class="citetitle">push_f</em></a> only pushes a "reference" to the f-signal, and then the corresponding <a class="link" href="pop_f.html" title="pop_f"><em class="citetitle">pop_f</em></a> will copy directly from the original variable to its output signal. For this reason, changing the source f-signal of <a class="link" href="push_f.html" title="push_f"><em class="citetitle">push_f</em></a> before <a class="link" href="pop_f.html" title="pop_f"><em class="citetitle">pop_f</em></a> is called is not recommended, and if the instrument instance owning the variable that was passed by push_f is deactivated before pop_f is called, undefined behavior may occur. </p> <p> Any stack errors (trying to push when there is no more space, or pop from an empty stack, inconsistent number or type of arguments, etc.) are fatal and terminate performance. </p> </div> <div class="refsect1" title="See also"> <a id="id3120058"></a> <h2>See also</h2> <p> <a class="link" href="stack.html" title="stack"><em class="citetitle">stack</em></a>, <a class="link" href="pop.html" title="pop"><em class="citetitle">pop</em></a>, <a class="link" href="pop_f.html" title="pop_f"><em class="citetitle">pop_f</em></a> and <a class="link" href="push_f.html" title="push_f"><em class="citetitle">push_f</em></a>. </p> </div> <div class="refsect1" title="Credits"> <a id="id3120099"></a> <h2>Credits</h2> <p>By: Istvan Varga.</p> <p>2006</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="puts.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="push_f.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">puts </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> push_f</td> </tr> </table> </div> </body> </html>