2022-04-12 22:02:59 -03:00
|
|
|
<!DOCTYPE html>
|
2022-04-12 21:54:18 -03:00
|
|
|
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
|
|
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
|
|
* with significant contributions from:
|
|
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
2022-04-12 22:02:59 -03:00
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
|
2022-04-12 21:54:18 -03:00
|
|
|
<TITLE>Control operations in Pd</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Control operations in Pd">
|
|
|
|
<META NAME="keywords" CONTENT="book">
|
|
|
|
<META NAME="resource-type" CONTENT="document">
|
|
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
|
|
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
|
|
|
|
<LINK REL="STYLESHEET" HREF="book.css">
|
|
|
|
|
|
|
|
<LINK REL="next" HREF="node50.html">
|
|
|
|
<LINK REL="previous" HREF="node48.html">
|
|
|
|
<LINK REL="up" HREF="node40.html">
|
|
|
|
<LINK REL="next" HREF="node50.html">
|
|
|
|
</HEAD>
|
|
|
|
|
|
|
|
<BODY >
|
|
|
|
<!--Navigation Panel-->
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1273"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node50.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="next.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1267"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node40.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="up.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1261"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node48.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="prev.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1269"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">
|
|
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="contents.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1271"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">
|
|
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="index.png"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<BR>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Next:</B> <A ID="tex2html1274"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node50.html">Examples</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Up:</B> <A ID="tex2html1268"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node40.html">Audio and control computations</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Previous:</B> <A ID="tex2html1262"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node48.html">Operations on control streams</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1270"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">Contents</A></B>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1272"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">Index</A></B>
|
|
|
|
<BR>
|
|
|
|
<BR>
|
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
|
2022-04-12 23:32:40 -03:00
|
|
|
<H1><A ID="SECTION00790000000000000000">
|
2022-04-12 21:54:18 -03:00
|
|
|
Control operations in Pd</A>
|
|
|
|
</H1>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
So far we have used Pd mostly for processing audio signals, although as early
|
|
|
|
as Figure <A HREF="node16.html#fig01.10">1.10</A> we have had to make the distinction between Pd's
|
|
|
|
notion of audio signals and of control streams: thin connections carry
|
|
|
|
control streams and thick ones carry audio. Control streams in Pd appear
|
|
|
|
as sequences of
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3697"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>messages</I>. The messages may contain data (most often, one or more
|
|
|
|
numbers), or not. A
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3699"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>numeric control stream</I>
|
|
|
|
(Section <A HREF="node43.html#sect3.controlstreams">3.3</A>) appears as a (thin) connection that
|
|
|
|
carries numbers as messages.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Messages not containing data make up <I>time sequences</I>. So that you can
|
2022-04-12 23:17:03 -03:00
|
|
|
see messages with no data, in Pd they are given the (arbitrary) symbol "bang".
|
2022-04-12 21:54:18 -03:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2022-04-12 23:32:40 -03:00
|
|
|
<DIV ALIGN="CENTER"><A ID="fig03.12"></A><A ID="3705"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<TABLE>
|
|
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 3.12:</STRONG>
|
|
|
|
The four control operations in Pd: (a) delay; (b) merging;
|
|
|
|
(c) pruning; (d) resynchronizing.</CAPTION>
|
|
|
|
<TR><TD><IMG
|
|
|
|
WIDTH="332" HEIGHT="224" BORDER="0"
|
|
|
|
SRC="img337.png"
|
|
|
|
ALT="\begin{figure}\psfig{file=figs/fig03.12.ps}\end{figure}"></TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
</DIV>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
The four types of control operations described in the previous section can
|
|
|
|
be expressed in Pd as shown in Figure <A HREF="#fig03.12">3.12</A>.
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3709"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>Delays</I>
|
|
|
|
are accomplished
|
|
|
|
using two explicit delay objects:
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{del}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="45" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img338.png"
|
|
|
|
ALT="\fbox{ $\mathrm{del}$\ }">,
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{delay}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="61" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img339.png"
|
|
|
|
ALT="\fbox{ $\mathrm{delay}$\ }">:
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3843"></A>simple delay. You can specify the delay time in a creation argument or via
|
2022-04-12 23:17:03 -03:00
|
|
|
the right inlet. A "bang" in the left inlet sets the delay, which then outputs
|
|
|
|
"bang" after the specified delay in milliseconds. The delay is <I>simple</I>
|
2022-04-12 21:54:18 -03:00
|
|
|
in the sense that sending a bang to an already set delay resets it to a new
|
|
|
|
output time, canceling the previously scheduled one.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{pipe}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="54" HEIGHT="40" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img340.png"
|
|
|
|
ALT="\fbox{ $\mathrm{pipe}$\ }">:
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3844"></A>compound delay. Messages coming in the left inlet appear on the output
|
2022-04-12 21:54:18 -03:00
|
|
|
after the specified delay, which is set by the first creation argument. If
|
|
|
|
there are more creation arguments, they specify one or more inlets for numeric
|
|
|
|
or symbolic data the messages will contain. Any number of messages may be
|
|
|
|
stored by <TT>pipe</TT> simultaneously, and messages may be reordered as
|
|
|
|
they are output depending on the various delay times given for them.
|
|
|
|
|
|
|
|
<P>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3721"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>Merging</I>
|
|
|
|
of control streams in Pd is accomplished not by explicit objects
|
|
|
|
but by Pd's connection mechanism itself. This is shown in part (b) of the
|
|
|
|
figure with number boxes as an example. In general, whenever more than one
|
|
|
|
connection is made to a control inlet, the control streams are merged.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Pd offers several objects for
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3723"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>pruning</I> control streams, of which two are shown in part (c) of the
|
|
|
|
figure:
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{moses}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="65" HEIGHT="33" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img341.png"
|
|
|
|
ALT="\fbox{ $\mathrm{moses}$\ }">:
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3845"></A>prune for numeric range. Numeric messages coming in the left inlet
|
2022-04-12 21:54:18 -03:00
|
|
|
appear on the left output if they are smaller than a threshold value (set
|
|
|
|
by a creation argument or by the right inlet), and out the right inlet
|
|
|
|
otherwise.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{select}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="63" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img342.png"
|
|
|
|
ALT="\fbox{ $\mathrm{select}$\ }">,
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{sel}$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="42" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img343.png"
|
|
|
|
ALT="\fbox{ $\mathrm{sel}$\ }">:
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3846"></A>prune for specific numbers. Numeric messages coming in the left inlet produce
|
2022-04-12 23:17:03 -03:00
|
|
|
a "bang" on the output only if they match a test value exactly. The test
|
2022-04-12 21:54:18 -03:00
|
|
|
value is set either by creation argument or from the right inlet.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Finally, Pd takes care of
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="3734"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<I>resynchronizing</I>
|
|
|
|
control streams implicitly in its connection mechanism, as illustrated by part
|
|
|
|
(d) of the figure. Most objects with more than one inlet synchronize all other
|
|
|
|
inlets to the leftmost one. So the <TT>float</TT> object shown in the figure
|
|
|
|
resynchronizes its right-hand-side inlet (which takes numbers) to its
|
2022-04-12 23:17:03 -03:00
|
|
|
left-hand-side one. Sending a "bang" to the left inlet outputs the most
|
2022-04-12 21:54:18 -03:00
|
|
|
recent number <TT>float</TT> has received beforehand.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
|
|
<!--Navigation Panel-->
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1273"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node50.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="next.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1267"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node40.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="up.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1261"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node48.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="prev.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1269"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">
|
|
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="contents.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1271"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">
|
|
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="index.png"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<BR>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Next:</B> <A ID="tex2html1274"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node50.html">Examples</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Up:</B> <A ID="tex2html1268"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node40.html">Audio and control computations</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Previous:</B> <A ID="tex2html1262"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node48.html">Operations on control streams</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1270"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">Contents</A></B>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1272"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">Index</A></B>
|
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
<ADDRESS>
|
|
|
|
Miller Puckette
|
|
|
|
2006-12-30
|
|
|
|
</ADDRESS>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|