- Reestructuración de ficheros y directorios general
- merge v0.01 --> Añadido fileselector - Añadidas fuentes de Gem y Pure Data - pix2jpg incluído en Gem. Archivos de construcción de Gem modificados. - Añadido fichero ompiling.txt con instrucciones de compilación
23
pd-0.44-2/doc/1.manual/1.introduction.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
PD_VERSION
|
||||
|
||||
A real-time graphical programming environment for live interactive
|
||||
computer music, Pd works on Linux, Macintosh OSX, and Microsoft Windows.
|
||||
|
||||
Pd is copyrighted, but is free for you to use for any reasonable purpose.
|
||||
See the file:
|
||||
PD_BASEDIR/LICENSE.txt
|
||||
|
||||
Reference documentation for Pd lives in:
|
||||
file:PD_BASEDIR/doc/1.manual/index.htm
|
||||
or:
|
||||
http://www.crca.ucsd.edu/~msp/Pd_documentation/index.htm
|
||||
|
||||
More extensive FLOSS documentation is available on:
|
||||
http://en.flossmanuals.net/PureData/ (English)
|
||||
http://fr.flossmanuals.net/PureData/ (Francais)
|
||||
|
||||
Information of all sorts (guides, development, meetings, etc):
|
||||
http://puredata.org
|
||||
|
||||
The Pd mailing list archive lives in:
|
||||
http://iem.at/mailinglists/pd-list/
|
BIN
pd-0.44-2/doc/1.manual/fig1.1.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
pd-0.44-2/doc/1.manual/fig1.2.jpg
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
pd-0.44-2/doc/1.manual/fig1.3.jpg
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
pd-0.44-2/doc/1.manual/fig1.4.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
pd-0.44-2/doc/1.manual/fig1.5.jpg
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
pd-0.44-2/doc/1.manual/fig11.1.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
pd-0.44-2/doc/1.manual/fig11.2.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig11.3.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
pd-0.44-2/doc/1.manual/fig11.4.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.1.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.10.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.2.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.3.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.4.jpg
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.5.jpg
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.6.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.7.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.8.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig3.9.jpg
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.1.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.2.jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.3.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.4.jpg
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.5.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
pd-0.44-2/doc/1.manual/fig7.6.jpg
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.1.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.2.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.3.jpg
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.4.jpg
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.5.jpg
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
pd-0.44-2/doc/1.manual/fig8.6.jpg
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
pd-0.44-2/doc/1.manual/fig9.1.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
pd-0.44-2/doc/1.manual/fig9.2.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
pd-0.44-2/doc/1.manual/fig9.3.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
165
pd-0.44-2/doc/1.manual/index.htm
Normal file
|
@ -0,0 +1,165 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Pd Documentation</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<link rel="stylesheet" type="text/css" href="pdmanual.css" media="screen">
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Pd Documentation</H1>
|
||||
|
||||
<P>
|
||||
This is the HTML documentation for Pd, a patchable environment for audio
|
||||
analysis, synthesis, and processing,
|
||||
with a rich set of multimedia capabilities. The latest version of this page
|
||||
can be found at:
|
||||
<a href="http://www.crca.ucsd.edu/~msp/software.html" name=s1>
|
||||
http://www.crca.ucsd.edu/~msp/software.html</A> .
|
||||
<OL>
|
||||
<LI> <a href="x1.htm" name=s1>introduction </A>
|
||||
<OL>
|
||||
<LI> <a href="x1.htm#s1">guide to the documentation </A>
|
||||
<LI> <a href="x1.htm#s2">other resources </A>
|
||||
</OL>
|
||||
|
||||
<LI> <A href="x2.htm" name=s2>theory of operation </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s1"> overview </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s1.1"> main window, canvases, and printout </A>
|
||||
<LI> <A href="x2.htm#s1.2"> object boxes </A>
|
||||
<LI> <A href="x2.htm#s1.3"> message and GUI boxes </A>
|
||||
<LI> <A href="x2.htm#s1.4"> patches and files </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s2"> how to edit patches </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s2.1"> edit and run mode </A>
|
||||
<LI> <A href="x2.htm#s2.2"> creating boxes </A>
|
||||
<LI> <A href="x2.htm#s2.3"> the selection </A>
|
||||
<LI> <A href="x2.htm#s2.4"> deleting, cutting, and pasting </A>
|
||||
<LI> <A href="x2.htm#s2.5"> changing the text </A>
|
||||
<LI> <A href="x2.htm#s2.6"> connecting and disconnecting boxes </A>
|
||||
<LI> <A href="x2.htm#s2.7"> properties and help </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s3"> messages </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s3.1"> anatomy of a message </A>
|
||||
<LI> <A href="x2.htm#s3.2"> depth first message passing </A>
|
||||
<LI> <A href="x2.htm#s3.3">
|
||||
hot and cold inlets and right to left outlet order </A>
|
||||
<LI> <A href="x2.htm#s3.4"> message boxes </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s4"> audio signals </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s4.1"> sample rate and format </A>
|
||||
<LI> <A href="x2.htm#s4.2"> tilde objects and audio connections </A>
|
||||
<LI> <A href="x2.htm#s4.3"> converting to and from messages </A>
|
||||
<LI> <A href="x2.htm#s4.4"> switching and blocking </A>
|
||||
<LI> <A href="x2.htm#s4.5"> nonlocal signal connections </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s5"> scheduling </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s5.1"> audio and messages </A>
|
||||
<LI> <A href="x2.htm#s5.2"> computation load </A>
|
||||
<LI> <A href="x2.htm#s5.3"> determinism </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s6"> semantics </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s6.1"> creation of objects </A>
|
||||
<LI> <A href="x2.htm#s6.2"> persistence of data </A>
|
||||
<LI> <A href="x2.htm#s6.3"> message passing </A>
|
||||
<LI> <A href="x2.htm#s6.4"> inlets and lists </A>
|
||||
<LI> <A href="x2.htm#s6.5"> dollar signs </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s7"> subpatches </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s7.1"> abstractions </A>
|
||||
<LI> <A href="x2.htm#s7.2"> graph-on-parent subpatches </A>
|
||||
</OL>
|
||||
<LI> <A href="x2.htm#s8"> numeric arrays </A>
|
||||
<LI> <A href="x2.htm#s9"> data structures </A>
|
||||
<OL>
|
||||
<LI> <A href="x2.htm#s9.1"> traversal </A>
|
||||
<LI> <A href="x2.htm#s9.2"> accessing and changing data </A>
|
||||
<LI> <A href="x2.htm#s9.3"> editing </A>
|
||||
<LI> <A href="x2.htm#s9.4"> limitations </A>
|
||||
</OL>
|
||||
|
||||
</OL>
|
||||
|
||||
<LI> <a href="x3.htm" name=s3> getting Pd to run </A>
|
||||
<OL>
|
||||
<LI> <a href="x3.htm#s1.0"> audio and MIDI </A>
|
||||
<LI> <a href="x3.htm#s1.1">installing Pd in Microsoft Windows </A>
|
||||
<LI> <a href="x3.htm#s1.2">installing Pd in Linux </A>
|
||||
<LI> <a href="x3.htm#s1.3">installing Pd in MacOS X </A>
|
||||
<LI> <a href="x3.htm#s1.4">installing Pd in IRIX (SGI) </A>
|
||||
<LI> <a href="x3.htm#s4"> preferences and startup options </A>
|
||||
<LI> <a href="x3.htm#s5"> how Pd searches for files </A>
|
||||
</OL>
|
||||
<LI> <a href="x4.htm" name=s4> writing Pd objects in C </A>
|
||||
|
||||
<LI> <a href="x5.htm" name=s5> current status </A>
|
||||
<OL>
|
||||
<LI> <a href="x5.htm#s1"> release notes </A>
|
||||
<LI> <a href="x5.htm#s2"> known bugs </A>
|
||||
<LI> <a href="x5.htm#s3"> differences from Max/MSP </A>
|
||||
</OL>
|
||||
|
||||
</OL>
|
||||
|
||||
<!--
|
||||
intro: what Pd is
|
||||
guide to the documentation
|
||||
other resources
|
||||
|
||||
Theory of operation
|
||||
main window and canvases
|
||||
messages
|
||||
signals
|
||||
loading, editing, and saving patches
|
||||
subpatches
|
||||
one-off and abstractions
|
||||
blocking for signals
|
||||
data
|
||||
|
||||
Making Pd work
|
||||
how to get and install Pd
|
||||
IRIX
|
||||
NT
|
||||
Linux
|
||||
audio
|
||||
testing it
|
||||
the scheduler advance
|
||||
IRIX
|
||||
NT
|
||||
Linux
|
||||
GEM
|
||||
getting it
|
||||
running it
|
||||
running Pd patches
|
||||
command line options
|
||||
opening & saving files
|
||||
editing
|
||||
file stuff
|
||||
the path
|
||||
abstractions
|
||||
externs
|
||||
the help feature
|
||||
Writing Pd objects in C
|
||||
release notes
|
||||
features
|
||||
bugs
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
39
pd-0.44-2/doc/1.manual/pdmanual.css
Normal file
|
@ -0,0 +1,39 @@
|
|||
|
||||
HTML {
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
font-family: Times, Times New Roman, serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
BODY {
|
||||
width: 6.5in;
|
||||
margin-left: 0.5in
|
||||
}
|
||||
H1 {
|
||||
font-size: 36pt;
|
||||
text-align: center;
|
||||
}
|
||||
H2 {
|
||||
font-size: 10pt;
|
||||
text-align: center;
|
||||
}
|
||||
H3 {
|
||||
font-size: 12pt;
|
||||
text-align: left;
|
||||
}
|
||||
H4 {
|
||||
font-size: 10pt;
|
||||
text-align: left;
|
||||
}
|
||||
H5 {
|
||||
font-size: 8pt;
|
||||
text-align: left;
|
||||
}
|
||||
H6 {
|
||||
font-size: 8pt;
|
||||
text-align: left;
|
||||
}
|
||||
PRE {
|
||||
font-size: 8pt;
|
||||
text-align: left;
|
||||
}
|
108
pd-0.44-2/doc/1.manual/x1.htm
Normal file
|
@ -0,0 +1,108 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Pd Documentation 1</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<link rel="stylesheet" type="text/css" href="pdmanual.css" media="screen">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H2>Pd Documentation chapter 1: introduction</H2>
|
||||
|
||||
<P>
|
||||
<A href="index.htm#s1"> back to table of contents </A>
|
||||
<BR><BR>
|
||||
</P>
|
||||
|
||||
|
||||
<P>
|
||||
This is the HTML documentation for the Pd computer program.
|
||||
Pd is free and can be downloaded from the internet;
|
||||
go to
|
||||
<A href="http://www.crca.ucsd.edu/~msp/software.html">
|
||||
http://www.crca.ucsd.edu/~msp/software.html</A>
|
||||
to get it.
|
||||
<H3> <A name=s1> 1.1. guide to the documentation </A> </H3>
|
||||
|
||||
<P> Pd's documentation consists of:
|
||||
|
||||
<UL>
|
||||
<LI> this HTML manual
|
||||
<LI> "reference" patches, one for each kind of object in Pd
|
||||
<LI> "example" patches showing how to do things
|
||||
<LI> sample C code
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
This manual has five sections:
|
||||
|
||||
<OL>
|
||||
<LI> this overview
|
||||
<LI> <A href="x2.htm">
|
||||
a theory of operations, explaining how Pd works </A>
|
||||
<LI> <A href="x3.htm">
|
||||
instructions on installing Pd and getting it to run </A>
|
||||
<LI> <A href="x4.htm"> how to write C extensions to Pd </A>
|
||||
<LI> <A href="x5.htm"> release notes and known bugs </A>
|
||||
</OL>
|
||||
|
||||
<P>
|
||||
For a list of all the objects you can use in Pd, see the text file,
|
||||
"0.INTRO.txt" in the directory, "../5.reference". To get help on any
|
||||
Pd object you can right click on it; or you can browse the help patches
|
||||
by choosing "Browser..." in the Pd help menu and looking in
|
||||
5.reference.
|
||||
|
||||
<P>
|
||||
The example patches are also available from the "Browser..." item
|
||||
in Pd's "help" menu. They appear in subdirectories named
|
||||
"2.control.examples", "3.audio.examples" and "4.fft.examples." Some additional
|
||||
patches in "7.stuff" might also be helpful.
|
||||
|
||||
<P>
|
||||
To get started writing your own C extensions, refer to chapter 4 of this manual.
|
||||
|
||||
<H3> <A name=s2> 1.2. other resources </A> </H3>
|
||||
|
||||
<P> There is a very extensive Pd community web site,
|
||||
<a href="http://www.pure-data.info/"> pure-data.info</a>, which aims to be the
|
||||
central resource for Pd, from documentation and
|
||||
downloads; to forums, member pages, and a patch exchange.
|
||||
|
||||
<P> More documentation is avalable on the Pd FLOSS site:
|
||||
<A href=http://en.flossmanuals.net/PureData/>
|
||||
en.flossmanuals.net/PureData/</A> (English) and
|
||||
<A href=http://fr.flossmanuals.net/PureData/>
|
||||
fr.flossmanuals.net/PureData/</A> (French).
|
||||
|
||||
<P>
|
||||
Most of the interesting news related to Pd shows up on the Pd mailing list,
|
||||
maintained by Iohannes Zmoelnig. To subscribe or browse the archives
|
||||
visit:
|
||||
<A href="http://iem.at/mailinglists/pd-list/">
|
||||
http://iem.at/mailinglists/pd-list/</A>.
|
||||
|
||||
This is the
|
||||
best source of recent information regarding installation problems and bugs. It
|
||||
is perfectly reasonable to post "newbie" questions on this list; alternatively
|
||||
you can contact msp@ucsd.edu for help.
|
||||
|
||||
<P> the Pd Extended package, maintained by Hans-Christophe Steiner, can be
|
||||
downloaded from the <A href=http://sourceforge.net/projects/pure-data/> Pd's
|
||||
sourceforge site </A>. All this and much more is described in detail on <A
|
||||
href="http://puredata.info/"> http://puredata.info/</A>.
|
||||
|
||||
<P> Many extensions to Pd are announced on the mailing list. In particular,
|
||||
for people interested in graphics, there is a 3D graphics rendering package,
|
||||
named GEM, based on OpenGL, written by Mark Danks, adapted to Linux by
|
||||
Guenter Geiger, and now maintained by Iohannes Zmoelnig. You can get
|
||||
it from: <A href="http://iem.at/GEM">http://iem.kug.ac.at/GEM</A>, or by
|
||||
installing Pd Extended.
|
||||
|
||||
<P> Here are some
|
||||
<a href="http://crca.ucsd.edu/~msp/external-links.htm">
|
||||
more external links</A>.
|
||||
</BODY>
|
||||
</HTML>
|
1274
pd-0.44-2/doc/1.manual/x2.htm
Normal file
677
pd-0.44-2/doc/1.manual/x3.htm
Normal file
|
@ -0,0 +1,677 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Pd Documentation 3</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<link rel="stylesheet" type="text/css" href="pdmanual.css" media="screen">
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY>
|
||||
|
||||
<H2>Pd Documentation chapter 3: Getting Pd to run</H2>
|
||||
|
||||
<P>
|
||||
<A href="index.htm#s3"> back to table of contents </A>
|
||||
<BR><BR>
|
||||
</P>
|
||||
|
||||
<P> The following are basic instructions on how to get Pd installed and running
|
||||
on your machine. More details are maintined online on the
|
||||
<A href=http://www.pure-data.info/>pure-data.info</A> site.
|
||||
|
||||
<P>Pd runs under Microsoft Windows, Linux, and MacOS (10.2 or later). How to
|
||||
get Pd up and running depends on your operating system, but the overall strategy
|
||||
is the same. You must first get and install it, and then untangle whatever
|
||||
problems arise in handling audio and MIDI input and output, and finally get Pd
|
||||
to meet its real-time obligations reliably.
|
||||
|
||||
<P> Installation instructions are platform-specfic; the following three
|
||||
sections
|
||||
will describe what to do for various operating systems you might have.
|
||||
In case of trouble also consult the Pd mailing list archive on
|
||||
<A href="http://iem.at/mailinglists/pd-list/">
|
||||
http://iem.at/mailinglists/pd-list/</A>
|
||||
, which often has late-breaking news about configuration problems and solutions.
|
||||
The rest of this section describes how to get audio and MIDI to work.
|
||||
|
||||
<H3> <A name=s1.0> 3.1. Audio and MIDI </A> </H3>
|
||||
|
||||
<P>
|
||||
To test audio and MIDI, start Pd and select "test Audio and MIDI" from the
|
||||
"Media" menu. You should see a window like this:
|
||||
|
||||
<CENTER><P>
|
||||
<IMG src="fig11.1.png" ALT="test tone patch">
|
||||
</P></CENTER>
|
||||
|
||||
<P> First, try to get Pd to play a sine wave over your speakers. The "TEST
|
||||
TONE" control at top left turns this on and off. Normally, all the output
|
||||
channels are turned on so that when you turn the tone on (to a soft -40 dB or a
|
||||
louder -20 dB) you should get output on the first eight of your output channels.
|
||||
(If you have fewer than 8 output channnels open, the extra
|
||||
channels aren't played; and if you have more, this particular patch won't
|
||||
use them.)
|
||||
|
||||
<P> If there's anything wrong, the most likely outcome is that you will hear
|
||||
nothing at all. This could be for any of at least three reasons: Pd might
|
||||
have failed to open the audio device; the audio card's output volume might
|
||||
be set to zero; or your audio system might not be set to amplify the computer
|
||||
output.
|
||||
|
||||
<P> The number boxes labeled "AUDIO INPUT" show the levels of incoming
|
||||
audio, in dB, with 100 being maximum. (Incoming signals may clip at
|
||||
RMS levels below 100; for instance, a sinusoid clips at about 97 dB.)
|
||||
Any DC present in the input (such as you get with cheap audio hardware)
|
||||
will show up as level unless you turn on the "input hipass" toggle
|
||||
at right; then the DC component is filtered out before metering.
|
||||
|
||||
<P> To test the quality of audio input and output, turn on "monitor"
|
||||
(also at right) which causes the inputs to be played to the outputs at
|
||||
unit gain. You should hear a faithful, non-distored copy of whatever is
|
||||
sent through the patch.
|
||||
|
||||
<P> It is easy to get two copies of Pd running by accident; on most machines
|
||||
only one at a time may be inputting and outputting sound. (Some copy of Pd
|
||||
might have audio or MIDI devices open and prevent the copy you're trying to use
|
||||
from getting access to them.) Having extra
|
||||
copies of Pd around will also eat CPU cycles uselessly.
|
||||
|
||||
<P>
|
||||
You may be interested in getting only audio output or audio input, or
|
||||
you may need both to run simultaneously. By default, Pd will try to run
|
||||
both, but if you don't need either input or output, you may find that Pd
|
||||
runs more reliably, or at least more efficiently, with the unused direction
|
||||
turned off. This may be specified in Pd's command line flags or using the
|
||||
"audio settings" dialog panel.
|
||||
|
||||
<P>
|
||||
Depending on your application you will have a more or less stringent latency
|
||||
requirement. Ideally, when any input (audio, MIDI, keyboard, network) is
|
||||
available, the outputs (in particular the audio output) should react instantly.
|
||||
In real life, it is necessary to buffer the audio inputs and outputs, trying
|
||||
always to keep some number of milliseconds ahead of real time to prepare for the
|
||||
inevitable occasions where the CPU runs off to service some different task
|
||||
from Pd. How small this latency can be chosen depends on your OS and your
|
||||
audio driver.
|
||||
|
||||
<P> TIP: If Pd starts up but you get distortion or glitches in the audio
|
||||
output, this could be either because the "audio I/O buffer" isn't big enough,
|
||||
or else because the CPU load of the patch you're running is too great for the
|
||||
machine you have, or else because the ADC and DAC are out of sync or even at
|
||||
different sample rates. To test for the first possibility, try increasing the
|
||||
audio latency in the command line or the "audio settings" dialog (but see also
|
||||
under your OS below.) For the second, start up your favorite performance
|
||||
monitor program; and for the third, try starting Pd up with ADCs disabled.
|
||||
|
||||
<P> In addition to the "test audio and MIDI" patch, the "Media" menu
|
||||
contains items for controlling audio and MIDI settings. The first two
|
||||
items, "Audio on" and "Audio off", open or close the audio devices and
|
||||
start or stop Pd's audio computation.
|
||||
|
||||
<P> If there is a choice of
|
||||
audio API to make, the Media menu will display them. (On Linux, they are
|
||||
OSS, ALSA, and Portaudio; on Windows, you get MMIO and ASIO). On Mac the only
|
||||
one is portaudio. More information
|
||||
about the APIs appears in the sections below.
|
||||
|
||||
<P> Selecting an API (even if it's the one already in use), or, alternatively,
|
||||
selecting "Audio Settings..." from Preferences, opens
|
||||
a dialog panel like this:
|
||||
|
||||
<CENTER><P>
|
||||
<IMG src="fig11.2.png" ALT="audio settings dialog">
|
||||
</P></CENTER>
|
||||
|
||||
The exact choices you get depend on the operating system and API. The sample
|
||||
rate controls both audio output and input. The audio throughput delay is
|
||||
the nominal amount of time, in milliseconds, that a sound coming into the
|
||||
audio input will be delayed if it is copied through Pd straight to the
|
||||
output. Naturally you would like this to be as small as possible, but,
|
||||
depending on OS, API, and even the specific choice of audio hardware, there
|
||||
will be a limit to how small you can make this. You can typically get
|
||||
10 msec on linux (and lower still if you use special tricks), 30 msec on Mac
|
||||
OSX, and 60 msec on Windows (but note that there might be ways that a
|
||||
patient Windows user can reduce this).
|
||||
|
||||
<P> Next you get a choice of input and output device. If you want to open
|
||||
more than one, hit "use multiple devices" and you'll be allowed up to 4
|
||||
in and 4 out. Each audio device is 2 channels by default, but you may
|
||||
specify more if your hardware supports it.
|
||||
|
||||
Other parameters may be tweaked using the command line; see under
|
||||
<A href=#s4> preferences and startup options </A>.
|
||||
|
||||
<H6> MIDI </H6>
|
||||
|
||||
<A> The "channel message" midi objects in Pd
|
||||
such as notein or pgmout will take channels 1-16 to mean the first open MIDI
|
||||
port, 17-32 the second one, and so on. The midiin, sysexin, midiout objects
|
||||
give you a separate inlet to specify which of the open MIDI port numbers
|
||||
you want.
|
||||
|
||||
<P> System exclusive MIDI message input and output are theoretically supported
|
||||
but does not work uniformly across all operating systems..
|
||||
|
||||
<H3> <A name=s1.1> 3.2. Installing Pd in Microsoft Windows </A> </H3>
|
||||
|
||||
<P> Pd should work under any version of Windows since 95. You can download as
|
||||
a self-extracting archive (a ".exe" file). Run this and select a destination
|
||||
directory when prompted, such as "\pd" or "Program Files\pd".
|
||||
|
||||
<P> If for example you put Pd in "C:Program Files\pd", the executable program
|
||||
will be "C:Program Files\pd\bin\pd". You can simply adjust your path to
|
||||
include C:\pd\bin and then invoke "pd" in a command prompt window. You can also
|
||||
make a shortcut to the executable program (left-click on it and drag to the
|
||||
desktop, for example.)
|
||||
|
||||
<P> Pd requires "TCP/IP networking" to be turned on. This doesn't mean you
|
||||
have to be on a real network, but simply that Pd actually consists of two
|
||||
programs that make a "network link" (locally) to intercommunicate.
|
||||
|
||||
<H4> Audio in Microsoft Windows </H4>
|
||||
|
||||
<P>
|
||||
Pd offers both the ASIO and MMIO APIs in Windows. Which of these works better
|
||||
will depend on your audio hardware.
|
||||
|
||||
<P>
|
||||
MIDI timing is very poor if you are using simultaneous audio input and output;
|
||||
if you suppress either audio input or output things will improve somewhat under
|
||||
NT; you can apparently get the jitter down to ~40 msec. On W95 performance is
|
||||
simply terrible. W98, with either audio input or output suppressed, offers
|
||||
fairly good MIDI timing (~5 msec jitter). The "first edition" used to crash
|
||||
occasionally; this might be fixed in the "second edition".
|
||||
|
||||
<H4> ASIO </H4>
|
||||
|
||||
<P> As of version 0.35 Pd supports ASIO. Invoke Pd as "pd -asio" and, if
|
||||
needed, specify "-sounddev" (etc.) flags to specify which device (see
|
||||
"the Pd command line" below.) You can also specify a "-blocksize" different
|
||||
from the default (256 samples) and "-audiobuf" in milliseconds. Pd will
|
||||
round this down to a power of two buffers, each of "-blocksize" in sample
|
||||
frames.
|
||||
|
||||
<P> TIP: Often your machine will allow you to use ASIO with built-in PC
|
||||
audio hardware. Sometimes it is necessary to set a ridiculously high block size
|
||||
for this to work (on my machine I have to set it to 4096 -- about 1/10 of a
|
||||
second!)
|
||||
|
||||
<P> Using MMIO I've been able to get very low latencies (6 msec) using M-audio
|
||||
PCI converters (Delta 44).
|
||||
|
||||
<H3> <A name=s1.2> 3.3. Installing Pd in Linux </A> </H3>
|
||||
|
||||
<P> What to do depends on which flavor of Linux you are running (e.g., Debian
|
||||
or Red Hat). The instructions here should work for Pd 0.33 and up regardless of
|
||||
your situation. (If not, you can read the Pd mailing list archives for
|
||||
recent problems; if you have found a new problem you're welcome to post it
|
||||
to the list.)
|
||||
|
||||
<P> Pd is available via the package systems for some linux distributions,
|
||||
but not always in the most recent version possible. It's relatively easy to
|
||||
compile your own copy of Pd and that is the approach described here.
|
||||
|
||||
<H4> Getting Pd as a .tar.gz </H4>
|
||||
|
||||
<P> Before you start, you might want to check that you have the resources Pd
|
||||
needs. The main things you need are the C compiler, X windows (including
|
||||
the X development package for Pd to link against), TK, and the ALSA "devel"
|
||||
headers. It should be
|
||||
enough to load "tcl-devel", "tk-devel", and "alsa-devel" packages using
|
||||
yum or apt-get.
|
||||
|
||||
<P> There are two parallel compilation setups now available. The old one is
|
||||
described here; as of 0.43 I still use that but I plan to discontinue this for
|
||||
0.44 and start using only the new one (by Hans). The following description
|
||||
applies to the old one. Look in the INSTALL.txt file to see how to use the
|
||||
new one.
|
||||
|
||||
<P>
|
||||
Download Pd, perhaps from
|
||||
<a href="http://www.crca.ucsd.edu/~msp/software.html">
|
||||
http://www.crca.ucsd.edu/~msp/software.html</A> ,
|
||||
to file such as "pd-linux-033.tar.gz". Open a "shell"
|
||||
window, cd to
|
||||
the directory containing the file, and type the command,
|
||||
<PRE>
|
||||
tar xzf pd-linux-033.tar.gz
|
||||
</PRE>
|
||||
<P>which creates a directory named "pd". I do this from my home directory.
|
||||
Next, compile it. "CD" to pd and read the INSTALL.txt, or else just cd
|
||||
to "pd/src" and type
|
||||
|
||||
<P>
|
||||
<BR> ./configure
|
||||
<BR> make
|
||||
</P>
|
||||
|
||||
<P> You can pass flags to "configure" to customize your compilation:
|
||||
|
||||
<PRE>
|
||||
To enable debugging (and losing code optimization) add "--enable-debug".
|
||||
To use Portaudio, add "--enable-portaudio".
|
||||
To put Pd in /usr/bin instead of /usr/local/bin, add "--prefix=/bin".
|
||||
</PRE>
|
||||
|
||||
Alsa and Jack support should auto-configure, but "--enable-alsa" od
|
||||
"--enable-jack" will force their inclusion.
|
||||
|
||||
<P> After "make", just type "~/pd/bin/pd" to run pd.
|
||||
|
||||
<P> Alternatively, as superuser, you can run "make install" after "make depend"
|
||||
and then anyone on your system can just type "pd" to run it.
|
||||
|
||||
<H4> Testing audio and MIDI. </H4>
|
||||
|
||||
<P>
|
||||
Next try audio. We want to know whether audio output works, whether audio
|
||||
input works, and whether they work simultaneously. First run "aumix" (or
|
||||
any newer audio mixer app) to
|
||||
check audio input and output gains and learn which input (mic; line;
|
||||
etc.) is "recording".
|
||||
Then test audio output by running
|
||||
<PRE>
|
||||
pd -noadc
|
||||
</PRE>
|
||||
<P>and selecting "test audio and MIDI" from the "Media" menu. You should see
|
||||
a patch. Turn on the test tone and listen. Do the usual where's-the-signal
|
||||
business.
|
||||
|
||||
<P>
|
||||
Then quit Pd and test audio input via
|
||||
<PRE>
|
||||
pd -nodac
|
||||
</PRE>
|
||||
<P>Re-open the test patch and hit "meter"; look at the levels. 100 dB is a
|
||||
hard clip; arrange gains so that the input signal tops out around 80 or 90,
|
||||
but no higher.
|
||||
|
||||
<P> Now see if your audio driver can do full duplex by typing "pd" with no
|
||||
flags. If you see error messages involving /dev/dsp or /dev/dsp2, you're
|
||||
probably not able to run audio in and out at the same time. If on the other
|
||||
hand there's no complaint, and if the audio test patch does what you want, you
|
||||
might wish to experiment with the "-audiobuffer" flag to see what values of
|
||||
audio latency your audio system can handle.
|
||||
|
||||
<H3> Audio hardware in Linux </H3>
|
||||
|
||||
<P>
|
||||
Installing and testing audio and MIDI drivers in Linux can take
|
||||
days or weeks. There apears to be no single place where you can get detailed
|
||||
information on Linux audio.
|
||||
|
||||
<P>
|
||||
There are two widely-used driver sets, called "OSS" and "ALSA". ALSA is
|
||||
included in the standard Linux kernel since 2.4 or so. However, for some
|
||||
audio cards you can find newer versions than are included in the kernel
|
||||
releases. You can get ALSA from
|
||||
|
||||
<a href="http://www.alsa-project.org/">
|
||||
http://www.alsa-project.org/</A> .
|
||||
|
||||
<P> ALSA is able to emulate OSS, so that you can usually run Pd using the
|
||||
"OSS" driver settings even if it's actually ALSA that's running.
|
||||
|
||||
<P> By default, Pd uses ALSA. You can ask Pd to use ALSA's OSS emulation by
|
||||
adding the "-oss" flag to the command line or fooling with the "media" menu
|
||||
items.
|
||||
|
||||
<P> You can add ALSA devices by name on the Pd command line:
|
||||
<PRE>
|
||||
pd -alsaadd loupgarou
|
||||
</PRE>
|
||||
instructs Pd to offer the 'loupgarou' audio device in the Audio Settings panel.
|
||||
|
||||
<H4> Experiences with particular soudcards </H4>
|
||||
|
||||
<P>
|
||||
Here are some of my own experiences with sound cards so far. See
|
||||
also the Pd mailing list archives.
|
||||
|
||||
<H6> RME 9652 (Hammerfall) </H6>
|
||||
|
||||
<P> This is the best PCI sound card out there; it costs around $500 and has 3 ADAT
|
||||
I/O ports and one SPDIF. There is a "baby hammerfall" also, which I think is
|
||||
the "9632." DO NOT CONFUSE THE 9652/9632 WITH OTHER RME BOARDS WHICH MIGHT
|
||||
NOT WORK WITH PD.
|
||||
|
||||
<P> The easiest way to use
|
||||
Hammerfall boards in Pd is via ALSA and jack; but you can use ALSA alone:
|
||||
<PRE>
|
||||
pd -alsa -channels 26
|
||||
</PRE>
|
||||
works for me.
|
||||
|
||||
<H6> MIDIMAN </H6>
|
||||
|
||||
<P>Midiman sells PCI devices (delta 44, 66, 1010, and 1010LT)
|
||||
with between 4 and 10 channels in and out, for
|
||||
which there are ALSA drivers. These are also very good, and they are a
|
||||
bit cheaper than Hammerfalls. The driver name is "ice1712".
|
||||
|
||||
<H6> USB sound devices</H6>
|
||||
|
||||
<P> Ed Kelly reports success with the Lexicon series of USB 1.0 devices (e.g.,
|
||||
the Omega Studio; apparently 4 channels in and 4 out). Also known to work well
|
||||
is the Edirol box (2 channels in and out).
|
||||
|
||||
<P> As of Sept. 2011, the only multi-channel USB device I've been able to use
|
||||
with Pd is the Native Instruments Traktor Audio series. (I have the Audio
|
||||
Traktor 10 which does indeed get 10 discrete channels in and out; the box is
|
||||
designed for turntables and the I/O is all RCA. I haven't yet tested whether
|
||||
the inputs are RIAA equalized or flat. To run this device you'll need to
|
||||
compile and install an ALSA snapshot from at least September 2011. This won't
|
||||
start showing up in Linux distros for at least some months.
|
||||
|
||||
<P> THe Alsa devel list is reporting progress on the M-audio Ultra series,
|
||||
which goes up to 6 in and out (analog) with 2 more as SP/DIF. Things work
|
||||
OK for input or output separately but "full duplex" (in and out simultaneously)
|
||||
has sync problems.
|
||||
|
||||
<H3> <A name="s1.3"> 3.4. Installing Pd in Macintosh OSX </A> </H3>
|
||||
|
||||
<P>Pd version 0.35 and up support Macintosh OSX. You need the OSX Jaguar
|
||||
distribution (10.2) or later. Recent versions of Pd require 10.4 or up.
|
||||
|
||||
<P> To install Pd you can always download the sources and compile them
|
||||
yourself, or (easier) just download the Mac binary from the download page:
|
||||
|
||||
<A href="http://crca.ucsd.edu/~msp/software.html">
|
||||
http://crca.ucsd.edu/~msp/software.html</A>.
|
||||
|
||||
This is in the form of a compressed Tar archive; just click on it and the Max
|
||||
will extract the Pd application. Open this and you should be running.
|
||||
|
||||
<P> You might get various warnings about Pd trying to open an internet port.
|
||||
This is normal although some system administrators will prevent you from
|
||||
doing this (in which case you can't run Pd on that machine).
|
||||
|
||||
<P> The package by Hans-Christoph Steiner, on
|
||||
|
||||
<A href="http://at.or.at/hans/pd/installers.html">
|
||||
http://at.or.at/hans/pd/installers.html</A>,
|
||||
|
||||
has many updates and extensions
|
||||
which are not included in the original Pd distribution. Download this and
|
||||
follow the (simple) instructions found there.
|
||||
</P>
|
||||
|
||||
<H4> To install on OSX from source: </H4>
|
||||
|
||||
<P>
|
||||
Whether you've downloaded the source or the "package" you can
|
||||
always compile Pd for yourself, whether to make your own improvements, or
|
||||
possibly so that you can get the newest version before it shows up compiled for
|
||||
Mac OS X.
|
||||
|
||||
<P> To be able to compile Pd, you must have Tcl/Tk installed in the standard
|
||||
places. I think this is true for all reasoably recent releases of OSX.
|
||||
|
||||
<P> Then, just as for linux, just unload pd-whatever.tar.gz into a directory
|
||||
such as ~/pd-0.36-0, cd to pd-0.36-0/src, type "./configure"
|
||||
and "make". Then type ~/pd-0.36-0/bin/pd to a shell and enjoy!
|
||||
|
||||
<P> If you wish you can put a line such as,
|
||||
|
||||
<pre>
|
||||
alias pd ~/pd/bin/pd
|
||||
</pre>
|
||||
|
||||
<P>in the file, ~/.tcshrc, so that you can later just type "pd" to a shell.
|
||||
(The
|
||||
shell only reads the ~/.tcshrc file on startup, so this won't take effect in
|
||||
any existing shells unless you specially type
|
||||
<pre>
|
||||
source ~/.tcshrc
|
||||
</pre>
|
||||
<P>to them.)
|
||||
|
||||
<P> Follow the general directions above for testing audio and/or MIDI
|
||||
as needed.
|
||||
|
||||
<P> To get MIDI working, you have to do the Mac OSX magic to get a USB
|
||||
MIDI interface installed. I've seen this done with Midisport devices and
|
||||
I think you just download the OSX driver and follow directions.
|
||||
|
||||
<H3> <A name=s4> 3.6. Preferences and startup options </A> </H3>
|
||||
|
||||
<P> Pd's behavior may be customized to instruct it where to find files, which
|
||||
audio devices to open, what font size to use, and so on. Most of
|
||||
these may also be changed using the various dialogs you can open from Pd's
|
||||
menus. Others take effect only when Pd starts up; some of these appear
|
||||
on the ``startup" dialog and some of them, too cranky to put in a GUI, must
|
||||
be typed as <I> command line arguments </I>.
|
||||
|
||||
<P> In addition to the Audio and MIDI settings (see
|
||||
<A href="#s1.0"> Audio and MIDI </A>), you can customize font size (from the
|
||||
``edit" menu), directories to search for files (see
|
||||
<A href="#s5"> How Pd searches for files </A>), and additional startup
|
||||
parameters described below.
|
||||
|
||||
<P> All of these settings may be saved automatically between Pd sessions.
|
||||
It is also possible to specify settings directly via the <I> command
|
||||
line </I>. (A third mechanism, using configuration files, is deprecated and
|
||||
isn't described here.) The Pd command line is described in the next
|
||||
section. Command line settings, if given, each override the corresponding
|
||||
setting that was saved from Pd.
|
||||
|
||||
<P> The startup settings (i.e., those that take effect only when Pd is started)
|
||||
are controlled using the ``startup..." dialog from the File menu. The
|
||||
dialog appears as follows:
|
||||
|
||||
<CENTER><P>
|
||||
<IMG src="fig11.3.png" ALT="startup dialog">
|
||||
</P></CENTER>
|
||||
|
||||
The slots at top each specify a binary ``library" for Pd to load on startup.
|
||||
These may be for Gem, pdp, zexy, iemlib, cyclone, and so on. Typically, a
|
||||
single binary object (an ``extern") is left for Pd to load automatically;
|
||||
startup library loading is appropriate for collections of many objects
|
||||
specified by a single binary library.
|
||||
|
||||
<P> The ``defeat real-time scheduling" contol, if enabled, makes Pd run without
|
||||
its usual effort to become a real-time process (whatever this means in the
|
||||
operating system you are using.) In Unix, Pd must usually be setuid to allow
|
||||
real-time scheduling at all.
|
||||
|
||||
<P> The ``startup flags" allow you to add to Pd's command line on startup. This
|
||||
is specified as described below, except that the initial word, ``pd", is
|
||||
understood. For example, putting ``-rt" in this field sets real-time
|
||||
scheduling; ``-sleepgrain 1" sets the sleep grain to 1 (see under MIDI below),
|
||||
and typing "-rt -sleepgrain 1" does both.
|
||||
|
||||
<P> You may save the current settings for future Pd sessions with the
|
||||
``save all settings" button; this saves not only the path but all other
|
||||
settings as well.
|
||||
|
||||
<H6> Command line arguments </A> </H3>
|
||||
|
||||
<P>Pd may be run as a "command line" program from your "terminal emulator,"
|
||||
"shell," or "MSDOS prompt." In Windows, if Pd is started using a "shortcut"
|
||||
it is also run from a command line which you can edit using the ``properties"
|
||||
dialog for the shortcut. In any operating system, Pd can be called from a
|
||||
script (called a <I> batch file </I> on Windows or a <I> shell script </I>
|
||||
on OSX or unix). The command line is just a line of text, which should be
|
||||
of the form:
|
||||
|
||||
<PRE>
|
||||
|
||||
pd [options] [patches to open]
|
||||
|
||||
</PRE>
|
||||
|
||||
<P>although you may have to specify a path (such as "~/pd/bin/pd" or
|
||||
"C:\program files\pd\bin\pd") so your command interpreter can find
|
||||
Pd. Possible options include:
|
||||
|
||||
<PRE>
|
||||
|
||||
audio configuration flags:
|
||||
-r <n> -- specify sample rate
|
||||
-audioindev ... -- sound in device list; e.g., "2,1" for second and first
|
||||
-audiooutdev ... -- sound out device list, same as above
|
||||
-audiodev ... -- specify both -audioindev and -audiooutdev together
|
||||
-inchannels ... -- number of audio in channels (by device, like "2" or "16,8")
|
||||
-outchannels ... -- number of audio out channels (by device)
|
||||
-channels ... -- specify both input and output channels
|
||||
-audiobuf <n> -- specify size of audio I/O buffer in msec
|
||||
-blocksize <n> -- specify audio I/O block size in sample frames
|
||||
-sleepgrain <n> -- specify number of milliseconds to sleep when idle
|
||||
-nodac -- suppress audio output
|
||||
-noadc -- suppress audio input
|
||||
-noaudio -- suppress audio input and output (-nosound is synonym)
|
||||
-listdev -- list audio and MIDI devices
|
||||
|
||||
(linux specific audio:)
|
||||
-oss -- use ALSA audio drivers
|
||||
-alsa -- use ALSA audio drivers
|
||||
-pa -- use portaudio (experimental version 19)
|
||||
-alsadev <n> -- obsolete: use -audiodev
|
||||
-32bit -- (probably obsolete) -- use 32 bit OSS extension
|
||||
-alsaadd <dev> -- add a device to the ALSA device list
|
||||
|
||||
(Windows specific audio:)
|
||||
-mmio -- use MMIO drivers and API
|
||||
-asio -- use ASIO drivers and API
|
||||
|
||||
MIDI configuration flags:
|
||||
-midiindev ... -- midi in device list; e.g., "1,3" for first and third
|
||||
-midioutdev ... -- midi out device list, same format
|
||||
-mididev ... -- specify -midioutdev and -midiindev together
|
||||
-nomidiin -- suppress MIDI input
|
||||
-nomidiout -- suppress MIDI output
|
||||
-nomidi -- suppress MIDI input and output
|
||||
-alsamidi -- use ALSA midi API
|
||||
|
||||
general flags:
|
||||
-path <path> -- add to file search path
|
||||
-nostdpath -- don't search standard ("extra") directory
|
||||
-stdpath -- search standard directory (true by default)
|
||||
-helppath <path> -- add to help search path
|
||||
-open <file> -- open file(s) on startup
|
||||
-lib <file> -- load object library(s)
|
||||
-font <n> -- specify default font size in points
|
||||
-verbose -- extra printout on startup and when searching for files
|
||||
-version -- don't run Pd; just print out which version it is
|
||||
-d <n> -- specify debug level
|
||||
-noloadbang -- suppress all loadbangs
|
||||
-stderr -- send printout to standard error instead of GUI
|
||||
-nogui -- suppress starting the GUI
|
||||
-guiport <n> -- connect to pre-existing GUI over port 'n'
|
||||
-guicmd "cmd..." -- substitute another GUI program (e.g., rsh)
|
||||
-send "msg..." -- send a message at startup (after patches are loaded)
|
||||
-rt or -realtime -- use real-time priority (needs root privilege)
|
||||
-nrt -- don't use real-time priority
|
||||
-nosleep -- never relinquish CPU (only for multiprocessors!)
|
||||
|
||||
</PRE>
|
||||
|
||||
<P>Here are some details on some of the audio, MIDI, and scheduler options (but
|
||||
see also the next section on file management.)
|
||||
|
||||
<H4> multiple devices. </H4>
|
||||
|
||||
<P> You can specify multiple MIDI input and output devices. For example,
|
||||
"pd -midiindev 3 -midioutdev 4,2" asks for the third MIDI input device and the
|
||||
fourth and second MIDI output device.
|
||||
|
||||
<P> Audio device selection is similar, except that you can also specify
|
||||
channels by device: "-audioindev 1,3 -inchannels 2,8" will try to open device 1
|
||||
(2 channels) and device 3 (8 channels.)
|
||||
|
||||
<H4> sample rate. </H4>
|
||||
|
||||
<P>The sample rate controls Pd's logical sample rate which need not be that of
|
||||
the audio input and output devices. If Pd's sample rate is wrong, time will
|
||||
flow at the wrong rate and synthetic sounds will be transposed. If the output
|
||||
and input devices are running at different rates, Pd will constantly drop frames
|
||||
to re-sync them, which will sound bad. You can disable input or output if this
|
||||
is a problem.
|
||||
|
||||
<H4> audio buffer size and block size </H4>
|
||||
|
||||
<P>You can specify an audio buffer size in milliseconds, typically between 10 and
|
||||
300, depending on how responsive your OS and drivers are. If this is set too
|
||||
low there will be audio I/O errors ("data late"). The higher the value is,
|
||||
on the other hand, the more throughput delay you will hear from the audio
|
||||
and/or control inputs (MIDI, GUI) and the audio coming out.
|
||||
|
||||
<P> You can also specify the audio block size in sample frames. This is 64 by
|
||||
default (except for MMIO for which it's 256), and may be 64, 128, or 256.
|
||||
|
||||
<H4> MIDI and sleepgrain</H4>
|
||||
|
||||
<P> In Linux, if you
|
||||
ask for "pd -midioutdev 1" for instance, you get /dev/midi0 or /dev/midi00
|
||||
(or even /dev/midi). "-midioutdev 45" would be /dev/midi44. In NT, device
|
||||
number 0 is the "MIDI mapper", which is the default MIDI device you selected
|
||||
from the control panel; counting from one, the device numbers are card
|
||||
numbers as listed by "pd -listdev."
|
||||
|
||||
<P> The "sleepgrain" controls how long (in milliseconds) Pd sleeps between
|
||||
periods of computation. This is normally the audio buffer divided by 4, but
|
||||
no less than 0.1 and no more than 5. On most OSes, ingoing and outgoing MIDI
|
||||
is quantized to this value, so if you care about MIDI timing, reduce this to 1
|
||||
or less.
|
||||
|
||||
<H3> <A name="s5"> 3.7. How Pd searches for files </A> </H3>
|
||||
|
||||
<P>Pd has a search path feature; you specify the path on the command line
|
||||
using the "-path" option. Paths may contain any number of files. If you
|
||||
specify several files in a single "-path" option they're separated by colons
|
||||
in unix or semicolons in NT.
|
||||
|
||||
<P> You can see and edit the path while Pd is running using the "path..."
|
||||
item in the "File" menu:
|
||||
|
||||
<CENTER><P>
|
||||
<IMG src="fig11.4.png" ALT="startup dialog">
|
||||
</P></CENTER>
|
||||
|
||||
<P> The path must be correctly set before you load
|
||||
a patch or it may fail to find abstractions, etc., that are needed to
|
||||
construct the patch. When Pd searches for an abstraction or an
|
||||
"extern" it uses the path to try to find the necessary file. The "read"
|
||||
messages to qlists and arrays (aka tables) do this too.
|
||||
|
||||
<P> If ``use standard extensions" is enabled, the usual ``extras" directory
|
||||
is also searched. This contains standard external objects like ``expr" and
|
||||
``fiddle", and perhaps much more depending on the distribution of Pd
|
||||
you're using.
|
||||
|
||||
<P> You may save the current settings for future Pd sessions with the
|
||||
``save all settings" button; this saves not only the path but all other
|
||||
settings as well.
|
||||
|
||||
<P> Path entries may be relative to the patch directory; for instance,
|
||||
if your path has an item, "../sound", and your patch is in "my stuff/all mine",
|
||||
then Pd will look in "my stuff/sound". Spaces should be OK in the path to
|
||||
the patch, but not in the path entry (../sound) itself. This is useful if
|
||||
you have a patch and supporting files (even a supporting snapshot of pd)
|
||||
that you want to distribute or carry around together.
|
||||
|
||||
<P> Regardless of path, Pd should look first in the directory containing
|
||||
the patch before searching down the path. Pd does not automatically look
|
||||
in the <I> current directory </I> however; to enable that, include ``." in
|
||||
the path. The ``extra" directory, if enabled, is searched last.
|
||||
|
||||
<P> Filenames in Pd are always separated by (unix-style) forward slashes, even
|
||||
if you're on Windows (which uses backslashes). This is so that patches can be
|
||||
ported more easily between operating systems. On the other hand, if you
|
||||
specify a filename on the command line (as in "pd -path c:\pdlib") the file
|
||||
separator should agree with the operating system. <BR>
|
||||
|
||||
<P> If a filename specified in a patch has any "/" characters in it, the "path"
|
||||
is not used; thus, "../sounds/sample1.wav" causes Pd only to look relative to
|
||||
the directory containing the patch. You may also invoke externs that way.
|
||||
|
||||
<P> As of version 0.35, there may be spaces in the path to Pd itself; also,
|
||||
the "openpanel" and "savepanel" objects can handle spaces. Spaces in the
|
||||
path should work as of version 0.38.
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
|
61
pd-0.44-2/doc/1.manual/x4.htm
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Pd Documentation 4</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<link rel="stylesheet" type="text/css" href="pdmanual.css" media="screen">
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY>
|
||||
|
||||
<H2>Pd Documentation chapter 4: writing Pd objects in C</H2>
|
||||
|
||||
<P>
|
||||
<A href="index.htm#s4"> back to table of contents </A>
|
||||
<BR><BR>
|
||||
</P>
|
||||
|
||||
<P>You can write your own objects that you and others can use in their Pd
|
||||
applications. You can write them in C or (if you're smart and brave) in C++ or
|
||||
FORTRAN.
|
||||
|
||||
<P> HOW EXTERNS ARE LOADED
|
||||
|
||||
<P> Whenever you type the name of an object
|
||||
(into an "object" text box) that Pd doesn't yet know about, Pd looks for a
|
||||
relocatable object file, named, for instance, "profile.pd_irix5". Pd looks
|
||||
first in the directory containing the patch, then in directories in its
|
||||
"path." Pd will then add whatever object is defined there to its "class list,"
|
||||
which is the set of all Pd classes you can use. If all this works, Pd then
|
||||
attempts again to create the object you asked for, this time perhaps
|
||||
successfully. There is no difference between an object defined this way and an
|
||||
object built into Pd.
|
||||
|
||||
<P> Once you load a new object into Pd, it's there for the duration of your Pd
|
||||
session. If you load another Pd document which supplies a different version of
|
||||
some Pd object, the object won't be updated. IF you're working on a new object
|
||||
and decide to change it, you have to exit and re-enter Pd to get the change to
|
||||
take.
|
||||
|
||||
<P> In the "externs" subdirectory of the documentation you
|
||||
can find simple examples of "externs" with their source code and test patches;
|
||||
there are many other on the web (see <a href="x1.htm#s2">section 1.2 </A>).
|
||||
|
||||
<P> Iohannes Zmoelnig has written an excellent guide to writing externs at
|
||||
<A href="http://iem.kug.ac.at/pd/externals-HOWTO/">
|
||||
http://iem.kug.ac.at/pd/externals-HOWTO/</A> .
|
||||
|
||||
<P> A paper by Theo Stojanov on the subject is at:
|
||||
<A href="http://www.music.mcgill.ca/~theo/html/audio/pd_externs.pdf">
|
||||
http://www.music.mcgill.ca/~theo/html/audio/pd_externs.pdf </A> .
|
||||
|
||||
<P> NT HINT: In NT, Pd is compiled using Visual C 6.0. If you have VC 5.x
|
||||
your externs won't compile against Pd; you'll get an error about "disk full
|
||||
or bad DLL." Simply recompile Pd under 5.x and the problem goes away. Externs
|
||||
compiled under 5.x and 6.x are binary compatible; it's just the compilation
|
||||
that's sensitive.
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
1811
pd-0.44-2/doc/1.manual/x5.htm
Normal file
19
pd-0.44-2/doc/2.control.examples/00.INTRO.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
This series of patches serves as a tutorial for Pd's "control" structure, as
|
||||
opposed to its audio functions (covered in the next series.) These tutorials
|
||||
are inspired by Chris Dobrian's Max tutorial patches.
|
||||
|
||||
It's probably best to look at the first section here before going on to the
|
||||
audio portion, but afterward there's no reason not to browse back and forth
|
||||
between the two, and even the third series on "fft" based techniques.
|
||||
|
||||
The relationship between "control" and "audio" is described in Pd's HTML
|
||||
documentation, which is more like a reference manual than an introduction.
|
||||
Also, you probably will need to look there to get Pd up and running stably so
|
||||
that you can enjoy the patches here.
|
||||
|
||||
The patches are roughly divided as shown:
|
||||
|
||||
1. objects and connections
|
||||
2. subpatches, tables, and organization
|
||||
3. specific techniques.
|
||||
|
16
pd-0.44-2/doc/2.control.examples/01.PART1.hello.pd
Normal file
|
@ -0,0 +1,16 @@
|
|||
#N canvas 9 21 600 496 12;
|
||||
#X msg 204 32 hello world;
|
||||
#X obj 204 105 print;
|
||||
#X floatatom 321 32 0 0 0;
|
||||
#X text 215 48 message;
|
||||
#X text 319 49 atom;
|
||||
#X text 201 123 object;
|
||||
#X text 53 150 There are four types of text objects in Pd: message \, atom \, object \, and comment.;
|
||||
#X text 54 187 Messages respond to mouse clicks by sending their contents to one or more destinations. The usual destination is the "outlet" at the lower left corner of the box.;
|
||||
#X text 55 239 Click the message box and watch the terminal window Pd was started in. You should see the "hello world" message appear.;
|
||||
#X text 55 278 Atoms respond to "Dragging" up and down with the mouse \, by changing their contents and sending the result out their outlets. You can also type at an atom after clicking on it \; hit "enter" to output the number or click anywhere else to cancel.;
|
||||
#X text 52 359 Objects \, like "print" above \, may have all sorts of functions depending on what's typed into them. The "print" object simply prints out every message it receives.;
|
||||
#X text 53 415 To get help on an object \, right-click it. You should see a "help window" for the object.;
|
||||
#X text 354 470 updated for release 0.33;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 2 0 1 0;
|
17
pd-0.44-2/doc/2.control.examples/02.editing.pd
Normal file
|
@ -0,0 +1,17 @@
|
|||
#N canvas 1 0 581 630 12;
|
||||
#X msg 195 36 hello world;
|
||||
#X obj 195 72 print;
|
||||
#X floatatom 304 36 0 0 0;
|
||||
#X text 194 15 message;
|
||||
#X text 304 14 atom;
|
||||
#X text 255 73 object;
|
||||
#X text 34 102 When you first open a Pd document like this one \, your cursor will be an arrow. Select "edit mode" in the Edit menu and the cursor will change to the image of a hand. The patch is now in edit mode. You can move any object by dragging it.;
|
||||
#X text 33 185 Select "Edit mode" again in the Edit menu and you're back to the arrow cursor which acts on objects without moving them.;
|
||||
#X text 32 373 You can create new objects by duplicating existing ones using the "duplicate" menu item. You can also "cut" and "paste" them. If you duplicate several connected objects the connections will be replicated too.;
|
||||
#X text 33 237 In Edit mode \, if you click on a message \, object \, or comment \, you can then retype the text. For objects this will create a new object and delete the old one. Pd will try to reconnect the newly created object in the same way as the old one.;
|
||||
#X text 34 442 Edit mode also lets you make and break connections between objects. Put the "hand" cursor over a line connecting two objects: it turns into an X. Clicking will delete the connection. Hold the cursor over an outlet and it becomes a circle (a patch point). Drag to any box and release \; you will be connected to the nearest inlet.;
|
||||
#X text 32 320 When you're done changing the contents of the box \, click outside the box to deselect it. This tells Pd to incorporate the new text.;
|
||||
#X text 328 604 updated for Pd version 0.33;
|
||||
#X text 35 544 The "put" menu creates new text items of any of the four types. You can also put a "symbol" box \, analogous to a number box but for showing and entering text strings.;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 2 0 1 0;
|
58
pd-0.44-2/doc/2.control.examples/03.connections.pd
Normal file
|
@ -0,0 +1,58 @@
|
|||
#N canvas 185 28 660 552 12;
|
||||
#X floatatom 76 400 0 0 0 0 - - -;
|
||||
#X floatatom 189 401 0 0 0 0 - - -;
|
||||
#X floatatom 76 307 0 0 0 0 - - -;
|
||||
#X floatatom 553 161 0 0 0 0 - - -;
|
||||
#X floatatom 599 162 0 0 0 0 - - -;
|
||||
#X obj 553 135 +;
|
||||
#X floatatom 553 105 0 0 0 0 - - -;
|
||||
#X obj 599 136 +;
|
||||
#X floatatom 26 109 0 0 0 0 - - -;
|
||||
#X floatatom 26 17 0 0 0 0 - - -;
|
||||
#X floatatom 48 41 0 0 0 0 - - -;
|
||||
#X obj 26 85 +;
|
||||
#X text 3 64 hot;
|
||||
#X text 53 66 cold;
|
||||
#X text 232 105 Here's the downside: drag this--->;
|
||||
#X text 551 180 good;
|
||||
#X text 600 181 bad;
|
||||
#X obj 76 376 *;
|
||||
#X obj 189 377 -;
|
||||
#X text 15 400 square;
|
||||
#X text 229 402 first difference;
|
||||
#X obj 76 330 trigger float float;
|
||||
#X text 412 526 updated for Pd version 0.33;
|
||||
#X text 19 433 Trigger takes any number of "bang" and "float" arguments
|
||||
(among others) and copies its input to its outlets \, in the requested
|
||||
forms \, in right-to-left order. Hook it to two inputs without crossing
|
||||
the wires and you get the expected result. Cross the wires and you
|
||||
get a memory effect.;
|
||||
#X text 9 136 In Pd you must sometimes think about what order an object
|
||||
is going to get its messages in. If an outlet is connected to more
|
||||
than one inlet it's undefined which inlet will get the cookie first.
|
||||
I've rigged this example so that the left-hand side box gets its inputs
|
||||
in the good \, right-to-left order \, so that the hot inlet gets hit
|
||||
when all the data are good. The "bad adder" happens to receive its
|
||||
inputs in the wrong order and is perpetually doing its addition before
|
||||
all the data are in. There's an object that exists solely to allow
|
||||
you to control message order explicitly:;
|
||||
#X text 114 16 In Pd \, most objects carry out their functions when
|
||||
they get messages in their leftmost inlets \, and their other inlets
|
||||
are for storing values that can modify the next action. Here \, the
|
||||
"+" object does its thing only when the left-hand input changes.;
|
||||
#X connect 2 0 21 0;
|
||||
#X connect 5 0 3 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 6 0 7 1;
|
||||
#X connect 6 0 5 1;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 7 0 4 0;
|
||||
#X connect 9 0 11 0;
|
||||
#X connect 10 0 11 1;
|
||||
#X connect 11 0 8 0;
|
||||
#X connect 17 0 0 0;
|
||||
#X connect 18 0 1 0;
|
||||
#X connect 21 0 17 0;
|
||||
#X connect 21 0 18 1;
|
||||
#X connect 21 1 17 1;
|
||||
#X connect 21 1 18 0;
|
35
pd-0.44-2/doc/2.control.examples/04.messages.pd
Normal file
|
@ -0,0 +1,35 @@
|
|||
#N canvas 0 0 591 442 12;
|
||||
#X floatatom 225 110 0 0 0;
|
||||
#X floatatom 184 109 0 0 0;
|
||||
#X msg 184 56 5 6;
|
||||
#X floatatom 132 108 0 0 0;
|
||||
#X floatatom 64 105 0 0 0;
|
||||
#X text 30 21 Most Pd messages are just numbers or short lists of numbers:;
|
||||
#X msg 64 55 5;
|
||||
#X obj 64 80 + 9;
|
||||
#X obj 132 83 +;
|
||||
#X obj 184 84 unpack;
|
||||
#X msg 288 55 5;
|
||||
#X obj 288 107 print;
|
||||
#X obj 288 81 pack 34 78;
|
||||
#X msg 132 55 5 6;
|
||||
#X floatatom 195 328 0 0 0;
|
||||
#X obj 195 303 +;
|
||||
#X msg 195 254 1.2 3.4;
|
||||
#X msg 205 277 5 6;
|
||||
#X text 36 206 Unlike Max \, in Pd all numbers are floating point. Numbers whose values happen to be integers are displayed without decimal points.;
|
||||
#X text 31 363 For more on messages \, get help on any message box by right-clicking.;
|
||||
#X text 329 409 updated for Pd release 0.33;
|
||||
#X text 34 149 If you send a list to an object with more than one inlet \, the items in the list are spread out over the inlets \, as seen in the 5+6 example above.;
|
||||
#X connect 2 0 9 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 4 0;
|
||||
#X connect 8 0 3 0;
|
||||
#X connect 9 0 1 0;
|
||||
#X connect 9 1 0 0;
|
||||
#X connect 10 0 12 0;
|
||||
#X connect 12 0 11 0;
|
||||
#X connect 13 0 8 0;
|
||||
#X connect 15 0 14 0;
|
||||
#X connect 16 0 15 0;
|
||||
#X connect 17 0 15 0;
|
45
pd-0.44-2/doc/2.control.examples/05.counter.pd
Normal file
|
@ -0,0 +1,45 @@
|
|||
#N canvas 0 0 685 496 12;
|
||||
#X floatatom 107 424 0 0 0;
|
||||
#X msg 53 344 bang;
|
||||
#X obj 107 399 + 1;
|
||||
#X obj 376 262 + 1;
|
||||
#X floatatom 152 197 0 0 0;
|
||||
#X floatatom 108 245 0 0 0;
|
||||
#X msg 108 196 bang;
|
||||
#X floatatom 169 107 0 0 0;
|
||||
#X msg 112 58 bang;
|
||||
#X obj 169 82 + 1;
|
||||
#X text 31 21 Here's a simple counter. Click repeatedly on the "bang
|
||||
message to see it:;
|
||||
#X text 422 263 to its cold inlet.;
|
||||
#X text 25 284 The incremented value is stored for the next "bang"
|
||||
to spit out.;
|
||||
#X text 28 322 Here's a timed counter. Hit the "bang" to start it...
|
||||
;
|
||||
#X obj 53 373 metro 500;
|
||||
#X msg 99 344 stop;
|
||||
#X obj 112 83 float;
|
||||
#X text 28 132 The "float" box is a storage element holding one floating-point
|
||||
number. The cold inlet (i.e. \, the one on the right) stores numbers.
|
||||
Sending the message "bang" to the hot inlet gets the number back out:
|
||||
;
|
||||
#X obj 108 221 float;
|
||||
#X obj 53 399 float;
|
||||
#X text 25 263 Float's outlet above is connected via;
|
||||
#X text 384 462 updated for Pd version 0.34;
|
||||
#X text 142 373 <-- new object: metronome. The "500" means every 500
|
||||
milliseconds--i.e. \, twice a second.;
|
||||
#X connect 1 0 14 0;
|
||||
#X connect 2 0 0 0;
|
||||
#X connect 2 0 19 1;
|
||||
#X connect 4 0 18 1;
|
||||
#X connect 6 0 18 0;
|
||||
#X connect 8 0 16 0;
|
||||
#X connect 9 0 7 0;
|
||||
#X connect 9 0 16 1;
|
||||
#X connect 14 0 19 0;
|
||||
#X connect 15 0 14 0;
|
||||
#X connect 15 0 14 0;
|
||||
#X connect 16 0 9 0;
|
||||
#X connect 18 0 5 0;
|
||||
#X connect 19 0 2 0;
|
55
pd-0.44-2/doc/2.control.examples/06.more.counters.pd
Normal file
|
@ -0,0 +1,55 @@
|
|||
#N canvas 8 0 659 487 12;
|
||||
#X floatatom 147 177 0 0 0;
|
||||
#X obj 147 151 + 1;
|
||||
#X msg 147 47 bang;
|
||||
#X obj 147 99 metro 500;
|
||||
#X msg 56 105 stop;
|
||||
#X obj 147 125 float;
|
||||
#X obj 147 73 trigger bang bang;
|
||||
#X msg 261 105 0;
|
||||
#X obj 56 79 select 10;
|
||||
#X text 305 102 first set value to zero;
|
||||
#X text 304 73 initialization is in two steps;
|
||||
#X text 305 121 (before starting the metronome);
|
||||
#X text 9 128 conditionally;
|
||||
#X text 9 145 stop the;
|
||||
#X text 10 159 metronome;
|
||||
#X text 184 46 <--- click here to start;
|
||||
#X floatatom 85 289 0 0 0;
|
||||
#X obj 85 315 >= 0;
|
||||
#X obj 85 341 select 0 1;
|
||||
#X obj 85 393 float;
|
||||
#X floatatom 139 420 0 0 0;
|
||||
#X msg 119 367 bang;
|
||||
#X obj 139 394 + 1;
|
||||
#X msg 85 367 -1;
|
||||
#X text 131 313 <-- are we nonnegative? (1 if true \, 0 if false);
|
||||
#X text 180 340 <-- selectively bang the first or second outlet;
|
||||
#X text 167 363 <-- as a result either clear or increment the counter
|
||||
;
|
||||
#X text 32 11 Here's a counter that counts from 1 to 10:;
|
||||
#X text 392 452 updated for Pd version 0.34;
|
||||
#X text 33 200 We're using one new object \, "select \, " which outputs
|
||||
a bang when it gets a matching value (10). This is useful for doing
|
||||
conditional computations \, such as this one which counts while its
|
||||
input is 0 or positive but clears when negative:;
|
||||
#X connect 1 0 0 0;
|
||||
#X connect 1 0 5 1;
|
||||
#X connect 1 0 8 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 3 0 5 0;
|
||||
#X connect 4 0 3 0;
|
||||
#X connect 5 0 1 0;
|
||||
#X connect 6 0 3 0;
|
||||
#X connect 6 1 7 0;
|
||||
#X connect 7 0 5 1;
|
||||
#X connect 8 0 4 0;
|
||||
#X connect 16 0 17 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 18 0 23 0;
|
||||
#X connect 18 1 21 0;
|
||||
#X connect 19 0 22 0;
|
||||
#X connect 21 0 19 0;
|
||||
#X connect 22 0 19 1;
|
||||
#X connect 22 0 20 0;
|
||||
#X connect 23 0 19 0;
|
40
pd-0.44-2/doc/2.control.examples/07.time.pd
Normal file
|
@ -0,0 +1,40 @@
|
|||
#N canvas 490 83 724 474 12;
|
||||
#X text 34 13 Besides the metronome \, there are three objects for
|
||||
dealing with time:;
|
||||
#X obj 64 117 print;
|
||||
#X msg 64 59 bang;
|
||||
#X msg 110 61 stop;
|
||||
#X obj 64 89 delay 2000;
|
||||
#X msg 76 192 bang;
|
||||
#X obj 76 239 timer;
|
||||
#X text 160 117 The right inlet can be used to set the time value without
|
||||
scheduling any output.;
|
||||
#X obj 106 214 delay 123.45;
|
||||
#X floatatom 76 264 0 0 0 0 - - -;
|
||||
#X text 34 288 Note that all time calculations are idealized \; they
|
||||
do not show the effects of computation time or OS latency. This way
|
||||
you can write deterministic algorithms dealing with time passage.;
|
||||
#X obj 74 387 pipe 2000;
|
||||
#X floatatom 74 360 0 0 0 0 - - -;
|
||||
#X floatatom 74 413 0 0 0 0 - - -;
|
||||
#X text 165 361 The pipe object allocates memory dynamically in order
|
||||
to schedule any number of delayed events. The events may hold any collection
|
||||
of data (as usual \, for more details you can consult the help window.)
|
||||
;
|
||||
#X text 442 440 updated for Pd version 0.43;
|
||||
#X text 35 154 The timer \, shown below \, measures the time elapsed
|
||||
between the arrival of 'bang' messages to its left and right inlets:
|
||||
;
|
||||
#X text 159 40 The delay object schedules an event for a future time
|
||||
expressed in milliseconds. Unlike in Max \, time values need not be
|
||||
integers. If a delay has been scheduled and you "bang" it again \,
|
||||
it is rescheduled (the previously scheduled output is cancelled.);
|
||||
#X connect 2 0 4 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 4 0 1 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 5 0 8 0;
|
||||
#X connect 6 0 9 0;
|
||||
#X connect 8 0 6 1;
|
||||
#X connect 11 0 13 0;
|
||||
#X connect 12 0 11 0;
|
48
pd-0.44-2/doc/2.control.examples/08.depthfirst.pd
Normal file
|
@ -0,0 +1,48 @@
|
|||
#N canvas 144 162 632 551 12;
|
||||
#X msg 64 51 1;
|
||||
#X obj 89 150 + 1;
|
||||
#X obj 209 187 print x1;
|
||||
#X obj 64 209 print x3;
|
||||
#X obj 114 122 print x2;
|
||||
#X obj 209 100 + 1;
|
||||
#X obj 209 129 + 1;
|
||||
#X obj 209 158 + 1;
|
||||
#X obj 64 80 t f f f f;
|
||||
#X obj 89 179 print x2;
|
||||
#X text 34 13 In Pd \, message passing is depth first \, so that in
|
||||
this patch:;
|
||||
#X text 104 51 <-- click here;
|
||||
#X text 17 243 ... you get "x1" first \, notwidthstanding the fact
|
||||
that "x2" and "x3" appear to be closer to the source. This means that
|
||||
you shouldn't do this:;
|
||||
#X msg 76 304 1;
|
||||
#X text 116 304 <-- maybe you shouldn't click here;
|
||||
#X obj 115 334 + 1;
|
||||
#X obj 76 333 f;
|
||||
#X floatatom 76 365 0 0 0;
|
||||
#X text 377 520 updated for Pd version 0.34;
|
||||
#X text 35 393 ... because the "depth" is infinite. The counters you've
|
||||
seen always have the message chain terminated somewhere in a cold inlet:
|
||||
;
|
||||
#X msg 75 453 1;
|
||||
#X obj 114 483 + 1;
|
||||
#X obj 75 482 f;
|
||||
#X floatatom 75 514 0 0 0;
|
||||
#X text 115 453 <-- better;
|
||||
#X connect 0 0 8 0;
|
||||
#X connect 1 0 9 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 2 0;
|
||||
#X connect 8 0 3 0;
|
||||
#X connect 8 1 1 0;
|
||||
#X connect 8 2 4 0;
|
||||
#X connect 8 3 5 0;
|
||||
#X connect 13 0 16 0;
|
||||
#X connect 15 0 16 0;
|
||||
#X connect 16 0 17 0;
|
||||
#X connect 16 0 15 0;
|
||||
#X connect 20 0 22 0;
|
||||
#X connect 21 0 22 1;
|
||||
#X connect 22 0 23 0;
|
||||
#X connect 22 0 21 0;
|
35
pd-0.44-2/doc/2.control.examples/09.send_receive.pd
Normal file
|
@ -0,0 +1,35 @@
|
|||
#N canvas 136 31 738 479 12;
|
||||
#X floatatom 88 199 0 0 0;
|
||||
#X obj 88 172 receive crackers;
|
||||
#X floatatom 248 204 0 0 0;
|
||||
#X obj 248 177 receive pickles;
|
||||
#X obj 88 145 send crackers;
|
||||
#X obj 250 139 send pickles;
|
||||
#X obj 389 138 send pickles;
|
||||
#X floatatom 392 203 0 0 0;
|
||||
#X obj 392 176 receive pickles;
|
||||
#X msg 51 306 \; pickles 99 \; crackers 56;
|
||||
#X floatatom 88 118 0 0 0;
|
||||
#X floatatom 250 112 0 0 0;
|
||||
#X floatatom 389 111 0 0 0;
|
||||
#X obj 371 404 r crackers;
|
||||
#X obj 371 377 s crackers;
|
||||
#X text 39 392 send and receive can be abbreviated:;
|
||||
#X text 48 245 You can use the semicolon feature of message boxes to
|
||||
address receives \, too. This is useful if you want to do a whole list
|
||||
of things:;
|
||||
#X text 166 305 The transaction takes place in zero time---i.e. \,
|
||||
if you tried to use "timer" to measure the time delay between the two
|
||||
\, you would get zero.;
|
||||
#X text 459 447 updated for Pd version 0.34;
|
||||
#X text 51 6 The send and receive objects allow you to make non-local
|
||||
connections. These work globally--you can use them to make two different
|
||||
patches intercommunicate if you wish. Any message a "send" gets appears
|
||||
at the output of every receive of the same name. There can be any number
|
||||
of sends and receives sharing the same name:;
|
||||
#X connect 1 0 0 0;
|
||||
#X connect 3 0 2 0;
|
||||
#X connect 8 0 7 0;
|
||||
#X connect 10 0 4 0;
|
||||
#X connect 11 0 5 0;
|
||||
#X connect 12 0 6 0;
|
56
pd-0.44-2/doc/2.control.examples/10.more.messages.pd
Normal file
|
@ -0,0 +1,56 @@
|
|||
#N canvas 91 95 675 539 12;
|
||||
#X obj 211 341 print;
|
||||
#X msg 52 89 3 \, 4 \, 5;
|
||||
#X msg 44 62 3 4 5;
|
||||
#X msg 57 313 3 \$1 5;
|
||||
#X floatatom 57 286 4 0 0;
|
||||
#X msg 211 315 \$2 \$1 5;
|
||||
#X msg 211 290 45 67;
|
||||
#X msg 289 290 45 67;
|
||||
#X floatatom 28 425 4 0 0;
|
||||
#X floatatom 76 425 4 0 0;
|
||||
#X floatatom 332 179 4 0 0;
|
||||
#X floatatom 186 182 4 0 0;
|
||||
#X obj 186 155 receive number9;
|
||||
#X obj 332 155 receive 9bis;
|
||||
#X obj 44 178 print;
|
||||
#X text 27 5 In addition to using semicolons to separate messages \,
|
||||
you can use commas \, which continue a stream of messages to the same
|
||||
destination. Thus:;
|
||||
#X msg 65 116 3 \; number9 5 \; 9bis 45;
|
||||
#X text 126 89 <-- three separate messages;
|
||||
#X text 109 58 <-- one message: the list \, "3 4 5".;
|
||||
#X text 167 114 <-- three separate messages \, with three destinations.
|
||||
;
|
||||
#X text 406 511 updated for Pd version 0.34;
|
||||
#X msg 289 315 \; number9 \$1 \; 9bis \$2;
|
||||
#X text 9 209 You can use "$1" \, etc. \, as variables in messages.
|
||||
Send the message box a list whose elements supply the values. A number
|
||||
is just a list with one element.;
|
||||
#X obj 57 339 print;
|
||||
#X text 51 265 one variable:;
|
||||
#X text 216 263 two variables:;
|
||||
#X text 1 367 But to really exploit the possibilities using multiple
|
||||
variables \, you will need the "pack" object to get two or more values
|
||||
into the same message:;
|
||||
#X obj 28 507 print;
|
||||
#X obj 28 455 pack 0 0 0;
|
||||
#X floatatom 124 425 4 0 0;
|
||||
#X msg 28 481 cis \$1 \, boom \$2 \, bah \$3;
|
||||
#X text 124 455 <-- creation arguments to "pack" set the number of
|
||||
inlets.;
|
||||
#X connect 1 0 14 0;
|
||||
#X connect 2 0 14 0;
|
||||
#X connect 3 0 23 0;
|
||||
#X connect 4 0 3 0;
|
||||
#X connect 5 0 0 0;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 7 0 21 0;
|
||||
#X connect 8 0 28 0;
|
||||
#X connect 9 0 28 1;
|
||||
#X connect 12 0 11 0;
|
||||
#X connect 13 0 10 0;
|
||||
#X connect 16 0 14 0;
|
||||
#X connect 28 0 30 0;
|
||||
#X connect 29 0 28 2;
|
||||
#X connect 30 0 27 0;
|
42
pd-0.44-2/doc/2.control.examples/11.review.pd
Normal file
|
@ -0,0 +1,42 @@
|
|||
#N canvas 255 248 675 539 12;
|
||||
#X text 406 511 updated for Pd version 0.34;
|
||||
#X obj 39 232 receive;
|
||||
#X obj 39 203 send;
|
||||
#X obj 39 289 pack;
|
||||
#X obj 111 233 r;
|
||||
#X obj 82 203 s;
|
||||
#X obj 40 348 timer;
|
||||
#X obj 40 60 float;
|
||||
#X obj 39 175 select;
|
||||
#X obj 40 89 +;
|
||||
#X obj 40 117 >=;
|
||||
#X obj 39 146 print;
|
||||
#X obj 39 260 trigger;
|
||||
#X obj 95 61 f;
|
||||
#X obj 100 176 sel;
|
||||
#X obj 111 259 t;
|
||||
#X obj 39 318 unpack;
|
||||
#X obj 40 435 pipe;
|
||||
#X obj 40 377 delay;
|
||||
#X obj 40 406 metro;
|
||||
#X text 20 8 So far we've seen the following objects \, some of which
|
||||
have abbreviations. Right click on any one to get reference documentation:
|
||||
;
|
||||
#X text 150 205 wireless message send;
|
||||
#X text 151 229 wireless message receive;
|
||||
#X text 145 175 test for two equal numbers;
|
||||
#X text 151 258 control message order and format;
|
||||
#X text 148 293 combine atoms (e.g. \, numbers) into a list;
|
||||
#X text 146 319 take a list apart into atoms;
|
||||
#X text 146 146 printout;
|
||||
#X text 147 90 arithmetic;
|
||||
#X text 75 89 (etc.);
|
||||
#X text 74 117 (etc.);
|
||||
#X text 145 117 comparison;
|
||||
#X text 145 60 store a number;
|
||||
#X text 145 348 measure elapsed time;
|
||||
#X text 145 379 pass a message after delay;
|
||||
#X text 145 437 multiple delay;
|
||||
#X text 143 409 repeated message;
|
||||
#X text 38 473 There are many others... you can see a complete list
|
||||
in INTRO.txt in the reference patches (../5.reference).;
|
72
pd-0.44-2/doc/2.control.examples/12.PART2.subpatch.pd
Normal file
|
@ -0,0 +1,72 @@
|
|||
#N canvas 84 47 648 623 12;
|
||||
#X msg 29 318 bang;
|
||||
#X floatatom 432 341 0 0 0;
|
||||
#X text 32 14 You can nest entire windows inside Pd boxes (and so on
|
||||
\, as deep as you wish.) There are two different ways to do it. First
|
||||
\, if you just want to add a room to the house \, so to speak \, type
|
||||
;
|
||||
#N canvas 344 151 422 119 sample-subpatch 1;
|
||||
#X text 39 43 this is a subpatch of the main patch.;
|
||||
#X restore 29 85 pd sample-subpatch;
|
||||
#X text 201 85 <-- you can give the window a name as an argument;
|
||||
#N canvas 0 0 654 340 eager-adder 0;
|
||||
#X obj 62 73 inlet;
|
||||
#X obj 118 73 inlet;
|
||||
#X obj 62 188 outlet;
|
||||
#X obj 118 101 t b f;
|
||||
#X obj 62 156 +;
|
||||
#X text 197 23 this is a sample subpatch which maintains the sum of
|
||||
two inputs \, doing the computation when either input changes. IF it's
|
||||
the left input \, the "+" object takes care if it \; if the right \,
|
||||
the "trigger" object first gives the "+" the new value \, then "bangs"
|
||||
the right inlet to make "+" do the computation.;
|
||||
#X text 55 232 Aside: this shows why \, in Pd and Max \, objects such
|
||||
as "+" only trigger on their left inlets: it's easy to build up from
|
||||
there \, but if more than one inlet were "hot" \, you wouldn't be able
|
||||
to change both of them without firing the calculation twice.;
|
||||
#X text 197 112 Because of the two inlets and the one outlet \, the
|
||||
containing box (int eh parent patch) has two inlets and one outlet.
|
||||
They respect the left-to-right order of the inlet and outlet objects
|
||||
in the subpatch.;
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 3 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 3 1 4 1;
|
||||
#X connect 4 0 2 0;
|
||||
#X restore 135 185 pd eager-adder;
|
||||
#X floatatom 135 158 0 0 0;
|
||||
#X floatatom 256 158 0 0 0;
|
||||
#X floatatom 135 213 0 0 0;
|
||||
#X text 26 235 There is also a facility for making many copies of a
|
||||
patch which track any changes you make in the original. The subpatches
|
||||
are called abstractions. For example \, here's a simple abstraction
|
||||
that sends a number to a "receive" on command:;
|
||||
#X obj 29 342 sendnumber 45 cookies;
|
||||
#X msg 226 314 bang;
|
||||
#X obj 226 341 sendnumber 67 pretzels;
|
||||
#X floatatom 519 341 0 0 0;
|
||||
#X text 27 553 note that "$1" \, etc \, has a different meaning in
|
||||
object boxes (open one of the "sendnumber" abstractions for comments.)
|
||||
;
|
||||
#X text 26 470 If you change one copy of an abstraction the change
|
||||
isn't automatically made on any other copies. You must keep track \,
|
||||
save the changes \, and cause Pd to reload the other copies (for example
|
||||
\, by closing and reopening the containing patch.);
|
||||
#X obj 432 314 r cookies;
|
||||
#X obj 519 314 r pretzels;
|
||||
#X text 31 107 If you click on the box (in run mode) the subwindow
|
||||
appears. Click on the one below to see how you give a subpatch inlets
|
||||
and outlets.;
|
||||
#X text 332 594 updated for Pd version 0.34;
|
||||
#X text 27 372 There is a separate file in this directory named "sendnumber.pd"
|
||||
which is loaded every time you type "sendnumber" in a box. Click on
|
||||
a "sendnumber" box above to see it. You can make changes in the subpatch
|
||||
and save them. The changes will be saved back to sendnumber.pd and
|
||||
not as part of this (containing) patch.;
|
||||
#X connect 0 0 10 0;
|
||||
#X connect 5 0 8 0;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 7 0 5 1;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 16 0 1 0;
|
||||
#X connect 17 0 13 0;
|
27
pd-0.44-2/doc/2.control.examples/13.locality.pd
Normal file
|
@ -0,0 +1,27 @@
|
|||
#N canvas 24 192 606 297 12;
|
||||
#X floatatom 38 223 0 0 0;
|
||||
#X floatatom 191 221 0 0 0;
|
||||
#X text 356 264 updated for Pd version 0.34;
|
||||
#X text 32 14 You can use dollarsigns in abstractions to get local
|
||||
sends and receives as shown here.;
|
||||
#X obj 29 85 dollarsign one;
|
||||
#X obj 167 86 dollarsign two;
|
||||
#X obj 38 196 r one-a;
|
||||
#X obj 191 194 r two-a;
|
||||
#X floatatom 110 225 0 0 0;
|
||||
#X floatatom 264 220 0 0 0;
|
||||
#X obj 110 197 r one-b;
|
||||
#X obj 264 191 r two-b;
|
||||
#X text 26 112 Open both copies to see what's happening...;
|
||||
#X floatatom 29 59 0 0 0;
|
||||
#X floatatom 124 58 0 0 0;
|
||||
#X floatatom 167 60 0 0 0;
|
||||
#X floatatom 264 58 0 0 0;
|
||||
#X connect 6 0 0 0;
|
||||
#X connect 7 0 1 0;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 13 0 4 0;
|
||||
#X connect 14 0 4 1;
|
||||
#X connect 15 0 5 0;
|
||||
#X connect 16 0 5 1;
|
5
pd-0.44-2/doc/2.control.examples/14.dollarsigns.pd
Normal file
|
@ -0,0 +1,5 @@
|
|||
#N canvas 12 363 561 155 12;
|
||||
#X text 303 114 updated for Pd version 0.34;
|
||||
#X obj 34 68 dollarsign2 three 4;
|
||||
#X text 32 14 An abstraction's creation arguments may be either numbers
|
||||
or symbols. Gory details are inside:;
|
70
pd-0.44-2/doc/2.control.examples/15.array.pd
Normal file
|
@ -0,0 +1,70 @@
|
|||
#N canvas 268 28 1030 744 12;
|
||||
#X text 204 19 ARRAYS;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array array99 100 float 0;
|
||||
#X coords 0 1 99 -1 400 300 1;
|
||||
#X restore 614 49 graph;
|
||||
#X msg 179 325 \; array99 resize \$1;
|
||||
#X floatatom 179 292 0 0 0;
|
||||
#X floatatom 21 260 0 0 0;
|
||||
#X obj 21 294 / 100;
|
||||
#X msg 21 324 \; array99 const \$1;
|
||||
#X text 22 233 You can send messages to an array object:;
|
||||
#X msg 341 325 \; array99 print;
|
||||
#X text 64 262 <-- set to a constant value;
|
||||
#X text 221 291 resize;
|
||||
#X text 342 286 print size;
|
||||
#X text 22 487 read a text file;
|
||||
#X text 23 558 write a text file;
|
||||
#X text 271 559 write a WAV format soundfile;
|
||||
#X obj 104 714 tabread;
|
||||
#X obj 255 714 tabwrite;
|
||||
#X text 20 665 Objects are provided for reading and writing the contents
|
||||
of arrays via control messages:;
|
||||
#X obj 602 654 tabread4~;
|
||||
#X obj 602 679 tabwrite~;
|
||||
#X obj 695 654 tabreceive~;
|
||||
#X text 593 601 ...and audio signals:;
|
||||
#X obj 695 630 tabsend~;
|
||||
#X msg 381 400 \; array99 normalize;
|
||||
#X msg 382 442 \; array99 normalize 0.5;
|
||||
#X text 375 378 normalize to 1 or otherwise;
|
||||
#X obj 266 537 soundfiler;
|
||||
#X obj 812 631 tabosc4~;
|
||||
#X msg 19 402 \; array99 sinesum 64 0.2 0.2 0.2 0.2;
|
||||
#X msg 19 444 \; array99 cosinesum 64 0.2 0.2 0.2 0.2;
|
||||
#X text 23 378 Fourier synthesis (resizes table);
|
||||
#X text 257 484 read a soundfile;
|
||||
#X text 735 698 last updated for release 0.34;
|
||||
#X obj 175 715 tabread4;
|
||||
#X obj 602 628 tabread~;
|
||||
#X msg 267 511 read ../sound/voice2.wav array99;
|
||||
#X text 19 47 Arrays in Pd provide a unified way to deal with lists
|
||||
of numbers \, treating them as either audio samples or for "control"
|
||||
uses. To make one \, select "array" on the "new" menu. Dialogs appear
|
||||
to help you choose the name \, number of elements \, and various flags.
|
||||
;
|
||||
#X text 17 134 You can also change the array size using the "resize"
|
||||
message shown below. Arrays live in graphs and graphs may hold more
|
||||
than one array--however \, graphs containing more than one array won't
|
||||
know how to readjust themselves automatically when the arrays are resized.
|
||||
;
|
||||
#X msg 15 507 \; array99 read 15.file.txt;
|
||||
#X obj 26 581 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 26 600 savepanel;
|
||||
#X msg 26 623 \; array99 write \$1;
|
||||
#X obj 270 577 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 270 596 savepanel;
|
||||
#X obj 270 642 soundfiler;
|
||||
#X msg 270 619 write \$1 array99;
|
||||
#X connect 3 0 2 0;
|
||||
#X connect 4 0 5 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 35 0 26 0;
|
||||
#X connect 39 0 40 0;
|
||||
#X connect 40 0 41 0;
|
||||
#X connect 42 0 43 0;
|
||||
#X connect 43 0 45 0;
|
||||
#X connect 45 0 44 0;
|
2
pd-0.44-2/doc/2.control.examples/15.file.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
0.3
|
||||
-0.6 -0.2 0.8 0
|
23
pd-0.44-2/doc/2.control.examples/16.more.arrays.pd
Normal file
|
@ -0,0 +1,23 @@
|
|||
#N canvas 19 83 830 601 12;
|
||||
#X graph graph1 0 -1 5 1 569 304 769 154;
|
||||
#X array array99 5 float;
|
||||
#X array array98 7 float;
|
||||
#X pop;
|
||||
#X text 135 18 MORE ON ARRAYS;
|
||||
#X msg 17 229 \; array99 rename george;
|
||||
#X msg 221 229 \; george rename array99;
|
||||
#X msg 317 166 \; array99 3 -0.5 0.5;
|
||||
#X text 17 207 renaming an array:;
|
||||
#X text 16 276 setting the bounds rectangle:;
|
||||
#X msg 18 296 \; array99 bounds 0 -2 10 2;
|
||||
#X msg 245 294 \; array99 bounds 0 -1 5 1;
|
||||
#X msg 19 395 \; array99 xticks 0 1 1;
|
||||
#X msg 212 394 \; array99 yticks 0 0.1 5;
|
||||
#X text 15 342 adding x and y labels: give a point to put a tick \, the interval between ticks \, and the number of ticks overall per large tick.;
|
||||
#X msg 15 472 \; array99 xlabel -1.1 0 1 2 3 4 5;
|
||||
#X text 12 436 adding labels. Give a y value and a bunch of x values or vice versa:;
|
||||
#X msg 17 166 \; array98 0 -1 1 -1 1 -1 1 -1 1 -1;
|
||||
#X msg 305 472 \; array99 ylabel 5.15 -1 0 1;
|
||||
#X text 556 575 last updated for release 0.33;
|
||||
#X text 10 39 Arrays have methods to set their values explicitly \; to set their "bounds" rectangles \, to rename them (but if you have two with the same name this won't necessarily do what you want) and to add markings. To set values by message \, send a list whise first element gives the index to start at. The second example sets two values starting at index three. Indices count up from zero.;
|
||||
#X text 11 522 You can also change x and y range and size in the "properties" dialog. Note that information about size and ranges is saved \, but ticks \, labels \, and the actual data are lost between Pd sessions.;
|
35
pd-0.44-2/doc/2.control.examples/17.PART3.midi.pd
Normal file
|
@ -0,0 +1,35 @@
|
|||
#N canvas 47 52 517 445 12;
|
||||
#X floatatom 108 89 0 0 0;
|
||||
#X floatatom 72 89 0 0 0;
|
||||
#X obj 36 62 notein;
|
||||
#X floatatom 36 88 0 0 0;
|
||||
#X floatatom 228 91 0 0 0;
|
||||
#X floatatom 192 91 0 0 0;
|
||||
#X floatatom 156 90 0 0 0;
|
||||
#X obj 156 64 ctlin;
|
||||
#X floatatom 319 90 0 0 0;
|
||||
#X floatatom 283 89 0 0 0;
|
||||
#X obj 283 63 bendin;
|
||||
#X floatatom 329 128 0 0 0;
|
||||
#X floatatom 285 127 0 0 0;
|
||||
#X obj 285 157 bendout;
|
||||
#X text 23 18 Pd offers input and output objects for MIDI:;
|
||||
#X text 358 154 ... ad nauseam.;
|
||||
#X text 254 417 updated for Pd version 0.34;
|
||||
#X obj 39 321 midiout;
|
||||
#X obj 244 368 sysexin;
|
||||
#X msg 39 291 240 \, 45 \, 93 \, 3 \, 65 \, 1 \, 2 \, 3 \, 4 \, 247
|
||||
;
|
||||
#X text 32 252 You can format your own SYSEX messages as shown:;
|
||||
#X text 28 366 and receive SYSEX via:;
|
||||
#X connect 2 0 3 0;
|
||||
#X connect 2 1 1 0;
|
||||
#X connect 2 2 0 0;
|
||||
#X connect 7 0 6 0;
|
||||
#X connect 7 1 5 0;
|
||||
#X connect 7 2 4 0;
|
||||
#X connect 10 0 9 0;
|
||||
#X connect 10 1 8 0;
|
||||
#X connect 11 0 13 1;
|
||||
#X connect 12 0 13 0;
|
||||
#X connect 19 0 17 0;
|
59
pd-0.44-2/doc/2.control.examples/18.conditional.pd
Normal file
|
@ -0,0 +1,59 @@
|
|||
#N canvas 538 239 665 516 12;
|
||||
#X text 395 489 updated for Pd version 0.26;
|
||||
#X obj 87 148 select 1 2;
|
||||
#X floatatom 87 120 0 0 0;
|
||||
#X obj 87 214 print select-1;
|
||||
#X obj 119 194 print select-2;
|
||||
#X obj 152 171 print select-3;
|
||||
#X floatatom 313 122 0 0 0;
|
||||
#X obj 313 155 pack;
|
||||
#X obj 313 182 route 1 2;
|
||||
#X obj 353 131 t b f;
|
||||
#X floatatom 353 107 0 0 0;
|
||||
#X obj 371 210 unpack;
|
||||
#X floatatom 313 210 0 0 0;
|
||||
#X floatatom 342 210 0 0 0;
|
||||
#X floatatom 371 233 0 0 0;
|
||||
#X floatatom 409 234 0 0 0;
|
||||
#X text 30 20 Pd provides at least four objects for doing conditioonal
|
||||
computations. The "select" object tests its input against its argumt(s)
|
||||
\, and outputs "bang" when they match. The "route" object works similarly
|
||||
but also copies data. In other wors \, "route" takes a list \, tests
|
||||
its first element \, and conditionally passes on the rest of the list.
|
||||
;
|
||||
#X text 56 262 You also get "spigot" which turns a flow of messages
|
||||
on and off (like the Gate object in Max \, but with the inputs reversed):
|
||||
;
|
||||
#X floatatom 125 316 0 0 0;
|
||||
#X obj 125 341 spigot;
|
||||
#X floatatom 162 316 0 0 0;
|
||||
#X floatatom 125 365 0 0 0;
|
||||
#X text 192 317 <-- nonzero to open;
|
||||
#X text 157 365 if open \, messages coming in at left are sent to output.
|
||||
;
|
||||
#X text 55 396 And finally \, "moses" sends numbers to the left if
|
||||
they're less than the argument \, right otherwise:;
|
||||
#X floatatom 125 427 0 0 0;
|
||||
#X floatatom 125 476 0 0 0;
|
||||
#X obj 125 452 moses 5;
|
||||
#X floatatom 169 476 0 0 0;
|
||||
#X connect 1 0 3 0;
|
||||
#X connect 1 1 4 0;
|
||||
#X connect 1 2 5 0;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 8 0;
|
||||
#X connect 8 0 12 0;
|
||||
#X connect 8 1 13 0;
|
||||
#X connect 8 2 11 0;
|
||||
#X connect 9 0 7 0;
|
||||
#X connect 9 1 7 1;
|
||||
#X connect 10 0 9 0;
|
||||
#X connect 11 0 14 0;
|
||||
#X connect 11 1 15 0;
|
||||
#X connect 18 0 19 0;
|
||||
#X connect 19 0 21 0;
|
||||
#X connect 20 0 19 1;
|
||||
#X connect 25 0 27 0;
|
||||
#X connect 27 0 26 0;
|
||||
#X connect 27 1 28 0;
|
39
pd-0.44-2/doc/2.control.examples/19.random.pd
Normal file
|
@ -0,0 +1,39 @@
|
|||
#N canvas 47 52 722 449 12;
|
||||
#X text 460 422 updated for Pd version 0.26;
|
||||
#X text 35 28 Use the "random" object to make pseudo-random integers.
|
||||
To get continuously variable random numbers \, make a random number
|
||||
in a large range and divide:;
|
||||
#X obj 103 121 random 5;
|
||||
#X msg 103 95 bang;
|
||||
#X floatatom 103 147 0 0 0;
|
||||
#X text 137 147 outputs from 0 to 4;
|
||||
#X msg 337 87 bang;
|
||||
#X floatatom 336 165 0 0 0;
|
||||
#X obj 337 113 random 1000;
|
||||
#X obj 336 141 / 1000;
|
||||
#X text 402 166 from 0 to 0.999;
|
||||
#X obj 71 324 random 5;
|
||||
#X msg 162 255 bang;
|
||||
#X floatatom 71 350 0 0 0;
|
||||
#X obj 71 244 loadbang;
|
||||
#X obj 71 274 timer;
|
||||
#X text 204 255 <-- click to seed;
|
||||
#X msg 71 299 seed \$1;
|
||||
#X msg 163 299 bang;
|
||||
#X text 204 300 <-- click to get random numbers;
|
||||
#X text 24 382 If you give two randoms the same seed they give the
|
||||
same sequence. If you never seed them \, you'll get different sequences
|
||||
out of each one.;
|
||||
#X text 34 197 If you don't want the same behavior every time you run
|
||||
the patch \, use the time from load to first click as a seed:;
|
||||
#X connect 2 0 4 0;
|
||||
#X connect 3 0 2 0;
|
||||
#X connect 6 0 8 0;
|
||||
#X connect 8 0 9 0;
|
||||
#X connect 9 0 7 0;
|
||||
#X connect 11 0 13 0;
|
||||
#X connect 12 0 15 1;
|
||||
#X connect 14 0 15 0;
|
||||
#X connect 15 0 17 0;
|
||||
#X connect 17 0 11 0;
|
||||
#X connect 18 0 11 0;
|
44
pd-0.44-2/doc/2.control.examples/20.weighted-random.pd
Normal file
|
@ -0,0 +1,44 @@
|
|||
#N canvas 161 46 660 441 12;
|
||||
#X msg 103 95 bang;
|
||||
#X text 389 414 updated for Pd version 0.35;
|
||||
#X text 44 19 You can generate weighted random numbers from uniformly
|
||||
distributed ones. If you just want two possible outcomes with a varying
|
||||
probability for each one \, you can do as shown:;
|
||||
#X obj 103 121 random 100;
|
||||
#X obj 102 174 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 169 174 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X floatatom 205 148 3 0 100;
|
||||
#X text 250 148 <-- change probablilty;
|
||||
#X obj 103 149 moses 80;
|
||||
#X text 152 93 <-- click to test;
|
||||
#X text 61 219 This outputs a number at left 80% of the time \, otherwise
|
||||
at right \, unless you override the "80" using the number box. You
|
||||
may extend this to more than two possible outcomes \, for instance
|
||||
like this:;
|
||||
#X msg 106 305 bang;
|
||||
#X obj 106 331 random 100;
|
||||
#X obj 105 384 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 195 387 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X text 155 303 <-- click to test;
|
||||
#X obj 106 359 moses 10;
|
||||
#X obj 196 360 moses 30;
|
||||
#X obj 263 387 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X text 103 409 10%;
|
||||
#X text 193 410 20%;
|
||||
#X text 265 409 70%;
|
||||
#X connect 0 0 3 0;
|
||||
#X connect 3 0 8 0;
|
||||
#X connect 6 0 8 1;
|
||||
#X connect 8 0 4 0;
|
||||
#X connect 8 1 5 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 12 0 16 0;
|
||||
#X connect 16 0 13 0;
|
||||
#X connect 16 1 17 0;
|
||||
#X connect 17 0 14 0;
|
||||
#X connect 17 1 18 0;
|
105
pd-0.44-2/doc/2.control.examples/21.markov.chain.pd
Normal file
|
@ -0,0 +1,105 @@
|
|||
#N canvas 296 90 662 442 12;
|
||||
#X obj 84 251 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 81 336 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 162 335 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 199 337 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X msg 81 358 1;
|
||||
#X msg 162 360 2;
|
||||
#X msg 199 361 3;
|
||||
#X obj 81 386 s state;
|
||||
#X obj 66 173 bng 20 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 105 164 r state;
|
||||
#X obj 83 225 sel 1 2 3;
|
||||
#X obj 255 253 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 252 338 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 334 340 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 373 343 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X msg 252 361 1;
|
||||
#X msg 329 366 2;
|
||||
#X msg 373 367 3;
|
||||
#X obj 252 394 s state;
|
||||
#X obj 419 254 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 419 339 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 499 338 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 538 341 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
|
||||
-1;
|
||||
#X msg 419 362 1;
|
||||
#X msg 499 363 2;
|
||||
#X msg 538 364 3;
|
||||
#X obj 418 395 s state;
|
||||
#X msg 236 186 \; state 1;
|
||||
#X obj 83 199 f 1;
|
||||
#X obj 84 279 random 100;
|
||||
#X obj 83 308 moses 30;
|
||||
#X obj 162 309 moses 60;
|
||||
#X obj 255 280 random 100;
|
||||
#X obj 255 310 moses 10;
|
||||
#X obj 334 311 moses 60;
|
||||
#X obj 419 281 random 100;
|
||||
#X obj 419 310 moses 70;
|
||||
#X obj 499 310 moses 80;
|
||||
#X floatatom 134 188 3 0 0;
|
||||
#X text 236 166 reset;
|
||||
#X text 49 152 STEP;
|
||||
#X text 34 20 Here is how to construct a simple \, three-valued Markov
|
||||
chain using "random." Each time you click on "step" the previous output
|
||||
("state") determines which of three random networks to invoke \, each
|
||||
having a different probability distribution for the next value of "state."
|
||||
For instance if the state was 3 \, the next state will be 1 70% of
|
||||
the time \, state 2 10% \, and state 3 20%.;
|
||||
#X text 408 422 updated for Pd version 0.35;
|
||||
#X connect 0 0 29 0;
|
||||
#X connect 1 0 4 0;
|
||||
#X connect 2 0 5 0;
|
||||
#X connect 3 0 6 0;
|
||||
#X connect 4 0 7 0;
|
||||
#X connect 5 0 7 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 8 0 28 0;
|
||||
#X connect 9 0 28 1;
|
||||
#X connect 9 0 38 0;
|
||||
#X connect 10 0 0 0;
|
||||
#X connect 10 1 11 0;
|
||||
#X connect 10 2 19 0;
|
||||
#X connect 11 0 32 0;
|
||||
#X connect 12 0 15 0;
|
||||
#X connect 13 0 16 0;
|
||||
#X connect 14 0 17 0;
|
||||
#X connect 15 0 18 0;
|
||||
#X connect 16 0 18 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 19 0 35 0;
|
||||
#X connect 20 0 23 0;
|
||||
#X connect 21 0 24 0;
|
||||
#X connect 22 0 25 0;
|
||||
#X connect 23 0 26 0;
|
||||
#X connect 24 0 26 0;
|
||||
#X connect 25 0 26 0;
|
||||
#X connect 28 0 10 0;
|
||||
#X connect 29 0 30 0;
|
||||
#X connect 30 0 1 0;
|
||||
#X connect 30 1 31 0;
|
||||
#X connect 31 0 2 0;
|
||||
#X connect 31 1 3 0;
|
||||
#X connect 32 0 33 0;
|
||||
#X connect 33 0 12 0;
|
||||
#X connect 33 1 34 0;
|
||||
#X connect 34 0 13 0;
|
||||
#X connect 34 1 14 0;
|
||||
#X connect 35 0 36 0;
|
||||
#X connect 36 0 20 0;
|
||||
#X connect 36 1 37 0;
|
||||
#X connect 37 0 21 0;
|
||||
#X connect 37 1 22 0;
|
64
pd-0.44-2/doc/2.control.examples/22.random-walk.pd
Normal file
|
@ -0,0 +1,64 @@
|
|||
#N canvas 0 0 604 511 12;
|
||||
#X floatatom 113 218 5 0 0 0 - - -;
|
||||
#X obj 123 113 f;
|
||||
#X obj 104 198 random 4;
|
||||
#X obj 26 197 random 2;
|
||||
#X floatatom 35 219 5 0 0 0 - - -;
|
||||
#X obj 123 138 t b b f;
|
||||
#X obj 26 253 sel 0 1;
|
||||
#X obj 159 328 +;
|
||||
#X obj 123 87 metro 100;
|
||||
#X obj 123 65 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
|
||||
;
|
||||
#X obj 104 252 + 1;
|
||||
#X floatatom 242 153 5 0 0 0 - - -;
|
||||
#X obj 82 309 *;
|
||||
#X msg 26 282 -1;
|
||||
#X obj 242 83 moses 0;
|
||||
#X obj 316 83 moses 100;
|
||||
#X obj 242 107 * -1;
|
||||
#X obj 407 86 * -1;
|
||||
#X obj 407 111 + 200;
|
||||
#X msg 60 282 1;
|
||||
#X text 39 9 Random walk generator;
|
||||
#X text 143 64 on/off;
|
||||
#X text 298 152 output;
|
||||
#X text 22 375 A random walk is a special case of a Markov chain \,
|
||||
in which the states are integers and the transitions add or subtract
|
||||
a small amount from the previous state to get a new one. Here the "f"
|
||||
holds the state. When it gets a bang \, the previous state is added
|
||||
to a random number (from 1 to 4) multiplied by a random sign (-1 or
|
||||
1). The new value is then coerced into the range from 0 to 100;
|
||||
#X text 35 235 sign;
|
||||
#X text 113 234 magnitude;
|
||||
#X text 203 313 add prev value;
|
||||
#X text 200 330 to random increment;
|
||||
#X text 256 30 coercion to range 0-100 \; if out of range \, reflect
|
||||
;
|
||||
#X text 255 60 us back in.;
|
||||
#X text 323 492 updated for Pd version 0.37-1;
|
||||
#X connect 1 0 5 0;
|
||||
#X connect 2 0 0 0;
|
||||
#X connect 2 0 10 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 3 0 6 0;
|
||||
#X connect 5 0 3 0;
|
||||
#X connect 5 1 2 0;
|
||||
#X connect 5 2 7 1;
|
||||
#X connect 6 0 13 0;
|
||||
#X connect 6 1 19 0;
|
||||
#X connect 7 0 14 0;
|
||||
#X connect 8 0 1 0;
|
||||
#X connect 9 0 8 0;
|
||||
#X connect 10 0 12 1;
|
||||
#X connect 11 0 1 1;
|
||||
#X connect 12 0 7 0;
|
||||
#X connect 13 0 12 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 14 1 15 0;
|
||||
#X connect 15 0 11 0;
|
||||
#X connect 15 1 17 0;
|
||||
#X connect 16 0 11 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 18 0 11 0;
|
||||
#X connect 19 0 12 0;
|
28
pd-0.44-2/doc/2.control.examples/23.sequencing.pd
Normal file
|
@ -0,0 +1,28 @@
|
|||
#N canvas 47 52 758 482 12;
|
||||
#X text 465 442 updated for Pd version 0.26;
|
||||
#X text 35 28 You can use "qlist" or "textfile" objects for sequencing.
|
||||
Qlist is simpler to use than the (more versatile) textfile.;
|
||||
#X obj 345 144 r receive1;
|
||||
#X obj 441 146 r receive2;
|
||||
#X msg 205 88 clear \, add receive1 1 \, add 1000 receive1 0 \, add
|
||||
receive2 2 \, add 1000 receive2 0 \, add receive1 3 \, bang;
|
||||
#X obj 205 129 qlist;
|
||||
#X floatatom 345 170 0 0 0 0 - - -;
|
||||
#X floatatom 441 171 0 0 0 0 - - -;
|
||||
#X text 48 202 The "add" messages add lines to the qlist \, so that
|
||||
it contains:;
|
||||
#X text 155 238 receive1 1;
|
||||
#X text 154 259 1000 receive1 0;
|
||||
#X text 155 279 receive2 2;
|
||||
#X text 153 299 1000 receive2 0;
|
||||
#X text 155 317 receive1 3;
|
||||
#X text 16 391 If you have more than 5 lines or so wou will probably
|
||||
want to store them as a separate file and have qlist read it. You can
|
||||
also write files \, set tempo \, and single step... see the help patch
|
||||
for details.;
|
||||
#X text 22 341 and the "bang" instructs qlist to play the sequence
|
||||
by sending messages to "receive" objects. Messages starting with numbers
|
||||
request that amount of delay.;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 3 0 7 0;
|
||||
#X connect 4 0 5 0;
|
49
pd-0.44-2/doc/2.control.examples/24.loops.pd
Normal file
|
@ -0,0 +1,49 @@
|
|||
#N canvas 258 107 701 742 12;
|
||||
#X obj 195 318 until;
|
||||
#X obj 221 284 max 0;
|
||||
#X floatatom 221 263 5 0 0 1 times - -;
|
||||
#X text 229 234 times;
|
||||
#X obj 195 342 print repetition;
|
||||
#X msg 195 234 5;
|
||||
#X obj 175 571 + 1;
|
||||
#X obj 118 572 float;
|
||||
#X obj 118 546 until;
|
||||
#X obj 118 606 moses 10;
|
||||
#X obj 233 558 bang;
|
||||
#X obj 118 639 print number;
|
||||
#X msg 118 524 bang;
|
||||
#X msg 196 529 0;
|
||||
#X text 241 529 reset;
|
||||
#X text 277 560 stop "until" when counter reaches 10;
|
||||
#X text 479 711 updated for Pd 0.41;
|
||||
#X text 31 16 Looping with the "until" object;
|
||||
#X text 52 47 It is sometimes desirable to make a loop without an embedded
|
||||
delay (as in 06.more.counters.pd") but rather to make the entire loop
|
||||
take place in the context of a single incoming message. The "until"
|
||||
object is provided to make this possible.;
|
||||
#X text 273 285 make nonnegative;
|
||||
#X text 56 445 Conditional loops get started with a "bang" to until's
|
||||
left inlet. Make sure you stop the loop with a "bang" to until's right
|
||||
inlet \, otherwise it will try to run forever and Pd will freeze!;
|
||||
#X text 48 131 "until" has two modes: It can either run automatically
|
||||
for a certain number of times (a "counting" loop) or it can run forever
|
||||
until stopped through its right inlet (a "conditional" loop).;
|
||||
#X text 47 196 You can perform a counting loop by sending a positive
|
||||
number to until:;
|
||||
#X text 55 398 (As of version 0.41 \, "until" silently interprets negative
|
||||
numbers to be equivalent to zero.);
|
||||
#X text 62 667 In pseudo-code: "x=0 \; do print x++ until x>=10";
|
||||
#X text 57 368 In pseudo-code: "for i = 1 to 5 do print end";
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 0 0;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 5 0 0 0;
|
||||
#X connect 6 0 7 1;
|
||||
#X connect 7 0 6 0;
|
||||
#X connect 7 0 9 0;
|
||||
#X connect 8 0 7 0;
|
||||
#X connect 9 0 11 0;
|
||||
#X connect 9 1 10 0;
|
||||
#X connect 10 0 8 1;
|
||||
#X connect 12 0 8 0;
|
||||
#X connect 13 0 7 1;
|
35
pd-0.44-2/doc/2.control.examples/dollarsign.pd
Normal file
|
@ -0,0 +1,35 @@
|
|||
#N canvas 62 73 586 361 12;
|
||||
#X obj 207 44 inlet;
|
||||
#X obj 207 71 s \$1-a;
|
||||
#X obj 302 72 s \$1-b;
|
||||
#X text 331 337 updated for Pd version 0.34;
|
||||
#X text 63 7 This is an abstraction used in example 12 \, "locality".
|
||||
;
|
||||
#X obj 302 47 inlet;
|
||||
#X obj 62 249 s \$1-c;
|
||||
#X obj 62 279 r \$1-c;
|
||||
#X floatatom 62 218 5 0 0;
|
||||
#X floatatom 62 307 5 0 0;
|
||||
#X obj 164 250 s here's-what-happens-if-you-dont;
|
||||
#X obj 163 280 r here's-what-happens-if-you-dont;
|
||||
#X floatatom 163 308 5 0 0;
|
||||
#X floatatom 164 220 5 0 0;
|
||||
#X floatatom 487 224 5 0 0;
|
||||
#X floatatom 488 307 5 0 0;
|
||||
#X obj 487 251 s \$0-d;
|
||||
#X obj 488 281 r \$0-d;
|
||||
#X text 47 94 The sends above get named "one-a" \, etc. The window
|
||||
title bar tells you the creation arguments for this particular instance.
|
||||
You can use this to make internal local connections as shown below.
|
||||
The "$1-c" boxes act locally whereas the middle boxes get crosstalk
|
||||
between the windows. The boxes at right also get unique names but in
|
||||
this case you don't have to secify "$0" \, it's just something unique.
|
||||
;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 5 0 2 0;
|
||||
#X connect 7 0 9 0;
|
||||
#X connect 8 0 6 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 13 0 10 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 17 0 15 0;
|
54
pd-0.44-2/doc/2.control.examples/dollarsign2.pd
Normal file
|
@ -0,0 +1,54 @@
|
|||
#N canvas 22 54 588 671 12;
|
||||
#X text 324 642 updated for Pd version 0.34;
|
||||
#X text 34 6 This is an abstraction used in example 13 \, "dollarsigns".
|
||||
;
|
||||
#X obj 88 107 send \$1;
|
||||
#X obj 199 106 + \$2;
|
||||
#X floatatom 303 88 0 0 0;
|
||||
#X obj 303 139 print;
|
||||
#X msg 303 113 blah \$1;
|
||||
#X text 36 163 This may sound inconsistant \, but it's not--object
|
||||
and message boxes are both actually messages \, but in the case of
|
||||
the Object box the message is passed at creation time \, and for the
|
||||
Message box \, at message time.;
|
||||
#X msg 188 272 bang;
|
||||
#X obj 188 300 symbol \$1;
|
||||
#X msg 98 272 bang;
|
||||
#X obj 98 300 float \$2;
|
||||
#X floatatom 98 327 5 0 0;
|
||||
#X symbolatom 188 329 10 0 0;
|
||||
#X text 36 233 So how do you put creation arguments in messages? Use
|
||||
"float" and "symbol" as shown:;
|
||||
#X msg 97 383 bang;
|
||||
#X obj 97 407 float \$2;
|
||||
#X msg 97 434 five \$1;
|
||||
#X text 41 357 Then if you wish \, connect to a message box as in:
|
||||
;
|
||||
#X obj 97 459 print;
|
||||
#X msg 143 512 bang;
|
||||
#X obj 143 564 symbol \$1;
|
||||
#X obj 237 560 f \$2;
|
||||
#X obj 143 540 t b b;
|
||||
#X obj 142 587 pack symbol float;
|
||||
#X msg 142 613 six \$1 \$2;
|
||||
#X obj 142 640 print;
|
||||
#X text 31 485 For messages combining more than one creation argument
|
||||
try:;
|
||||
#X text 37 50 In Object boxes \, dollar signs refer to the abstraction's
|
||||
creation arguments. In Messages \, they change dynamically:;
|
||||
#X connect 4 0 6 0;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 8 0 9 0;
|
||||
#X connect 9 0 13 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 15 0 16 0;
|
||||
#X connect 16 0 17 0;
|
||||
#X connect 17 0 19 0;
|
||||
#X connect 20 0 23 0;
|
||||
#X connect 21 0 24 0;
|
||||
#X connect 22 0 24 1;
|
||||
#X connect 23 0 21 0;
|
||||
#X connect 23 1 22 0;
|
||||
#X connect 24 0 25 0;
|
||||
#X connect 25 0 26 0;
|
20
pd-0.44-2/doc/2.control.examples/sendnumber.pd
Normal file
|
@ -0,0 +1,20 @@
|
|||
#N canvas 171 73 718 283 12;
|
||||
#X obj 34 60 inlet;
|
||||
#X obj 34 88 float \$1;
|
||||
#X obj 34 116 send \$2;
|
||||
#X text 26 225 For obvious reasons you might not want to call a patch
|
||||
as an abstraction from itself.;
|
||||
#X text 151 183 In this case \$1 is a number you can specify and \$2
|
||||
is a "send" destination.;
|
||||
#X text 461 260 updated for Pd version 0.26;
|
||||
#X text 154 103 When you call an abstraction by typing \, say \, "sendnumber
|
||||
1 x" in an object box. the subpatch can access the values of the creation
|
||||
arguments (1 and x) as "$1" and "$2" innside object boxes. Typing \$1
|
||||
inside a message box has a different meaning (see the message box help
|
||||
window.);
|
||||
#X text 155 31 This window is used by 11.subpatch.pd to demonstrate
|
||||
the abstraction mechanism in Pd. If you've opened this window directly
|
||||
\, you might also want to open the other one to see how it's used.
|
||||
;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 1 0 2 0;
|
10
pd-0.44-2/doc/3.audio.examples/A00.intro.pd
Normal file
|
@ -0,0 +1,10 @@
|
|||
#N canvas 440 252 579 286 12;
|
||||
#X text 87 6 INTRODUCTION TO THE PD AUDIO EXAMPLE PATCHES;
|
||||
#X text 328 257 updated for Pd version 0.37;
|
||||
#X text 34 45 This is the second of three tutorial series on Pd. This
|
||||
one shows the time-domain audio processing features. (The first one
|
||||
showed how to use Pd to do "control" computations \, and the third
|
||||
is about frequency-domain techniques.);
|
||||
#X text 33 125 These patches are accompanied by an ONLINE BOOK:;
|
||||
#X text 100 158 http://www.crca.ucsd.edu/~msp/techniques.htm;
|
||||
#X text 37 189 which develops the underlying theory.;
|
9
pd-0.44-2/doc/3.audio.examples/A00.intro.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
This is the second of three tutorial series on Pd. This one shows the
|
||||
time-domain audio processing features. (The first one showed how to use Pd to
|
||||
do "control" computations, and the third is about frequency-domain techniques.)
|
||||
|
||||
These patches are accompanied by an ONLINE BOOK:
|
||||
|
||||
http://www.crca.ucsd.edu/~msp/techniques.htm
|
||||
|
||||
which develops the underlying theory.
|
32
pd-0.44-2/doc/3.audio.examples/A01.sinewave.pd
Normal file
|
@ -0,0 +1,32 @@
|
|||
#N canvas 6 2 588 513 12;
|
||||
#X obj 108 109 osc~ 440;
|
||||
#X obj 108 168 dac~;
|
||||
#X text 187 111 <-- 440 Hz. sine wave at full blast;
|
||||
#X obj 108 138 *~ 0.05;
|
||||
#X text 202 3 MAKING A SINE WAVE;
|
||||
#X text 32 195 Audio computation can be turned on and off by sending
|
||||
messages to the global "pd" object as follows:;
|
||||
#X msg 98 239 \; pd dsp 1;
|
||||
#X msg 202 239 \; pd dsp 0;
|
||||
#X text 113 276 ON;
|
||||
#X text 222 276 OFF;
|
||||
#X text 29 297 You should see the Pd window change to reflect whether
|
||||
audio is on or off. You can also turn audio on and off using the "audio"
|
||||
menu \, but the buttons are provided as a shortcut.;
|
||||
#X text 30 368 When DSP is on \, you should hear a tone whose pitch
|
||||
is A 440 and whose amplitude is 0.05. If instead you are greeted with
|
||||
silence \, you might want to read the HTML documentation on setting
|
||||
up audio.;
|
||||
#X text 28 434 In general when you start a work session with Pd \,
|
||||
you will want to choose "test audio and MIDI" from the help window
|
||||
\, which opens a more comprehensive test patch than this one.;
|
||||
#X text 296 247 <-- click these;
|
||||
#X text 187 139 <-- reduce amplitude to 0.05;
|
||||
#X text 160 168 <----- send to the audio output device;
|
||||
#X text 32 23 Audio computation in Pd is done using "tilde objects"
|
||||
such as the three below. They use continuous audio streams to intercommunicate
|
||||
\, as well as communicating with other ("control") Pd objects using
|
||||
messages.;
|
||||
#X text 342 490 updated for Pd version 0.36;
|
||||
#X connect 0 0 3 0;
|
||||
#X connect 3 0 1 0;
|
37
pd-0.44-2/doc/3.audio.examples/A02.amplitude.pd
Normal file
|
@ -0,0 +1,37 @@
|
|||
#N canvas 73 190 702 512 12;
|
||||
#X obj 64 65 osc~ 440;
|
||||
#X obj 64 283 dac~;
|
||||
#X text 145 66 <-- 440 Hz. sine wave at full blast;
|
||||
#X msg 431 7 \; pd dsp 1;
|
||||
#X msg 514 7 \; pd dsp 0;
|
||||
#X text 456 45 ON;
|
||||
#X text 534 43 OFF;
|
||||
#X text 164 18 CONTROLLING AMPLITUDE;
|
||||
#X text 35 327 Amplitudes of audio signals can have any reasonable
|
||||
range \, but when you output a signal via the dac~ object \, the samples
|
||||
should range between -1 and +1. Values out of that range will be "clipped."
|
||||
;
|
||||
#X obj 64 202 *~ 0;
|
||||
#X floatatom 107 165 0 0 0 0 - - -;
|
||||
#X obj 95 132 dbtorms;
|
||||
#X floatatom 95 100 0 0 80 0 - - -;
|
||||
#X text 141 100 <-- set amplitude here in dB;
|
||||
#X text 211 133 <-- this converts dB to linear units;
|
||||
#X text 210 164 <-- this shows the linear gain;
|
||||
#X text 116 204 <-- multiply the sine wave by the gain \, reducing
|
||||
its amplitude. You can also use the "*~" object to multiply two signals.
|
||||
The "0" argument here instructs it that we'll just send it messages
|
||||
to set the multiplier.;
|
||||
#X text 35 396 Here we calculate a gain for the multiplier (*~) using
|
||||
a "dbtorms" object (acronym for "dB to RMS"). 100 dB is normalized
|
||||
to one \, and zero dB artificially outputs a true 0;
|
||||
#X text 34 452 Pd assumes you have a two channel audio system unless
|
||||
you tell it otherwise.;
|
||||
#X text 440 486 updated for Pd version 0.33;
|
||||
#X text 114 282 <-- and out. We're sending to both channels now.;
|
||||
#X connect 0 0 9 0;
|
||||
#X connect 9 0 1 0;
|
||||
#X connect 9 0 1 1;
|
||||
#X connect 11 0 9 1;
|
||||
#X connect 11 0 10 0;
|
||||
#X connect 12 0 11 0;
|
55
pd-0.44-2/doc/3.audio.examples/A03.line.pd
Normal file
|
@ -0,0 +1,55 @@
|
|||
#N canvas 369 106 647 598 12;
|
||||
#X obj 56 79 osc~ 440;
|
||||
#X obj 56 309 dac~;
|
||||
#X msg 446 79 \; pd dsp 1;
|
||||
#X msg 538 79 \; pd dsp 0;
|
||||
#X text 467 112 ON;
|
||||
#X text 555 112 OFF;
|
||||
#X obj 56 269 *~;
|
||||
#X obj 72 243 line~;
|
||||
#X text 129 243 <--- ramp generator;
|
||||
#X text 132 78 <-- sine wave;
|
||||
#X msg 72 103 0.1 2000;
|
||||
#X msg 72 177 0 2000;
|
||||
#X msg 72 125 0.1 50;
|
||||
#X msg 72 199 0 50;
|
||||
#X msg 72 147 0.1;
|
||||
#X msg 72 221 0;
|
||||
#X text 274 124 ON;
|
||||
#X text 154 105 <-- slow;
|
||||
#X text 144 126 <-- fast;
|
||||
#X text 111 146 <-- instantly;
|
||||
#X text 271 197 OFF;
|
||||
#X text 136 178 <-- slow;
|
||||
#X text 129 199 <-- fast;
|
||||
#X text 109 219 <-- instantly;
|
||||
#X text 112 161 ----------------------;
|
||||
#X text 97 308 <-- out;
|
||||
#X text 103 7 CONTROLLING AMPLITUDE USING LINE~;
|
||||
#X text 38 342 Line~'s left inlet is a target value \; it reaches that
|
||||
target in the time specified (in milliseconds) to its right inlet.
|
||||
;
|
||||
#X text 34 495 The line~ object (and its control brother \, line) treat
|
||||
their right inlet specially. The inlets don't retain values the way
|
||||
other inlets do but revert to zero whenever a target is received.;
|
||||
#X text 14 27 In this patch \, the multiplier is configured to multiply
|
||||
two signals. The amplitude is now a signal computed by the line~ object.
|
||||
;
|
||||
#X text 37 395 (In this example \, message boxes with two numbers each
|
||||
are connected to line~'s left inlet. Except in some special cases \,
|
||||
Pd objects with more than one inlet will automatically distribute lists
|
||||
of numbers across their inlets. In this case \, "0 50" becomes \, "50
|
||||
at right and 0 at left.");
|
||||
#X text 386 557 updated for Pd version 0.36;
|
||||
#X text 93 268 <-- multiply the sine wave by the ramp. There's no longer
|
||||
a "0" argument-- this tells Pd to expect a signal here.;
|
||||
#X connect 0 0 6 0;
|
||||
#X connect 6 0 1 0;
|
||||
#X connect 6 0 1 1;
|
||||
#X connect 7 0 6 1;
|
||||
#X connect 10 0 7 0;
|
||||
#X connect 11 0 7 0;
|
||||
#X connect 12 0 7 0;
|
||||
#X connect 13 0 7 0;
|
||||
#X connect 14 0 7 0;
|
||||
#X connect 15 0 7 0;
|
59
pd-0.44-2/doc/3.audio.examples/A04.line2.pd
Normal file
|
@ -0,0 +1,59 @@
|
|||
#N canvas 30 68 949 754 12;
|
||||
#X obj 67 77 osc~ 440;
|
||||
#X obj 67 329 dac~;
|
||||
#X obj 67 242 *~;
|
||||
#X obj 86 180 line~;
|
||||
#X text 116 330 <-- out;
|
||||
#X text 124 9 LINES GRAPHED;
|
||||
#X text 24 33 Here again is a line~ controlling the amplitude of an
|
||||
osc~ \, but with the outputs graphed:;
|
||||
#X obj 149 89 r graphit;
|
||||
#X obj 151 179 r graphit;
|
||||
#X obj 151 246 r graphit;
|
||||
#X obj 86 149 r to-line;
|
||||
#X graph graph1 0 -1.02 44100 1.02 631 480 831 350;
|
||||
#X array product 44100 float 0;
|
||||
#X pop;
|
||||
#X graph graph1 0 -1.02 44100 1.02 631 150 831 20;
|
||||
#X array osc-output 44100 float 0;
|
||||
#X pop;
|
||||
#X graph graph1 0 -1.02 44100 1.02 631 315 831 185;
|
||||
#X array line-output 44100 float 0;
|
||||
#X pop;
|
||||
#X obj 149 119 tabwrite~ osc-output;
|
||||
#X obj 67 299 *~ 0.1;
|
||||
#X msg 38 401 \; pd dsp 1 \; to-line 0 \, 1 500 \; graphit bang;
|
||||
#X msg 210 401 \; pd dsp 1 \; to-line 1 \, 0 500 \; graphit bang;
|
||||
#X obj 151 209 tabwrite~ line-output;
|
||||
#X obj 151 276 tabwrite~ product;
|
||||
#X text 70 379 ramp up;
|
||||
#X text 235 378 ramp down;
|
||||
#X text 406 376 to 1/2;
|
||||
#X msg 375 400 \; pd dsp 1 \; to-line 0.5 1000 \; graphit bang;
|
||||
#X text 634 491 ------ 1 second ------;
|
||||
#X text 38 485 Click the message boxes above to try it. Note that in
|
||||
the first two boxes \, the line~ objects get two messages. The first
|
||||
one \, with no time value \, causes the line~ to jump immediately to
|
||||
the value. The third box takes line~'s previous value as a point of
|
||||
departure. What you see will depend on which box you last clicked and
|
||||
how long you waited between the two.;
|
||||
#X text 662 727 updated for Pd version 0.33;
|
||||
#X text 41 600 On most machines \, you will hear an interruption in
|
||||
the sound one second after you click on the first or third box. This
|
||||
is because the graphical updates are likely to eat more CPU time than
|
||||
your audio buffer has pre-buffered for. You can avoid this if you keep
|
||||
your graphs in sub-windows and open them only when you need them. In
|
||||
some future version of Pd this behavior will be improved. Until then
|
||||
\, you'll have to avoid having arrays getting re-drawn during music
|
||||
performances.;
|
||||
#X connect 0 0 2 0;
|
||||
#X connect 0 0 14 0;
|
||||
#X connect 2 0 15 0;
|
||||
#X connect 2 0 19 0;
|
||||
#X connect 3 0 2 1;
|
||||
#X connect 3 0 18 0;
|
||||
#X connect 7 0 14 0;
|
||||
#X connect 8 0 18 0;
|
||||
#X connect 9 0 19 0;
|
||||
#X connect 10 0 3 0;
|
||||
#X connect 15 0 1 0;
|
30
pd-0.44-2/doc/3.audio.examples/A05.output.subpatch.pd
Normal file
|
@ -0,0 +1,30 @@
|
|||
#N canvas 300 159 635 486 12;
|
||||
#X text 261 20 CONTROLLING OUTPUT AMPLITUDE;
|
||||
#X obj 32 27 osc~ 440;
|
||||
#X obj 54 55 osc~ 550;
|
||||
#X obj 54 116 osc~ 660;
|
||||
#X obj 32 88 +~;
|
||||
#X obj 32 142 +~;
|
||||
#X text 108 177 <-- this is a subwindow--right click on it;
|
||||
#X text 149 197 and select "open" to see inside.;
|
||||
#X text 30 401 The output control automatically starts DSP whenever
|
||||
you touch the level control. Hitting "mute" toggles between the current
|
||||
level and zero.;
|
||||
#X obj 32 173 output~;
|
||||
#X text 383 463 updated for Pd version 0.36;
|
||||
#X text 143 115 <-- Here we make an A major triad as a test signal.
|
||||
;
|
||||
#X text 31 250 In this and subsequent patches \, we'll use a subwindow
|
||||
\, "output" \, to control overall amplitude. The amplitudes are in
|
||||
decibels \, with 100 being full blast. In this example \, you can't
|
||||
actually push the output amplitude past 90 or so without clipping.
|
||||
You'll know you're clipping if \, instead of an A major chord \, you
|
||||
hear a single \, distorted tone two octaves down. The clipping happens
|
||||
at Pd's last stage of audio output. Audio signals internal to Pd have
|
||||
essentially no level limit.;
|
||||
#X connect 1 0 4 0;
|
||||
#X connect 2 0 4 1;
|
||||
#X connect 3 0 5 1;
|
||||
#X connect 4 0 5 0;
|
||||
#X connect 5 0 9 0;
|
||||
#X connect 5 0 9 1;
|
61
pd-0.44-2/doc/3.audio.examples/A06.frequency.pd
Normal file
|
@ -0,0 +1,61 @@
|
|||
#N canvas 8 17 693 642 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array osc-output 4410 float 0;
|
||||
#X coords 0 1.02 4410 -1.02 200 130 1;
|
||||
#X restore 473 167 graph;
|
||||
#X obj 98 261 tabwrite~ osc-output;
|
||||
#X msg 98 232 bang;
|
||||
#X floatatom 280 66 0 0 0 0 - - -;
|
||||
#X text 147 231 <-- click to graph;
|
||||
#X obj 15 206 r frequency;
|
||||
#X msg 280 37 set \$1;
|
||||
#X floatatom 6 66 0 0 0 0 - - -;
|
||||
#X obj 6 8 r frequency;
|
||||
#X msg 6 37 set \$1;
|
||||
#X obj 19 90 s frequency;
|
||||
#X obj 280 8 r pitch;
|
||||
#X obj 289 90 s pitch;
|
||||
#X obj 280 116 mtof;
|
||||
#X obj 280 145 s frequency;
|
||||
#X obj 6 145 s pitch;
|
||||
#X obj 6 116 ftom;
|
||||
#X text 105 66 <-- set frequency;
|
||||
#X text 372 65 <-- set MIDI pitch;
|
||||
#X text 15 429 Frequency and pitch are converted using the "ftom" and
|
||||
"mtof" objects. Frequency refers to the number of cycles per second.
|
||||
Pitch is "60" for Middle C \, 61 for C sharp \, 72 for the next C up
|
||||
\, and so on.;
|
||||
#X text 476 308 ---- 0.1 seconds ----;
|
||||
#X text 447 6 FREQUENCY AND PITCH;
|
||||
#X text 16 363 The osc~ object \, if you give it an argument \, expects
|
||||
floating-point messages to set its frequency. Without arguments \,
|
||||
its frequency is controlled by connecting an audio signal to its input.
|
||||
;
|
||||
#X text 14 496 Mtof and ftom work fine for microtones (non-integral
|
||||
"MIDI pitch" ) and don't have MIDI's range restriction-- for example
|
||||
\, MIDI -36 is about 1 Hz.;
|
||||
#X text 15 553 Note also the "set" messages going to the number boxes
|
||||
so that they can each update the other without bringing on an infinite
|
||||
loop. (get help on number boxes for details.);
|
||||
#X text 87 291 <-- output level;
|
||||
#X text 51 116 <-- convert frequency;
|
||||
#X text 106 134 to "MIDI" pitch;
|
||||
#X text 327 117 <-- convert "MIDI" pitch to frequency;
|
||||
#X obj 15 273 output~;
|
||||
#X text 437 619 updated for Pd version 0.36;
|
||||
#X obj 15 232 osc~;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 12 0;
|
||||
#X connect 3 0 13 0;
|
||||
#X connect 5 0 31 0;
|
||||
#X connect 6 0 3 0;
|
||||
#X connect 7 0 10 0;
|
||||
#X connect 7 0 16 0;
|
||||
#X connect 8 0 9 0;
|
||||
#X connect 9 0 7 0;
|
||||
#X connect 11 0 6 0;
|
||||
#X connect 13 0 14 0;
|
||||
#X connect 16 0 15 0;
|
||||
#X connect 31 0 1 0;
|
||||
#X connect 31 0 29 0;
|
||||
#X connect 31 0 29 1;
|
76
pd-0.44-2/doc/3.audio.examples/A07.fusion.pd
Normal file
|
@ -0,0 +1,76 @@
|
|||
#N canvas 18 14 650 653 12;
|
||||
#X floatatom 32 60 0 0 0 0 - - -;
|
||||
#X obj 32 86 mtof;
|
||||
#X obj 32 323 output~;
|
||||
#X msg 32 34 60;
|
||||
#X text 67 63 <-- choose a pitch;
|
||||
#X text 68 34 <-- reset to middle C;
|
||||
#X obj 32 154 osc~;
|
||||
#X obj 73 130 * 2;
|
||||
#X obj 73 154 osc~;
|
||||
#X obj 137 154 osc~;
|
||||
#X obj 137 130 * 3;
|
||||
#X obj 201 155 osc~;
|
||||
#X obj 201 131 * 4;
|
||||
#X obj 137 179 *~ 0.2;
|
||||
#X obj 33 289 +~;
|
||||
#X obj 74 259 *~;
|
||||
#X obj 109 260 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
|
||||
1;
|
||||
#X obj 74 210 +~;
|
||||
#X obj 74 234 +~;
|
||||
#X text 133 7 Adding sinusoids to make a complex tone;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array tab.01.07 882 float 0;
|
||||
#X coords 0 1.02 881 -1.02 200 130 1;
|
||||
#X restore 426 222 graph;
|
||||
#X msg 116 295 bang;
|
||||
#X text 165 294 <-- click to graph;
|
||||
#X text 260 129 frequencies of harmonics;
|
||||
#X text 260 155 four oscillators;
|
||||
#X text 264 181 adjust amplitudes;
|
||||
#X text 109 233 add the three overtones together;
|
||||
#X obj 116 324 tabwrite~ tab.01.07;
|
||||
#X text 381 632 updated for Pd version 0.40.;
|
||||
#X text 429 360 ---- 0.02 seconds ----;
|
||||
#X obj 73 179 *~ 0.1;
|
||||
#X obj 201 179 *~ 0.5;
|
||||
#X text 129 259 <-- overtones ON/OFF;
|
||||
#X text 29 580 To hear the output \, choose a pitch (at top) \, optionally
|
||||
click the "overtones" control \, and mouse up the output volume. Click
|
||||
the "bang" message to graph it.;
|
||||
#X text 31 392 A simple way to build non-sinusoidal \, periodic musical
|
||||
tones is to sum a series of harmonically tuned sinusoids. Here the
|
||||
four oscillators have frequencies in a 1:2:3:4 ratio (the three "*"
|
||||
objects compute the second \, third \, and fourth one). The amplitudes
|
||||
are adjusted by the "*~ 0.1" \, etc. \, objects. Note that \, since
|
||||
the frequency (from the "mtof") is a message \, a "*" box suffices
|
||||
to operate on it \, but the oscillator's output \, being an audio signal
|
||||
\, needs "*~" instead. The control marked "overtones ON/OFF" is a toggle
|
||||
switch. Click to turn it on and off. Of the overtones are "off" you
|
||||
hear only a sinusoid from the forst oscillator. If on \, you hear all
|
||||
four.;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 1 0 6 0;
|
||||
#X connect 1 0 7 0;
|
||||
#X connect 1 0 10 0;
|
||||
#X connect 1 0 12 0;
|
||||
#X connect 3 0 0 0;
|
||||
#X connect 6 0 14 0;
|
||||
#X connect 7 0 8 0;
|
||||
#X connect 8 0 30 0;
|
||||
#X connect 9 0 13 0;
|
||||
#X connect 10 0 9 0;
|
||||
#X connect 11 0 31 0;
|
||||
#X connect 12 0 11 0;
|
||||
#X connect 13 0 17 1;
|
||||
#X connect 14 0 2 0;
|
||||
#X connect 14 0 2 1;
|
||||
#X connect 14 0 27 0;
|
||||
#X connect 15 0 14 1;
|
||||
#X connect 16 0 15 1;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 18 0 15 0;
|
||||
#X connect 21 0 27 0;
|
||||
#X connect 30 0 17 0;
|
||||
#X connect 31 0 18 1;
|
41
pd-0.44-2/doc/3.audio.examples/A08.beating.pd
Normal file
|
@ -0,0 +1,41 @@
|
|||
#N canvas 53 63 581 571 12;
|
||||
#X obj 31 212 output~;
|
||||
#X obj 32 178 +~;
|
||||
#X text 320 537 updated for Pd version 0.40.;
|
||||
#X obj 32 110 +~;
|
||||
#X obj 187 105 +~;
|
||||
#X obj 187 52 osc~ 440;
|
||||
#X obj 32 57 osc~ 330;
|
||||
#X obj 53 81 osc~ 330.2;
|
||||
#X obj 208 75 osc~ 440.33;
|
||||
#X obj 342 102 +~;
|
||||
#X obj 343 52 osc~ 587;
|
||||
#X obj 364 75 osc~ 587.25;
|
||||
#X obj 33 147 +~;
|
||||
#X text 133 7 Beating between closely tuned sinusoids;
|
||||
#X text 33 280 In each of the three pairs of oscillators above \, the
|
||||
two frequencies are within 1/3 Hz or closer (for example \, the leftmost
|
||||
ones are close to 330 Hz but separated by 1/5 Hz.) The result is a
|
||||
gradual change in amplitude as the phases of the two slip against each
|
||||
other. This is called beating. More complex beating pattenrs may be
|
||||
made by using three or more oscillators. Also their amplitudes need
|
||||
not be equal (as they are here).;
|
||||
#X text 31 407 They are all summed using "+~" boxes. They could have
|
||||
been summed in any order ("+~" is commutative for practical purposes)
|
||||
but here they are added in pairs to emphasize the relationships between
|
||||
them.;
|
||||
#X text 30 474 In contrast to the previous example \, the oscillators
|
||||
are not tuned to the overtone series (ratios 1:2:3:4...) and so the
|
||||
frequencies 330 \, 440 \, and 587 are heard separately.;
|
||||
#X connect 1 0 0 0;
|
||||
#X connect 1 0 0 1;
|
||||
#X connect 3 0 12 0;
|
||||
#X connect 4 0 12 1;
|
||||
#X connect 5 0 4 0;
|
||||
#X connect 6 0 3 0;
|
||||
#X connect 7 0 3 1;
|
||||
#X connect 8 0 4 1;
|
||||
#X connect 9 0 1 1;
|
||||
#X connect 10 0 9 0;
|
||||
#X connect 11 0 9 1;
|
||||
#X connect 12 0 1 0;
|
54
pd-0.44-2/doc/3.audio.examples/A09.frequency.mod.pd
Normal file
|
@ -0,0 +1,54 @@
|
|||
#N canvas 92 96 760 640 12;
|
||||
#X obj 259 168 *~;
|
||||
#X floatatom 259 83 0 0 0 0 - - -;
|
||||
#X floatatom 169 118 0 0 0 0 - - -;
|
||||
#X obj 169 188 +~;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array fm-output 441 float 0;
|
||||
#X coords 0 1.02 440 -1.02 200 130 1;
|
||||
#X restore 527 40 graph;
|
||||
#X msg 244 228 bang;
|
||||
#X text 286 228 <-- click to graph;
|
||||
#X obj 244 252 tabwrite~ fm-output;
|
||||
#X floatatom 281 138 0 0 0 0 - - -;
|
||||
#X text 166 75 carrier;
|
||||
#X text 165 93 frequency;
|
||||
#X text 244 59 frequency;
|
||||
#X text 245 42 modulation;
|
||||
#X text 33 8 FREQUENCY MODULATION ("FM") USING TWO OSCILLATORS;
|
||||
#X obj 168 232 osc~;
|
||||
#X text 52 214 "carrier";
|
||||
#X text 34 232 oscillator -->;
|
||||
#X text 47 149 add modulator;
|
||||
#X text 46 167 to carrier;
|
||||
#X text 44 186 frequency -->;
|
||||
#X text 320 150 index;
|
||||
#X text 322 131 modulation;
|
||||
#X obj 259 108 osc~;
|
||||
#X text 531 172 --- 0.01 seconds ----;
|
||||
#X text 53 443 To get the FM sound \, set all three of carrier frequency
|
||||
\, modulation frequency \, and modulation index in the hundreds. Note
|
||||
that you get a timbral change as you sweep modulation index \, because
|
||||
this changes the amplitudes of the components of the output sound but
|
||||
not their frequencies.;
|
||||
#X obj 167 270 output~;
|
||||
#X text 489 613 updated for Pd version 0.37;
|
||||
#X text 54 332 This patch shows the classical FM synthesis technique
|
||||
developed by John Chowning. It's nothing but an oscillator with vibrato
|
||||
controlled by another "modulation" oscillator. First \, to understand
|
||||
the patch \, set carrier frequency to 400 or so \, modulation frequency
|
||||
between 5 and 10 \, and try modulation index values between 0 and 400
|
||||
\, say. You'll hear a sine wave with vibrato.;
|
||||
#X text 55 526 The component frequencies are equal to the carrier frequency
|
||||
\, plus or minus multiples of the modulator frequency. A more complete
|
||||
discussion of FM occurs in part 5 of this series.;
|
||||
#X connect 0 0 3 1;
|
||||
#X connect 1 0 22 0;
|
||||
#X connect 2 0 3 0;
|
||||
#X connect 3 0 14 0;
|
||||
#X connect 5 0 7 0;
|
||||
#X connect 8 0 0 1;
|
||||
#X connect 14 0 7 0;
|
||||
#X connect 14 0 25 0;
|
||||
#X connect 14 0 25 1;
|
||||
#X connect 22 0 0 0;
|
37
pd-0.44-2/doc/3.audio.examples/A10.review.pd
Normal file
|
@ -0,0 +1,37 @@
|
|||
#N canvas 36 68 652 461 12;
|
||||
#X text 157 10 PART 1 REVIEW;
|
||||
#X obj 67 113 tabwrite~;
|
||||
#X obj 67 87 line~;
|
||||
#X obj 71 220 +;
|
||||
#X obj 67 61 +~;
|
||||
#X obj 67 139 osc~;
|
||||
#X obj 72 319 r;
|
||||
#X obj 72 295 s;
|
||||
#X obj 71 269 inlet;
|
||||
#X obj 114 245 mtof;
|
||||
#X obj 71 244 ftom;
|
||||
#X obj 122 269 outlet;
|
||||
#X obj 67 164 dac~;
|
||||
#X text 27 34 So far we've seen these audio ("tilde") objects:;
|
||||
#X text 124 86 -- ramp generator;
|
||||
#X text 158 113 -- sampler (which we've only used for graphing so far)
|
||||
;
|
||||
#X text 113 165 -- audio output ("digital/analog converter" -- a misnomer)
|
||||
;
|
||||
#X text 34 193 ... and these "control" objects:;
|
||||
#X text 162 243 -- frequency to pitch conversion;
|
||||
#X text 184 270 -- input and output to a subpatch;
|
||||
#X text 108 296 ("send") -- wireless message sending;
|
||||
#X text 109 321 ("receive") ... and receiving;
|
||||
#X text 107 60 (etc.) -- arithmetic on audio signals;
|
||||
#X text 109 218 (etc.) -- arithmetic;
|
||||
#X text 385 426 updated for Pd version 0.40.;
|
||||
#X text 112 139 -- sinusoidal oscillator;
|
||||
#X obj 74 418 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
|
||||
;
|
||||
#X text 97 416 -- toggle switch;
|
||||
#X floatatom 74 395 0 0 0 0 - - -;
|
||||
#X text 109 394 -- number box;
|
||||
#X msg 74 372;
|
||||
#X text 111 372 -- message box;
|
||||
#X text 43 346 ... and these other (non-object) boxes:;
|
50
pd-0.44-2/doc/3.audio.examples/B01.wavetables.pd
Normal file
|
@ -0,0 +1,50 @@
|
|||
#N canvas 19 22 722 608 12;
|
||||
#X floatatom 164 43 0 0 0 0 - - -;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table10 259 float 1;
|
||||
#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0.612 0.612 0.612 0.612 0.612 0.627692 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 -0.470769 -0.470769 -0.470769 -0.470769 -0.470769
|
||||
-0.470769 -0.470769 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0.627692 0.627692 0.627692 0.643385 0.643385 0.643385
|
||||
0.659077 0 -0.502154 -0.502154 -0.502154 -0.486462 -0.486462 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0.580615 0.596308 0.596308 0.596308 0.596308
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
|
||||
#X coords 0 1.02 258 -1.02 258 130 1;
|
||||
#X restore 445 47 graph;
|
||||
#X text 30 123 oscillator -->;
|
||||
#X text 456 587 updated for Pd version 0.34;
|
||||
#X text 33 8 WAVETABLE OSCILLATORS;
|
||||
#X text 36 106 wavetable;
|
||||
#X obj 164 70 mtof;
|
||||
#X floatatom 164 97 0 0 0 0 - - -;
|
||||
#X obj 164 123 tabosc4~ table10;
|
||||
#X text 94 42 pitch->;
|
||||
#X text 35 309 Note that I selected "save contents" in the properties
|
||||
dialog for table10 (right click on the table to see.) If this isn't
|
||||
set \, the waveform won't be remembered as part of the patch but will
|
||||
be reinitialized to zero when the patch is reopened.;
|
||||
#X msg 35 549 \; table10 cosinesum 256 0.2 -0.2 0.2 -0.2 0.2 -0.2 0.2
|
||||
;
|
||||
#X msg 578 240 \; table10 const 0;
|
||||
#X text 597 217 CLEAR TABLE;
|
||||
#X text 35 395 For efficiency's sake tabosc4~ requires that the table
|
||||
have a power of two plus three points (64+3=67 \, 128+3=131 \, 256+3=259
|
||||
\, etc.) If you want wraparound to work smoothly \, you should make
|
||||
the last three points copies of the first three. This is done because
|
||||
tabread4~ does 4-point interpolation.;
|
||||
#X text 38 494 If you want a specific sinusoidal composition \, you
|
||||
can send table10 a message \, as below (see 11.arrays in the control
|
||||
examples):;
|
||||
#X text 36 240 Here \, in place of the "osc~" cosine wave oscillator
|
||||
\, we introduce the tabosc4~ oscillator which produces an arbitrary
|
||||
waveform. You can draw in the waveform with the mouse.;
|
||||
#X obj 164 151 output~;
|
||||
#X connect 0 0 6 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 8 0;
|
||||
#X connect 8 0 17 0;
|
||||
#X connect 8 0 17 1;
|
147
pd-0.44-2/doc/3.audio.examples/B02.two-wavetables.pd
Normal file
|
@ -0,0 +1,147 @@
|
|||
#N canvas 74 98 749 466 12;
|
||||
#X graph graph1 0 -1.02 258 1.02 475 298 733 168;
|
||||
#X array waveform11 259 float 1;
|
||||
#A 0 -0.0896033 0 0.0896033 0.178356 0.265425 0.350007 0.431348 0.508756
|
||||
0.58161 0.649372 0.711597 0.767935 0.818137 0.862053 0.89963 0.930912
|
||||
0.956028 0.975187 0.988669 0.996811 1 0.998655 0.993223 0.984158 0.971919
|
||||
0.956953 0.939691 0.920538 0.899867 0.878018 0.85529 0.831945 0.808204
|
||||
0.784252 0.760239 0.736284 0.712477 0.688888 0.665568 0.642553 0.619872
|
||||
0.59755 0.575607 0.554066 0.532953 0.512296 0.49213 0.472491 0.453419
|
||||
0.434957 0.417147 0.400027 0.383632 0.367992 0.353126 0.339046 0.32575
|
||||
0.313227 0.301453 0.290394 0.280002 0.270224 0.260995 0.252248 0.24391
|
||||
0.235908 0.22817 0.220628 0.213219 0.205888 0.198586 0.191278 0.183936
|
||||
0.176545 0.169098 0.1616 0.154063 0.146505 0.138954 0.131437 0.123987
|
||||
0.116636 0.109415 0.102354 0.0954784 0.0888083 0.08236 0.0761442 0.0701659
|
||||
0.0644253 0.0589178 0.0536354 0.0485669 0.0436994 0.0390194 0.0345135
|
||||
0.0301695 0.0259776 0.0219306 0.0180245 0.0142591 0.0106377 0.00716724
|
||||
0.00385775 0.000722025 -0.00222511 -0.0049675 -0.00748845 -0.00977153
|
||||
-0.0118014 -0.0135644 -0.0150493 -0.0162479 -0.0171551 -0.0177693 -0.0180928
|
||||
-0.0181312 -0.0178936 -0.017392 -0.0166417 -0.0156601 -0.0144666 -0.0130822
|
||||
-0.0115294 -0.00983114 -0.0080113 -0.00609396 -0.0041034 -0.00206402
|
||||
-2.23572e-07 0.00206358 0.00410297 0.00609353 0.00801089 0.00983075
|
||||
0.011529 0.0130819 0.0144663 0.0156599 0.0166416 0.0173919 0.0178935
|
||||
0.0181312 0.0180929 0.0177695 0.0171552 0.0162481 0.0150496 0.0135647
|
||||
0.0118018 0.009772 0.00748897 0.00496807 0.00222573 -0.000721367 -0.00385706
|
||||
-0.00716651 -0.010637 -0.0142583 -0.0180237 -0.0219297 -0.0259767 -0.0301686
|
||||
-0.0345125 -0.0390184 -0.0436984 -0.0485658 -0.0536343 -0.0589167 -0.0644241
|
||||
-0.0701647 -0.0761429 -0.0823587 -0.0888069 -0.0954769 -0.102353 -0.109414
|
||||
-0.116634 -0.123985 -0.131435 -0.138952 -0.146504 -0.154061 -0.161598
|
||||
-0.169097 -0.176543 -0.183935 -0.191276 -0.198584 -0.205886 -0.213218
|
||||
-0.220627 -0.228169 -0.235906 -0.243908 -0.252246 -0.260993 -0.270222
|
||||
-0.28 -0.290392 -0.301451 -0.313224 -0.325747 -0.339043 -0.353123 -0.367989
|
||||
-0.383629 -0.400023 -0.417143 -0.434954 -0.453415 -0.472486 -0.492125
|
||||
-0.512292 -0.532948 -0.554062 -0.575602 -0.597545 -0.619868 -0.642548
|
||||
-0.665563 -0.688883 -0.712472 -0.736279 -0.760234 -0.784247 -0.808199
|
||||
-0.83194 -0.855285 -0.878013 -0.899863 -0.920533 -0.939687 -0.956949
|
||||
-0.971916 -0.984156 -0.993221 -0.998655 -1 -0.996813 -0.988671 -0.975191
|
||||
-0.956033 -0.930918 -0.899638 -0.862061 -0.818147 -0.767947 -0.71161
|
||||
-0.649386 -0.581625 -0.508772 -0.431366 -0.350025 -0.265443 -0.178375
|
||||
-0.0896226 -1.94061e-05 0.089584;
|
||||
#X pop;
|
||||
#X floatatom 202 171 0 0 100;
|
||||
#N canvas 159 26 532 285 output 0;
|
||||
#X obj 338 160 t b;
|
||||
#X obj 338 110 f;
|
||||
#X obj 338 60 inlet;
|
||||
#X text 344 29 mute;
|
||||
#X obj 338 185 f;
|
||||
#X msg 426 180 0;
|
||||
#X msg 338 85 bang;
|
||||
#X obj 338 135 moses 1;
|
||||
#X obj 397 110 moses 1;
|
||||
#X obj 83 148 dbtorms;
|
||||
#X obj 397 85 r master-lvl;
|
||||
#X obj 83 42 r master-lvl;
|
||||
#X obj 338 210 s master-lvl;
|
||||
#X obj 20 155 inlet~;
|
||||
#X obj 199 41 inlet;
|
||||
#X text 199 18 level;
|
||||
#X obj 199 105 s master-lvl;
|
||||
#X msg 96 65 set \$1;
|
||||
#X obj 96 90 outlet;
|
||||
#X msg 214 65 \; pd dsp 1;
|
||||
#X obj 83 198 line~;
|
||||
#X obj 20 207 *~;
|
||||
#X obj 20 232 dac~;
|
||||
#X obj 83 173 pack 0 50;
|
||||
#X text 20 132 audio;
|
||||
#X text 96 114 show level;
|
||||
#X obj 426 155 t b;
|
||||
#X obj 20 181 hip~ 1;
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 7 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 4 0 12 0;
|
||||
#X connect 5 0 12 0;
|
||||
#X connect 6 0 1 0;
|
||||
#X connect 7 0 0 0;
|
||||
#X connect 7 1 26 0;
|
||||
#X connect 8 1 4 1;
|
||||
#X connect 9 0 23 0;
|
||||
#X connect 10 0 1 1;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 11 0 17 0;
|
||||
#X connect 13 0 27 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 14 0 19 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 20 0 21 1;
|
||||
#X connect 21 0 22 0;
|
||||
#X connect 21 0 22 1;
|
||||
#X connect 23 0 20 0;
|
||||
#X connect 26 0 5 0;
|
||||
#X connect 27 0 21 0;
|
||||
#X restore 164 199 pd output;
|
||||
#X msg 240 172 MUTE;
|
||||
#X text 30 123 oscillator -->;
|
||||
#X text 485 445 updated for Pd version 0.34;
|
||||
#X text 33 8 WAVETABLE OSCILLATORS;
|
||||
#X text 36 106 wavetable;
|
||||
#X text 88 54 pitch->;
|
||||
#X graph graph2 0 0 258 1000 475 155 734 15;
|
||||
#X array pitch11 259 float 1;
|
||||
#A 0 757.143 757.143 735.714 700 671.429 650 621.429 600 571.429 550
|
||||
521.429 507.143 485.714 464.286 442.857 428.571 414.286 400 378.571
|
||||
364.286 342.857 328.571 928.571 921.429 921.429 914.286 907.143 892.857
|
||||
885.714 878.571 864.286 850 828.571 807.143 792.857 785.714 775 764.286
|
||||
753.571 742.857 735.714 728.571 721.429 714.286 703.571 692.857 682.143
|
||||
671.429 650 628.571 617.857 607.143 596.429 585.714 575 564.286 553.571
|
||||
542.857 532.143 521.429 510.714 500 485.714 478.571 464.286 450 435.714
|
||||
428.571 400 392.857 385.714 378.571 357.143 350 342.857 335.714 328.571
|
||||
314.286 292.857 285.714 271.429 264.286 571.429 571.429 571.429 571.429
|
||||
571.429 564.286 564.286 278.571 271.429 271.429 278.571 278.571 278.571
|
||||
278.571 571.429 571.429 571.429 575 578.571 578.571 278.571 278.571
|
||||
285.714 285.714 278.571 278.571 278.571 878.571 878.571 878.571 878.571
|
||||
878.571 321.429 325 328.571 328.571 328.571 328.571 885.714 885.714
|
||||
885.714 885.714 207.143 207.143 207.143 200 207.143 207.143 207.143
|
||||
214.286 214.286 221.429 228.571 228.571 242.857 250 257.143 264.286
|
||||
278.571 292.857 307.143 321.429 335.714 350 371.429 392.857 421.429
|
||||
435.714 471.429 500 542.857 571.429 628.571 664.286 700 728.571 757.143
|
||||
792.857 828.571 885.714 928.571 978.571 1000 1007.14 1007.14 1000 1000
|
||||
992.857 985.714 885.714 914.286 671.429 671.429 671.429 671.429 671.429
|
||||
671.429 671.429 671.429 671.429 671.429 678.571 635.714 635.714 678.571
|
||||
714.286 714.286 678.571 635.714 635.714 635.714 742.857 742.857 685.714
|
||||
685.714 635.714 621.429 685.714 792.857 792.857 678.571 521.429 521.429
|
||||
521.429 864.286 857.143 857.143 471.429 471.429 471.429 471.429 921.429
|
||||
921.429 385.714 385.714 385.714 964.286 964.286 964.286 328.571 328.571
|
||||
328.571 328.571 885.714 885.714 885.714 685.714 214.286 214.286 207.143
|
||||
207.143 921.429 921.429 921.429 921.429 207.143 207.143 200 200 957.143
|
||||
957.143 950 214.286 214.286 207.143 207.143 957.143 957.143 950 200
|
||||
207.143 207.143 942.857 942.857 942.857 950 950;
|
||||
#X pop;
|
||||
#X obj 164 87 tabosc4~ pitch11;
|
||||
#X obj 164 123 tabosc4~ waveform11;
|
||||
#X obj 164 55 sig~ 0.5;
|
||||
#X text 13 319 Here's a tabosc4~ controlling the frequency of another
|
||||
one. If you get properties on the two arrays \, you'll see that the
|
||||
top graph has a vertical scale from 0 to 1000 \; we're looping through
|
||||
that at a frequency of 0.5 Hz. and the output is used as the frequency
|
||||
input of the second tabosc4~. I've detected Klingons \, Captain Kirk...
|
||||
;
|
||||
#X connect 1 0 2 1;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 2 2;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 2 0;
|
||||
#X connect 12 0 10 0;
|
130
pd-0.44-2/doc/3.audio.examples/B03.tabread4.pd
Normal file
|
@ -0,0 +1,130 @@
|
|||
#N canvas 55 137 820 651 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array waveform12 131 float 1;
|
||||
#A 0 -0.172615 -0.172615 -0.172615 -0.172615 -0.172615 -0.141231 -0.109846
|
||||
-0.0941538 -0.0627692 -0.0470769 0.0156923 0.0784615 0.125538 0.188308
|
||||
0.235385 0.298154 0.360923 0.392308 0.470769 0.533538 0.596308 0.643385
|
||||
0.674769 0.721846 0.753231 0.784615 0.816 0.831692 0.847385 0.878769
|
||||
0.894462 0.910154 0.910154 0.910154 0.910154 0.910154 0.894462 0.894462
|
||||
0.894462 0.894462 0.878769 0.863077 0.816 0.800308 0.768923 0.737538
|
||||
0.706154 0.674769 0.643385 0.596308 0.564923 0.533538 0.470769 0.423692
|
||||
0.376615 0.313846 0.266769 0.204 0.172615 0.109846 0.0627692 0.0156923
|
||||
0 -0.0313846 -0.0627692 -0.0784615 -0.0941538 -0.109846 -0.141231 -0.156923
|
||||
-0.172615 -0.204 -0.219692 -0.219692 -0.235385 -0.235385 -0.235385
|
||||
-0.219692 -0.219692 -0.219692 -0.204 -0.156923 -0.125538 -0.0784615
|
||||
0 0.172615 0.313846 0.470769 0.564923 0.627692 0.690462 0.721846 0.737538
|
||||
0.753231 0.768923 0.768923 0.753231 0.737538 0.706154 0.674769 0.612
|
||||
0.580615 0.549231 0.517846 0.486462 0.423692 0.392308 0.360923 0.282462
|
||||
0.219692 0.109846 -0.0156923 -0.0941538 -0.109846 -0.141231 -0.156923
|
||||
-0.172615 -0.188308 -0.204 -0.204 -0.219692 -0.204 -0.204 -0.219692
|
||||
-0.219692 -0.204 -0.204 -0.204 -0.204 -0.204 -0.188308;
|
||||
#X coords 0 1.02 130 -1.02 258 130 1;
|
||||
#X restore 462 30 graph;
|
||||
#X floatatom 194 299 0 0 100 0 - - -;
|
||||
#N canvas 159 26 532 285 output 0;
|
||||
#X obj 338 160 t b;
|
||||
#X obj 338 110 f;
|
||||
#X obj 338 60 inlet;
|
||||
#X text 344 29 mute;
|
||||
#X obj 338 185 f;
|
||||
#X msg 426 180 0;
|
||||
#X msg 338 85 bang;
|
||||
#X obj 338 135 moses 1;
|
||||
#X obj 397 110 moses 1;
|
||||
#X obj 83 148 dbtorms;
|
||||
#X obj 397 85 r master-lvl;
|
||||
#X obj 83 42 r master-lvl;
|
||||
#X obj 338 210 s master-lvl;
|
||||
#X obj 20 155 inlet~;
|
||||
#X obj 199 41 inlet;
|
||||
#X text 199 18 level;
|
||||
#X obj 199 105 s master-lvl;
|
||||
#X msg 96 65 set \$1;
|
||||
#X obj 96 90 outlet;
|
||||
#X msg 214 65 \; pd dsp 1;
|
||||
#X obj 83 198 line~;
|
||||
#X obj 20 207 *~;
|
||||
#X obj 20 232 dac~;
|
||||
#X obj 83 173 pack 0 50;
|
||||
#X text 20 132 audio;
|
||||
#X text 96 114 show level;
|
||||
#X obj 426 155 t b;
|
||||
#X obj 20 181 hip~ 1;
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 7 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 4 0 12 0;
|
||||
#X connect 5 0 12 0;
|
||||
#X connect 6 0 1 0;
|
||||
#X connect 7 0 0 0;
|
||||
#X connect 7 1 26 0;
|
||||
#X connect 8 1 4 1;
|
||||
#X connect 9 0 23 0;
|
||||
#X connect 10 0 1 1;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 11 0 17 0;
|
||||
#X connect 13 0 27 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 14 0 19 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 20 0 21 1;
|
||||
#X connect 21 0 22 0;
|
||||
#X connect 21 0 22 1;
|
||||
#X connect 23 0 20 0;
|
||||
#X connect 26 0 5 0;
|
||||
#X connect 27 0 21 0;
|
||||
#X restore 156 327 pd output;
|
||||
#X msg 232 300 MUTE;
|
||||
#X text 33 8 WAVETABLE OSCILLATORS;
|
||||
#X obj 156 95 phasor~;
|
||||
#X obj 156 184 tabread4~ waveform12;
|
||||
#X obj 156 157 +~ 1;
|
||||
#X floatatom 156 66 4 0 0 0 - - -;
|
||||
#X floatatom 250 59 4 0 1000 0 - - -;
|
||||
#X obj 250 80 pack 0 50;
|
||||
#X obj 250 104 line~;
|
||||
#X obj 156 131 *~;
|
||||
#X text 21 81 phase;
|
||||
#X text 20 96 generation -->;
|
||||
#X text 25 117 range;
|
||||
#X text 24 132 adjustment -->;
|
||||
#X text 250 38 squeeze;
|
||||
#X text 133 40 frequency;
|
||||
#N canvas 0 0 450 300 graph3 0;
|
||||
#X array wave-out12 441 float 0;
|
||||
#X coords 0 1 440 -1 300 140 1;
|
||||
#X restore 481 190 graph;
|
||||
#X obj 177 247 tabwrite~ wave-out12;
|
||||
#X msg 177 216 bang;
|
||||
#X text 223 217 <--click to graph;
|
||||
#X text 25 360 The tabread4~ module is available for situations requiring
|
||||
more control than tabosc4~ offers. The relationship between the two
|
||||
is the same as between cos~ and osc~ \, although the units are different
|
||||
between cos~ and tabread4~. Cos~ assumes input is normalized from 0
|
||||
to 1 (and will wrap around as needed.) Tabread4~ takes values from
|
||||
1 to n-2 where n is the number of points in the table-- for a 259-point
|
||||
table such as we have here \, it's 1 to 129 (so the "good" segment
|
||||
is 128 samples long.);
|
||||
#X text 30 508 You would use tabread4~ (as opposed to tabosc4~) if
|
||||
you need direct control of the phase \, for instance if you to advance
|
||||
nonlinearly through the table. In the case shown here \, the "squeeze"
|
||||
factor makes the phase grow to a value at least \, and possibly much
|
||||
graeater than \, 129 (to which tabread4~ then limits it). So the resulting
|
||||
waveform is compressed in time.;
|
||||
#X obj 250 128 +~ 128;
|
||||
#X text 554 624 updated for Pd version 0.37;
|
||||
#X connect 1 0 2 1;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 2 2;
|
||||
#X connect 5 0 12 0;
|
||||
#X connect 6 0 2 0;
|
||||
#X connect 6 0 20 0;
|
||||
#X connect 7 0 6 0;
|
||||
#X connect 8 0 5 0;
|
||||
#X connect 9 0 10 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 25 0;
|
||||
#X connect 12 0 7 0;
|
||||
#X connect 21 0 20 0;
|
||||
#X connect 25 0 12 1;
|
44
pd-0.44-2/doc/3.audio.examples/B04.tabread4.interpolation.pd
Normal file
|
@ -0,0 +1,44 @@
|
|||
#N canvas 137 102 781 520 12;
|
||||
#X graph graph1 0 -1.02 10 1.02 468 159 648 29;
|
||||
#X array waveform13 11 float 1;
|
||||
#A 0 1 1 1 1 1 1 1 -1 -1 -1 -1;
|
||||
#X pop;
|
||||
#X text 533 502 updated for Pd version 0.34;
|
||||
#X obj 156 157 +~ 1;
|
||||
#X text 21 81 phase;
|
||||
#X text 20 96 generation -->;
|
||||
#X text 25 117 range;
|
||||
#X text 24 132 adjustment -->;
|
||||
#X graph graph3 0 -1.02 440 1.02 469 362 769 222;
|
||||
#X array wave-out13 441 float 0;
|
||||
#X pop;
|
||||
#X msg 177 216 bang;
|
||||
#X text 223 217 <--click to graph;
|
||||
#N canvas 11 418 523 216 other-stuff 0;
|
||||
#X obj 41 49 loadbang;
|
||||
#X msg 39 81 \; waveform13 0 1 1 1 1 1 1 1 -1 -1 -1 -1 \; waveform13
|
||||
xlabel -1.2 0 1 2 3 4 5 6 7 8 9 10 \; pd dsp 1;
|
||||
#X connect 0 0 1 0;
|
||||
#X restore 626 426 pd other-stuff;
|
||||
#X obj 156 247 tabwrite~ wave-out13;
|
||||
#X obj 156 184 tabread4~ waveform13;
|
||||
#X obj 156 131 *~ 8;
|
||||
#X obj 156 95 phasor~ 220;
|
||||
#X text 36 22 4-POINT INTERPOLATION IN DETAIL;
|
||||
#X obj 216 316 sig~ 220;
|
||||
#X obj 216 346 tabosc4~ waveform13;
|
||||
#X text 35 293 (this would be;
|
||||
#X text 36 313 equivalent to the;
|
||||
#X text 110 333 above) -->;
|
||||
#X text 18 409 This patch demonstrates 4-point interpolation in tabread4~.
|
||||
The 11-point table \, waveform13 \, contains a transition from from
|
||||
1 to -1 \, which is "smoothed" as seen in wave-out13. There's no such
|
||||
transition at the wraparoind point--the interpolation always happens
|
||||
between 4 consccutive samples of the table \, disregarding wraparound.
|
||||
;
|
||||
#X connect 2 0 12 0;
|
||||
#X connect 8 0 11 0;
|
||||
#X connect 12 0 11 0;
|
||||
#X connect 13 0 2 0;
|
||||
#X connect 14 0 13 0;
|
||||
#X connect 16 0 17 0;
|
107
pd-0.44-2/doc/3.audio.examples/B05.tabread.FM.pd
Normal file
|
@ -0,0 +1,107 @@
|
|||
#N canvas 55 137 777 467 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array pitchmod14 131 float 1;
|
||||
#A 0 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.831692 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.863077 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
-0.800308 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.768923 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.768923 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.800308 -0.800308
|
||||
-0.800308 -0.800308 -0.800308 -0.800308 -0.800308;
|
||||
#X coords 0 1.02 130 -1.02 258 130 1;
|
||||
#X restore 462 30 graph;
|
||||
#X floatatom 191 277 0 0 100 0 - - -;
|
||||
#N canvas 159 26 532 285 output 0;
|
||||
#X obj 338 160 t b;
|
||||
#X obj 338 110 f;
|
||||
#X obj 338 60 inlet;
|
||||
#X text 344 29 mute;
|
||||
#X obj 338 185 f;
|
||||
#X msg 426 180 0;
|
||||
#X msg 338 85 bang;
|
||||
#X obj 338 135 moses 1;
|
||||
#X obj 397 110 moses 1;
|
||||
#X obj 83 148 dbtorms;
|
||||
#X obj 397 85 r master-lvl;
|
||||
#X obj 83 42 r master-lvl;
|
||||
#X obj 338 210 s master-lvl;
|
||||
#X obj 20 155 inlet~;
|
||||
#X obj 199 41 inlet;
|
||||
#X text 199 18 level;
|
||||
#X obj 199 105 s master-lvl;
|
||||
#X msg 96 65 set \$1;
|
||||
#X obj 96 90 outlet;
|
||||
#X msg 214 65 \; pd dsp 1;
|
||||
#X obj 83 198 line~;
|
||||
#X obj 20 207 *~;
|
||||
#X obj 20 232 dac~;
|
||||
#X obj 83 173 pack 0 50;
|
||||
#X text 20 132 audio;
|
||||
#X text 96 114 show level;
|
||||
#X obj 426 155 t b;
|
||||
#X obj 20 181 hip~ 1;
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 7 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 4 0 12 0;
|
||||
#X connect 5 0 12 0;
|
||||
#X connect 6 0 1 0;
|
||||
#X connect 7 0 0 0;
|
||||
#X connect 7 1 26 0;
|
||||
#X connect 8 1 4 1;
|
||||
#X connect 9 0 23 0;
|
||||
#X connect 10 0 1 1;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 11 0 17 0;
|
||||
#X connect 13 0 27 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 14 0 19 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 20 0 21 1;
|
||||
#X connect 21 0 22 0;
|
||||
#X connect 21 0 22 1;
|
||||
#X connect 23 0 20 0;
|
||||
#X connect 26 0 5 0;
|
||||
#X connect 27 0 21 0;
|
||||
#X restore 153 305 pd output;
|
||||
#X msg 229 278 MUTE;
|
||||
#X floatatom 153 95 4 0 0 0 - - -;
|
||||
#X text 153 69 frequency;
|
||||
#X floatatom 195 206 4 0 0 0 - - -;
|
||||
#X text 155 50 modulation;
|
||||
#X obj 152 157 *~;
|
||||
#X text 255 150 modulation;
|
||||
#X text 253 169 depth;
|
||||
#X floatatom 201 157 4 0 0 0 - - -;
|
||||
#X obj 152 205 +~;
|
||||
#X text 250 212 frequency;
|
||||
#X obj 152 237 osc~;
|
||||
#X obj 153 122 tabosc4~ pitchmod14;
|
||||
#X text 254 194 carrier;
|
||||
#X text 33 8 FREQUENCY MODULATION BY WAVETABLE;
|
||||
#X text 47 356 This tabosc4~ controls the pitch of a sinusoidal oscillator
|
||||
(osc~). Try changing the waveform as well as the three familiar parameters.
|
||||
;
|
||||
#X text 520 438 updated for Pd version 0.37;
|
||||
#X connect 1 0 2 1;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 2 2;
|
||||
#X connect 4 0 15 0;
|
||||
#X connect 6 0 12 1;
|
||||
#X connect 8 0 12 0;
|
||||
#X connect 11 0 8 1;
|
||||
#X connect 12 0 14 0;
|
||||
#X connect 14 0 2 0;
|
||||
#X connect 15 0 8 0;
|
127
pd-0.44-2/doc/3.audio.examples/B06.table.switching.pd
Normal file
|
@ -0,0 +1,127 @@
|
|||
#N canvas 55 137 835 504 12;
|
||||
#X graph graph1 0 -1.02 130 1.02 565 153 823 23;
|
||||
#X array waveshape15a 131 float 1;
|
||||
#A 0 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077 0.863077
|
||||
0.863077 0.863077 0.863077 0.863077 0.863077 0.831692 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
0.847385 0.863077 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385
|
||||
-0.800308 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.768923 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.768923 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.800308 -0.800308
|
||||
-0.800308 -0.800308 -0.800308 -0.800308 -0.800308;
|
||||
#X pop;
|
||||
#X floatatom 194 299 0 0 100;
|
||||
#N canvas 159 26 532 285 output 0;
|
||||
#X obj 338 160 t b;
|
||||
#X obj 338 110 f;
|
||||
#X obj 338 60 inlet;
|
||||
#X text 344 29 mute;
|
||||
#X obj 338 185 f;
|
||||
#X msg 426 180 0;
|
||||
#X msg 338 85 bang;
|
||||
#X obj 338 135 moses 1;
|
||||
#X obj 397 110 moses 1;
|
||||
#X obj 83 148 dbtorms;
|
||||
#X obj 397 85 r master-lvl;
|
||||
#X obj 83 42 r master-lvl;
|
||||
#X obj 338 210 s master-lvl;
|
||||
#X obj 20 155 inlet~;
|
||||
#X obj 199 41 inlet;
|
||||
#X text 199 18 level;
|
||||
#X obj 199 105 s master-lvl;
|
||||
#X msg 96 65 set \$1;
|
||||
#X obj 96 90 outlet;
|
||||
#X msg 214 65 \; pd dsp 1;
|
||||
#X obj 83 198 line~;
|
||||
#X obj 20 207 *~;
|
||||
#X obj 20 232 dac~;
|
||||
#X obj 83 173 pack 0 50;
|
||||
#X text 20 132 audio;
|
||||
#X text 96 114 show level;
|
||||
#X obj 426 155 t b;
|
||||
#X obj 20 181 hip~ 1;
|
||||
#X connect 0 0 4 0;
|
||||
#X connect 1 0 7 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 4 0 12 0;
|
||||
#X connect 5 0 12 0;
|
||||
#X connect 6 0 1 0;
|
||||
#X connect 7 0 0 0;
|
||||
#X connect 7 1 26 0;
|
||||
#X connect 8 1 4 1;
|
||||
#X connect 9 0 23 0;
|
||||
#X connect 10 0 1 1;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 11 0 17 0;
|
||||
#X connect 13 0 27 0;
|
||||
#X connect 14 0 16 0;
|
||||
#X connect 14 0 19 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 20 0 21 1;
|
||||
#X connect 21 0 22 0;
|
||||
#X connect 21 0 22 1;
|
||||
#X connect 23 0 20 0;
|
||||
#X connect 26 0 5 0;
|
||||
#X connect 27 0 21 0;
|
||||
#X restore 156 327 pd output;
|
||||
#X msg 232 300 MUTE;
|
||||
#X text 581 481 updated for Pd version 0.34;
|
||||
#X text 33 8 SWITCHING BETWEEN TABLES;
|
||||
#X graph graph1 0 -1.02 130 1.02 565 308 823 178;
|
||||
#X array waveshape15b 131 float 1;
|
||||
#A 0 -0.659077 -0.643385 -0.643385 -0.627692 -0.612 -0.612 -0.596308
|
||||
-0.596308 -0.580615 -0.580615 -0.580615 -0.580615 -0.580615 -0.580615
|
||||
-0.580615 -0.596308 -0.596308 -0.596308 -0.596308 -0.596308 -0.596308
|
||||
-0.596308 -0.596308 -0.580615 -0.580615 -0.580615 -0.580615 -0.580615
|
||||
-0.580615 -0.580615 -0.580615 -0.564923 -0.549231 -0.549231 -0.533538
|
||||
-0.517846 -0.517846 -0.517846 -0.517846 -0.517846 -0.517846 -0.517846
|
||||
-0.517846 -0.533538 -0.549231 -0.580615 -0.580615 0.847385 0.847385
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 0.863077
|
||||
0.847385 0.847385 0.847385 0.847385 0.847385 0.847385 -0.800308 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.768923 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.768923 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615 -0.784615
|
||||
-0.784615 -0.784615 -0.784615 -0.800308 -0.800308 -0.800308 -0.800308
|
||||
-0.800308 -0.800308 -0.800308;
|
||||
#X pop;
|
||||
#X obj 156 274 tabosc4~ waveshape15a;
|
||||
#X obj 156 186 sig~ 110;
|
||||
#X msg 181 215 set waveshape15a;
|
||||
#X msg 182 244 set waveshape15b;
|
||||
#X text 20 51 During a performance you're unlikely to want to draw
|
||||
or recalculate wavetables on the fly \, because you don't want to give
|
||||
Pd computationally intensive atomic tasks that could make Pd miss a
|
||||
DAC deadline. Instead \, use "set" mesages to switch tabosc~ or tabread4~
|
||||
between pre-prepared tables. Indeed \, you will eventually want to
|
||||
save screen space by throwing all your wavetables in a subpatch somewhere.
|
||||
;
|
||||
#X obj 161 401 table waveshape15c 131;
|
||||
#X text 41 362 There's also a "text object" hook so that you can have
|
||||
arrays with parametrizable names and sizes:;
|
||||
#X text 31 431 You would use this if you want to include one or more
|
||||
arrays in an abstraction. In this invocation you can't save the state
|
||||
of the array--instead \, juts read it in from a file or calculate it
|
||||
at startup.;
|
||||
#X connect 1 0 2 1;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 2 2;
|
||||
#X connect 7 0 2 0;
|
||||
#X connect 8 0 7 0;
|
||||
#X connect 9 0 7 0;
|
||||
#X connect 10 0 7 0;
|
52
pd-0.44-2/doc/3.audio.examples/B07.sampler.pd
Normal file
|
@ -0,0 +1,52 @@
|
|||
#N canvas 11 3 915 618 12;
|
||||
#X obj 37 217 hip~ 5;
|
||||
#X text 96 219 high pass filter to cut DC;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array sample-table 44104 float 0;
|
||||
#X coords 0 1.02 44103 -1.02 200 130 1;
|
||||
#X restore 585 20 graph;
|
||||
#X obj 37 185 tabread4~ sample-table;
|
||||
#X obj 37 150 line~;
|
||||
#X obj 37 101 * 441;
|
||||
#X floatatom 37 47 0 0 100 0 - - -;
|
||||
#X obj 37 125 pack 0 100;
|
||||
#X text 102 13 SCRATCH MACHINE;
|
||||
#X text 72 48 <-- read point in 100ths of a second;
|
||||
#X text 94 101 convert to SAMPLES (441 samples in 0.01 sec);
|
||||
#X obj 405 235 loadbang;
|
||||
#X text 246 174 read from the table;
|
||||
#X text 237 192 (the input is the index in samples);
|
||||
#X text 16 482 For more on reading and writing soundfiles to tables
|
||||
\, setting their lengths \, etc \, see "arrays" in the "control examples"
|
||||
series.;
|
||||
#X text 14 355 This patch introduces the "tabread4~" object \, which
|
||||
reads audio samples out of a floating-point array \, often called a
|
||||
"sample table." The input is the index of the sample to read \, counting
|
||||
from zero. The output is calculated using 4-point cubic interpolation
|
||||
\, which is adequate for most purposes. Because of the interpolation
|
||||
scheme \, tabread4~'s input cannot be less than one or greater than
|
||||
the table length minus two.;
|
||||
#X text 17 539 Fanatics take note: if you want really high-fidelity
|
||||
sampling \, use a high-quality resampling program to up-sample your
|
||||
soundfile to 88200 to drastically reduce interpolation error.;
|
||||
#X text 591 173 (one second plus three extra;
|
||||
#X text 593 192 for 4-point interpolation);
|
||||
#X text 385 304 message to read a soundfile into the table (automatically
|
||||
sent when you load this patch by the "loadbang" object.);
|
||||
#X text 84 150 convert smoothly to audio signal;
|
||||
#X text 84 62 (range is 0-100.) YOU ONLY HEAR OUTPUT;
|
||||
#X text 85 78 WHEN THIS IS 0-100 AND ACTIVELY CHANGING.;
|
||||
#X text 596 589 updated for Pd version 0.33;
|
||||
#X text 584 151 --- 44103 samples ---;
|
||||
#X msg 405 259 read ../sound/voice.wav sample-table;
|
||||
#X obj 405 284 soundfiler;
|
||||
#X obj 36 249 output~;
|
||||
#X connect 0 0 27 0;
|
||||
#X connect 0 0 27 1;
|
||||
#X connect 3 0 0 0;
|
||||
#X connect 4 0 3 0;
|
||||
#X connect 5 0 7 0;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 7 0 4 0;
|
||||
#X connect 11 0 25 0;
|
||||
#X connect 25 0 26 0;
|
64
pd-0.44-2/doc/3.audio.examples/B08.sampler.loop.pd
Normal file
|
@ -0,0 +1,64 @@
|
|||
#N canvas 143 17 992 621 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array tabread4-out 44100 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 632 200 graph;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table17 44103 float 0;
|
||||
#X coords 0 1.02 44103 -1.02 200 130 1;
|
||||
#X restore 631 14 graph;
|
||||
#X obj 568 496 loadbang;
|
||||
#X obj 65 277 tabwrite~ tabread4-out;
|
||||
#X obj 34 308 hip~ 5;
|
||||
#X floatatom 34 54 0 0 0 0 - - -;
|
||||
#X text 241 215 read from the table;
|
||||
#X text 49 11 LOOPING SAMPLER;
|
||||
#X text 83 54 <-- frequency (Hz.);
|
||||
#X floatatom 65 107 0 0 0 0 - - -;
|
||||
#X obj 65 133 * 441;
|
||||
#X obj 34 160 *~ 0;
|
||||
#X obj 34 187 +~ 1;
|
||||
#X text 110 248 <-- click to display output;
|
||||
#X obj 34 80 phasor~ 0;
|
||||
#X msg 65 245 bang;
|
||||
#X text 110 108 <-- chunk size (100ths of a second);
|
||||
#X obj 561 395 adc~ 1;
|
||||
#X msg 575 422 bang;
|
||||
#X text 615 423 <-- click here to record your own sample;
|
||||
#X text 678 501 v-- re-read the original sample;
|
||||
#X text 14 540 In this patch you will frequently hear discontinuities
|
||||
at the looping point. If you're working in a studio \, you can sometimes
|
||||
find "good" loop points for samples. Another approach \, better for
|
||||
live situations \, is shown in the next patch.;
|
||||
#X text 80 159 <-- readjust phase for range 0 - (chunk size);
|
||||
#X text 79 187 <-- add one to avoid beginning of table;
|
||||
#X obj 568 549 soundfiler;
|
||||
#X text 629 153 ---- 44103 samples ----;
|
||||
#X text 643 336 ---- 1 second ------;
|
||||
#X obj 34 335 output~;
|
||||
#X text 742 591 updated for Pd version 0.37;
|
||||
#X obj 34 216 tabread4~ table17;
|
||||
#X obj 562 455 tabwrite~ table17;
|
||||
#X msg 568 524 read ../sound/voice.wav table17;
|
||||
#X text 16 409 This is a looping sampler in which you specify the number
|
||||
of loops per second (the frequency) and the size of the chunk to loop.
|
||||
If the frequency is less than about 20 \, you will hear repetition
|
||||
and the chunk size will sound like transposition. For frequencies above
|
||||
50 or so \, you hear a tone whose timbre is controlled by the chunk
|
||||
size (best kept below 10 or so.) Remember you can use the "shift" key
|
||||
on number boxes to make fine adjustments.;
|
||||
#X connect 2 0 31 0;
|
||||
#X connect 4 0 27 0;
|
||||
#X connect 4 0 27 1;
|
||||
#X connect 5 0 14 0;
|
||||
#X connect 9 0 10 0;
|
||||
#X connect 10 0 11 1;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 12 0 29 0;
|
||||
#X connect 14 0 11 0;
|
||||
#X connect 15 0 3 0;
|
||||
#X connect 17 0 30 0;
|
||||
#X connect 18 0 30 0;
|
||||
#X connect 29 0 4 0;
|
||||
#X connect 29 0 3 0;
|
||||
#X connect 31 0 24 0;
|
72
pd-0.44-2/doc/3.audio.examples/B09.sampler.loop.smooth.pd
Normal file
|
@ -0,0 +1,72 @@
|
|||
#N canvas 75 15 973 599 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array cos-output 44100 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 724 191 graph;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table18 44103 float 0;
|
||||
#X coords 0 1.02 44103 -1.02 200 130 1;
|
||||
#X restore 721 16 graph;
|
||||
#X obj 584 491 loadbang;
|
||||
#X obj 45 249 hip~ 5;
|
||||
#X floatatom 46 50 0 0 0 0 - - -;
|
||||
#X text 85 49 <-- frequency (Hz.);
|
||||
#X floatatom 132 87 0 0 0 0 - - -;
|
||||
#X obj 132 114 * 441;
|
||||
#X obj 110 163 +~ 1;
|
||||
#X text 171 86 <-- chunk size (100ths of a second);
|
||||
#X obj 584 404 adc~ 1;
|
||||
#X msg 599 429 bang;
|
||||
#X text 40 9 ENVELOPING YOUR LOOPING SAMPLER;
|
||||
#X obj 45 139 -~ 0.5;
|
||||
#X obj 45 189 cos~;
|
||||
#X obj 45 222 *~;
|
||||
#X obj 584 545 soundfiler;
|
||||
#X text 736 148 -- 44103 samples ---;
|
||||
#X text 727 322 ----- 1 second ------;
|
||||
#X obj 46 77 phasor~;
|
||||
#X obj 45 164 *~ 0.5;
|
||||
#X obj 44 281 output~;
|
||||
#X obj 110 138 *~;
|
||||
#X text 28 362 Here we apply an amplitude envelope to protect against
|
||||
discontinuities at the loop point. The envelope is just a cosine wave
|
||||
from -90 degrees to +90 degrees \, (-pi/2 to pi/2 radians) \, i.e.
|
||||
\, the part that is zero or positive in sign. The "cos~" object's input
|
||||
is in cycles (units of 2pi radians) so -1/4 to +1/4 addresses the desired
|
||||
part of the waveform.;
|
||||
#X obj 167 247 tabwrite~ cos-output;
|
||||
#X obj 167 223 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X text 188 220 <-- click to graph envelope;
|
||||
#X text 28 476 To see the envelope \, put the phasor on 2 Hz or so
|
||||
\, click the "graph" button \, and look at "cos-output." This is multiplied
|
||||
by the tabread4~ output so that it doesn't click when the phase wraps
|
||||
around.;
|
||||
#X text 26 545 It is possible to get much more control over the shape
|
||||
of the envelope \, but this will be taken up later.;
|
||||
#X obj 110 189 tabread4~ table18;
|
||||
#X obj 584 456 tabwrite~ table18;
|
||||
#X msg 584 520 read ../sound/voice.wav table18;
|
||||
#X text 641 430 <-- click here to record to table;
|
||||
#X text 675 499 v-- re-read the original sound;
|
||||
#X text 708 565 updated for Pd version 0.37;
|
||||
#X connect 2 0 31 0;
|
||||
#X connect 3 0 21 0;
|
||||
#X connect 3 0 21 1;
|
||||
#X connect 4 0 19 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 22 1;
|
||||
#X connect 8 0 29 0;
|
||||
#X connect 10 0 30 0;
|
||||
#X connect 11 0 30 0;
|
||||
#X connect 13 0 20 0;
|
||||
#X connect 14 0 15 0;
|
||||
#X connect 14 0 24 0;
|
||||
#X connect 15 0 3 0;
|
||||
#X connect 19 0 13 0;
|
||||
#X connect 19 0 22 0;
|
||||
#X connect 20 0 14 0;
|
||||
#X connect 22 0 8 0;
|
||||
#X connect 25 0 24 0;
|
||||
#X connect 29 0 15 1;
|
||||
#X connect 31 0 16 0;
|
83
pd-0.44-2/doc/3.audio.examples/B10.sampler.scratch.pd
Normal file
|
@ -0,0 +1,83 @@
|
|||
#N canvas 53 232 936 654 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table19 44103 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 680 8 graph;
|
||||
#X obj 40 382 hip~ 5;
|
||||
#X floatatom 99 51 0 0 0 0 - - -;
|
||||
#X text 146 50 <-- frequency (Hz.);
|
||||
#X floatatom 129 106 0 0 0 0 - - -;
|
||||
#X obj 129 135 * 441;
|
||||
#X obj 100 158 *~ 0;
|
||||
#X obj 100 181 +~ 1;
|
||||
#X msg 194 281 bang;
|
||||
#X text 164 106 <-- chunk size (100ths of a second);
|
||||
#X obj 591 369 adc~ 1;
|
||||
#X obj 591 395 hip~ 5;
|
||||
#X msg 609 423 bang;
|
||||
#N canvas 0 0 450 300 graph2 0;
|
||||
#X array graph19 44100 float 0;
|
||||
#X coords 0 44100 44100 0 200 130 1;
|
||||
#X restore 681 196 graph;
|
||||
#X obj 40 356 *~;
|
||||
#X obj 123 276 line~;
|
||||
#X obj 123 228 * 441;
|
||||
#X floatatom 123 205 0 0 0 0 - - -;
|
||||
#X obj 123 252 pack 0 100;
|
||||
#X obj 101 310 +~;
|
||||
#X text 34 474 In this patch we can loop in any "window" of the input
|
||||
sample. The "read point" (0-100) gives the starting point of the window
|
||||
and "chunk" is its size (both in 100ths of a second.) Try \, for example
|
||||
\, frequency 4 \, sharpness 10 \, chunk size 25 \, and vary the read
|
||||
point from -25 to 100 \, listening to the result.;
|
||||
#X text 242 281 <-- graph table index;
|
||||
#X text 684 337 ----- 1 second ------;
|
||||
#X obj 595 490 loadbang;
|
||||
#X text 631 514 v-- re-read the original sample;
|
||||
#X obj 605 559 soundfiler;
|
||||
#X text 678 147 ---- 44103 samples ---;
|
||||
#X obj 591 455 tabwrite~ table19;
|
||||
#X msg 605 535 read ../sound/voice.wav table19;
|
||||
#X text 688 628 updated for Pd version 0.37;
|
||||
#X msg 595 585 \; graph19 ylabel 48000 0 44100;
|
||||
#X obj 39 103 -~ 0.5;
|
||||
#X obj 99 76 phasor~;
|
||||
#X obj 39 127 *~ 0.5;
|
||||
#X obj 39 150 cos~;
|
||||
#X text 157 206 <-- read point (100ths of a second);
|
||||
#X obj 41 406 output~;
|
||||
#X text 651 422 <-- record;
|
||||
#X text 36 13 ENVELOPING THE LOOPING SAMPLER;
|
||||
#X text 37 574 You should hear some doppler shift as you change the
|
||||
read point. To see why \, click on "graph table index" and quickly
|
||||
start changing the read point--- you should see entertaining pictures
|
||||
in "table-index". The next patch shows how to prevent this if you wish
|
||||
to.;
|
||||
#X obj 100 336 tabread4~ table19;
|
||||
#X obj 194 307 tabwrite~ graph19;
|
||||
#X connect 1 0 36 0;
|
||||
#X connect 2 0 32 0;
|
||||
#X connect 4 0 5 0;
|
||||
#X connect 5 0 6 1;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 7 0 19 0;
|
||||
#X connect 8 0 41 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 27 0;
|
||||
#X connect 12 0 27 0;
|
||||
#X connect 14 0 1 0;
|
||||
#X connect 15 0 19 1;
|
||||
#X connect 16 0 18 0;
|
||||
#X connect 17 0 16 0;
|
||||
#X connect 18 0 15 0;
|
||||
#X connect 19 0 40 0;
|
||||
#X connect 19 0 41 0;
|
||||
#X connect 23 0 30 0;
|
||||
#X connect 23 0 28 0;
|
||||
#X connect 28 0 25 0;
|
||||
#X connect 31 0 33 0;
|
||||
#X connect 32 0 6 0;
|
||||
#X connect 32 0 31 0;
|
||||
#X connect 33 0 34 0;
|
||||
#X connect 34 0 14 0;
|
||||
#X connect 40 0 14 1;
|
85
pd-0.44-2/doc/3.audio.examples/B11.sampler.nodoppler.pd
Normal file
|
@ -0,0 +1,85 @@
|
|||
#N canvas 177 116 924 622 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table20 44103 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 631 10 graph;
|
||||
#X obj 582 447 loadbang;
|
||||
#X obj 13 425 hip~ 5;
|
||||
#X floatatom 87 49 0 0 0 0 - - -;
|
||||
#X text 126 48 <-- frequency (Hz.);
|
||||
#X floatatom 150 108 0 0 0 0 - - -;
|
||||
#X obj 150 133 * 441;
|
||||
#X obj 50 220 +~ 1;
|
||||
#X obj 87 73 phasor~ 0;
|
||||
#X msg 175 273 bang;
|
||||
#X text 189 107 <-- chunk size (100ths of a second);
|
||||
#X obj 576 343 adc~ 1;
|
||||
#X obj 576 367 hip~ 5;
|
||||
#X msg 591 390 bang;
|
||||
#X text 630 464 v-- re-read the original sample;
|
||||
#N canvas 0 0 450 300 graph2 0;
|
||||
#X array graph20 44100 float 0;
|
||||
#X coords 0 44100 44100 0 200 130 1;
|
||||
#X restore 633 179 graph;
|
||||
#X obj 13 401 *~;
|
||||
#X obj 72 308 line~;
|
||||
#X obj 149 242 * 441;
|
||||
#X floatatom 149 218 0 0 0 0 - - -;
|
||||
#X obj 72 284 pack 0 100;
|
||||
#X text 184 217 <-- read point in 100ths of a second;
|
||||
#X obj 51 356 +~;
|
||||
#X text 218 272 <-- graph table index;
|
||||
#X obj 72 332 samphold~;
|
||||
#X obj 74 170 samphold~;
|
||||
#X obj 51 196 *~;
|
||||
#X text 643 315 ----- 1 second ------;
|
||||
#X text 631 144 ---- 44103 samples ---;
|
||||
#X obj 591 508 soundfiler;
|
||||
#X text 21 8 SLIDING STABLE LOOPS WITHOUT DOPPLER SHIFT;
|
||||
#X msg 582 534 \; graph20 ylabel 48000 0 44100;
|
||||
#X text 631 390 <-- record;
|
||||
#X obj 13 451 output~;
|
||||
#X obj 12 103 -~ 0.5;
|
||||
#X obj 12 127 *~ 0.5;
|
||||
#X obj 12 150 cos~;
|
||||
#X obj 175 353 tabwrite~ graph20;
|
||||
#X obj 51 381 tabread4~ table20;
|
||||
#X obj 576 417 tabwrite~ table20;
|
||||
#X msg 591 484 read ../sound/voice.wav table20;
|
||||
#X text 11 518 This example differs from the previous one in having
|
||||
samphold~ objects which allow the chunk size and especially the read
|
||||
point to change only at points where the phase wraps around. This removes
|
||||
signal discontinuities (when the chunk size changes) and doppler shift
|
||||
when the read point is changing.;
|
||||
#X text 652 592 updated for Pd version 0.37;
|
||||
#X connect 1 0 31 0;
|
||||
#X connect 1 0 40 0;
|
||||
#X connect 2 0 33 0;
|
||||
#X connect 2 0 33 1;
|
||||
#X connect 3 0 8 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 6 0 25 0;
|
||||
#X connect 7 0 22 0;
|
||||
#X connect 8 0 24 1;
|
||||
#X connect 8 0 25 1;
|
||||
#X connect 8 0 26 0;
|
||||
#X connect 8 0 34 0;
|
||||
#X connect 9 0 37 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 12 0 39 0;
|
||||
#X connect 13 0 39 0;
|
||||
#X connect 16 0 2 0;
|
||||
#X connect 17 0 24 0;
|
||||
#X connect 18 0 20 0;
|
||||
#X connect 19 0 18 0;
|
||||
#X connect 20 0 17 0;
|
||||
#X connect 22 0 37 0;
|
||||
#X connect 22 0 38 0;
|
||||
#X connect 24 0 22 1;
|
||||
#X connect 25 0 26 1;
|
||||
#X connect 26 0 7 0;
|
||||
#X connect 34 0 35 0;
|
||||
#X connect 35 0 36 0;
|
||||
#X connect 36 0 16 0;
|
||||
#X connect 38 0 16 1;
|
||||
#X connect 40 0 29 0;
|
109
pd-0.44-2/doc/3.audio.examples/B12.sampler.transpose.pd
Normal file
|
@ -0,0 +1,109 @@
|
|||
#N canvas 107 88 930 596 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table21 44103 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 645 291 graph;
|
||||
#X obj 467 506 loadbang;
|
||||
#X obj 19 508 hip~ 5;
|
||||
#X floatatom 10 254 0 0 0 0 - - -;
|
||||
#X obj 10 279 * 441;
|
||||
#X obj 10 401 +~ 1;
|
||||
#X text 47 253 <-- chunk size (100ths of a second);
|
||||
#X obj 471 402 adc~ 1;
|
||||
#X obj 471 427 hip~ 5;
|
||||
#X msg 486 449 bang;
|
||||
#X obj 44 482 *~;
|
||||
#X obj 106 404 line~;
|
||||
#X obj 106 354 * 441;
|
||||
#X floatatom 106 329 0 0 0 0 - - -;
|
||||
#X obj 106 379 pack 0 100;
|
||||
#X text 152 331 <-- read point in 100ths of a second;
|
||||
#X obj 44 433 +~;
|
||||
#X obj 106 429 samphold~;
|
||||
#X obj 10 329 samphold~;
|
||||
#X obj 10 304 sig~;
|
||||
#X obj 10 376 *~;
|
||||
#X text 18 5 CALCULATING LOOP FREQUENCY AS FUNCTION OF TRANSPOSITION
|
||||
;
|
||||
#X obj 124 485 r~ phase;
|
||||
#X obj 10 204 s~ phase;
|
||||
#X obj 68 304 r~ phase;
|
||||
#X obj 26 351 r~ phase;
|
||||
#X obj 164 405 r~ phase;
|
||||
#X obj 151 299 s chunk-size;
|
||||
#X floatatom 10 50 0 0 0 0 - - -;
|
||||
#X text 48 51 <-- transposition (10ths of a halftone);
|
||||
#X obj 151 274 * 0.01;
|
||||
#X text 264 287 chunk size;
|
||||
#X text 264 309 in seconds;
|
||||
#X obj 21 105 r chunk-size;
|
||||
#X obj 21 130 t b f;
|
||||
#X obj 10 154 /;
|
||||
#X text 80 131 divide speed change by chunk;
|
||||
#X text 78 152 size to get loop frequency;
|
||||
#X text 382 75 The transposition is frequency in Hz. divided by chunk
|
||||
size in seconds. This patch calculates the loop frequency as a function
|
||||
of desired transposition;
|
||||
#X text 384 126 Notice now that we get Doppler effects when the chunk
|
||||
size changes. You can suppress that if you don't want it \, by converting
|
||||
the chunk size to an audio signal \, sampling and holding it. But then
|
||||
there would be more work to deal with very low frequencies never triggering
|
||||
the sample and hold...;
|
||||
#X obj 467 560 soundfiler;
|
||||
#X obj 10 27 loadbang;
|
||||
#X obj 124 509 -~ 0.5;
|
||||
#X obj 124 533 *~ 0.5;
|
||||
#X obj 124 556 cos~;
|
||||
#X obj 19 533 output~;
|
||||
#X obj 44 458 tabread4~ table21;
|
||||
#X text 527 449 <-- record;
|
||||
#X text 560 513 v-- re-read original table;
|
||||
#X text 682 572 updated for Pd version 0.37;
|
||||
#X text 647 425 --- 44103 samples ---;
|
||||
#X obj 10 75 expr pow(2 \, $f1/120);
|
||||
#X text 199 75 speed change;
|
||||
#X text 387 208 You might also want to have a way to retrigger the
|
||||
loop to sync it with some other process. By the time we had all this
|
||||
built the patch would be fairly involved. For now \, we'll move on
|
||||
to the next topic...;
|
||||
#X obj 10 178 phasor~;
|
||||
#X obj 471 476 tabwrite~ table21;
|
||||
#X msg 467 533 read ../sound/voice.wav table21;
|
||||
#X connect 1 0 56 0;
|
||||
#X connect 2 0 45 0;
|
||||
#X connect 2 0 45 1;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 3 0 30 0;
|
||||
#X connect 4 0 19 0;
|
||||
#X connect 5 0 16 0;
|
||||
#X connect 7 0 8 0;
|
||||
#X connect 8 0 55 0;
|
||||
#X connect 9 0 55 0;
|
||||
#X connect 10 0 2 0;
|
||||
#X connect 11 0 17 0;
|
||||
#X connect 12 0 14 0;
|
||||
#X connect 13 0 12 0;
|
||||
#X connect 14 0 11 0;
|
||||
#X connect 16 0 46 0;
|
||||
#X connect 17 0 16 1;
|
||||
#X connect 18 0 20 0;
|
||||
#X connect 19 0 18 0;
|
||||
#X connect 20 0 5 0;
|
||||
#X connect 22 0 42 0;
|
||||
#X connect 24 0 18 1;
|
||||
#X connect 25 0 20 1;
|
||||
#X connect 26 0 17 1;
|
||||
#X connect 28 0 51 0;
|
||||
#X connect 30 0 27 0;
|
||||
#X connect 33 0 34 0;
|
||||
#X connect 34 0 35 0;
|
||||
#X connect 34 1 35 1;
|
||||
#X connect 35 0 54 0;
|
||||
#X connect 41 0 28 0;
|
||||
#X connect 42 0 43 0;
|
||||
#X connect 43 0 44 0;
|
||||
#X connect 44 0 10 1;
|
||||
#X connect 46 0 10 0;
|
||||
#X connect 51 0 35 0;
|
||||
#X connect 54 0 23 0;
|
||||
#X connect 56 0 40 0;
|
158
pd-0.44-2/doc/3.audio.examples/B13.sampler.overlap.pd
Normal file
|
@ -0,0 +1,158 @@
|
|||
#N canvas 28 47 748 713 12;
|
||||
#X obj 19 511 hip~ 5;
|
||||
#X floatatom 25 38 0 0 100 0 - - -;
|
||||
#X obj 25 63 * 441;
|
||||
#X obj 20 380 +~ 1;
|
||||
#X text 69 35 <-- chunk size (100ths of a second);
|
||||
#X obj 20 458 *~;
|
||||
#X obj 26 211 line~;
|
||||
#X obj 26 161 * 441;
|
||||
#X floatatom 26 136 0 0 100 0 - - -;
|
||||
#X obj 26 186 pack 0 100;
|
||||
#X text 60 137 <-- read point in 100ths of a second;
|
||||
#X obj 20 409 +~;
|
||||
#X obj 76 408 samphold~;
|
||||
#X obj 20 308 samphold~;
|
||||
#X obj 20 355 *~;
|
||||
#X obj 185 369 r~ phase;
|
||||
#X obj 418 210 s~ phase;
|
||||
#X obj 108 308 r~ phase;
|
||||
#X obj 42 332 r~ phase;
|
||||
#X obj 96 383 r~ phase;
|
||||
#X obj 77 82 s chunk-size;
|
||||
#X floatatom 418 56 0 0 0 0 - - -;
|
||||
#X obj 77 57 * 0.01;
|
||||
#X text 189 58 chunk size;
|
||||
#X text 189 80 in seconds;
|
||||
#X obj 429 111 r chunk-size;
|
||||
#X obj 429 136 t b f;
|
||||
#X obj 418 160 /;
|
||||
#X obj 418 33 loadbang;
|
||||
#X obj 185 393 -~ 0.5;
|
||||
#X obj 185 417 *~ 0.5;
|
||||
#X obj 185 440 cos~;
|
||||
#X obj 19 536 output~;
|
||||
#X text 486 684 updated for Pd version 0.37;
|
||||
#X obj 418 81 expr pow(2 \, $f1/120);
|
||||
#X text 607 81 speed change;
|
||||
#X obj 418 184 phasor~;
|
||||
#X text 18 5 TWO OVERLAPPING SAMPLE READ ELEMENTS;
|
||||
#N canvas 30 567 660 275 table 0;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table22 44103 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 442 61 graph;
|
||||
#X text 444 195 --- 44103 samples ---;
|
||||
#X obj 41 148 loadbang;
|
||||
#X obj 45 44 adc~ 1;
|
||||
#X obj 45 69 hip~ 5;
|
||||
#X msg 60 91 bang;
|
||||
#X obj 41 202 soundfiler;
|
||||
#X text 101 91 <-- record;
|
||||
#X text 134 155 v-- re-read original table;
|
||||
#X obj 45 118 tabwrite~ table22;
|
||||
#X msg 41 175 read ../sound/voice.wav table22;
|
||||
#X connect 2 0 10 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 4 0 9 0;
|
||||
#X connect 5 0 9 0;
|
||||
#X connect 10 0 6 0;
|
||||
#X restore 567 327 pd table;
|
||||
#X obj 25 110 s chunk-size-samples;
|
||||
#X text 211 112 ... and in samples;
|
||||
#X obj 26 234 s~ read-pt;
|
||||
#X obj 77 360 r~ read-pt;
|
||||
#X obj 505 203 +~ 0.5;
|
||||
#X obj 506 229 wrap~;
|
||||
#X obj 506 254 s~ phase2;
|
||||
#X obj 20 283 r chunk-size-samples;
|
||||
#X obj 274 391 +~ 1;
|
||||
#X obj 274 469 *~;
|
||||
#X obj 274 420 +~;
|
||||
#X obj 329 419 samphold~;
|
||||
#X obj 274 319 samphold~;
|
||||
#X obj 274 366 *~;
|
||||
#X obj 439 404 -~ 0.5;
|
||||
#X obj 439 428 *~ 0.5;
|
||||
#X obj 439 451 cos~;
|
||||
#X obj 330 371 r~ read-pt;
|
||||
#X obj 274 294 r chunk-size-samples;
|
||||
#X obj 363 320 r~ phase2;
|
||||
#X obj 296 343 r~ phase2;
|
||||
#X obj 439 380 r~ phase2;
|
||||
#X obj 339 394 r~ phase2;
|
||||
#X obj 19 487 +~;
|
||||
#X text 453 56 <-- transposition \, halftones/10;
|
||||
#X text 456 159 loop frequency;
|
||||
#X text 566 190 second phase signal;
|
||||
#X text 566 210 out of phase from;
|
||||
#X text 565 231 first one;
|
||||
#X text 70 265 copy 1;
|
||||
#X text 327 274 copy 2;
|
||||
#X text 118 503 Here is the previous patch modified to use two copies
|
||||
of the sample reader \, 180 degrees out of phase. The second sawtooth
|
||||
signal is derived from the first one by adding a constant (0.5) and
|
||||
wrapping the result to fit again between zero and one. The result is
|
||||
the "phase2" signal.;
|
||||
#X text 119 584 The computation of "chunk-size-samples" (as a message)
|
||||
and "read-pt" (an audio signal) is the same for both copies and is
|
||||
separated out at top left. At top right is the same loop frequency
|
||||
calculation as before.;
|
||||
#X text 120 654 Finally \, the two copies' outputs are added and the
|
||||
result sent to the audio output.;
|
||||
#X obj 20 434 tabread4~ table22;
|
||||
#X obj 274 445 tabread4~ table22;
|
||||
#X connect 0 0 32 0;
|
||||
#X connect 0 0 32 1;
|
||||
#X connect 1 0 2 0;
|
||||
#X connect 1 0 22 0;
|
||||
#X connect 2 0 39 0;
|
||||
#X connect 3 0 11 0;
|
||||
#X connect 5 0 62 0;
|
||||
#X connect 6 0 41 0;
|
||||
#X connect 7 0 9 0;
|
||||
#X connect 8 0 7 0;
|
||||
#X connect 9 0 6 0;
|
||||
#X connect 11 0 73 0;
|
||||
#X connect 12 0 11 1;
|
||||
#X connect 13 0 14 0;
|
||||
#X connect 14 0 3 0;
|
||||
#X connect 15 0 29 0;
|
||||
#X connect 17 0 13 1;
|
||||
#X connect 18 0 14 1;
|
||||
#X connect 19 0 12 1;
|
||||
#X connect 21 0 34 0;
|
||||
#X connect 22 0 20 0;
|
||||
#X connect 25 0 26 0;
|
||||
#X connect 26 0 27 0;
|
||||
#X connect 26 1 27 1;
|
||||
#X connect 27 0 36 0;
|
||||
#X connect 28 0 21 0;
|
||||
#X connect 29 0 30 0;
|
||||
#X connect 30 0 31 0;
|
||||
#X connect 31 0 5 1;
|
||||
#X connect 34 0 27 0;
|
||||
#X connect 36 0 16 0;
|
||||
#X connect 36 0 43 0;
|
||||
#X connect 42 0 12 0;
|
||||
#X connect 43 0 44 0;
|
||||
#X connect 44 0 45 0;
|
||||
#X connect 46 0 13 0;
|
||||
#X connect 47 0 49 0;
|
||||
#X connect 48 0 62 1;
|
||||
#X connect 49 0 74 0;
|
||||
#X connect 50 0 49 1;
|
||||
#X connect 51 0 52 0;
|
||||
#X connect 52 0 47 0;
|
||||
#X connect 53 0 54 0;
|
||||
#X connect 54 0 55 0;
|
||||
#X connect 55 0 48 1;
|
||||
#X connect 56 0 50 0;
|
||||
#X connect 57 0 51 0;
|
||||
#X connect 58 0 51 1;
|
||||
#X connect 59 0 52 1;
|
||||
#X connect 60 0 53 0;
|
||||
#X connect 61 0 50 1;
|
||||
#X connect 62 0 0 0;
|
||||
#X connect 73 0 5 0;
|
||||
#X connect 74 0 48 0;
|
166
pd-0.44-2/doc/3.audio.examples/B14.sampler.rockafella.pd
Normal file
|
@ -0,0 +1,166 @@
|
|||
#N canvas 123 36 683 718 12;
|
||||
#X obj 6 529 hip~ 5;
|
||||
#X floatatom 8 47 4 0 100 0 - - -;
|
||||
#X obj 7 476 *~;
|
||||
#X floatatom 7 123 0 0 200 0 - - -;
|
||||
#X obj 7 378 +~;
|
||||
#X obj 6 330 samphold~;
|
||||
#X obj 7 354 *~;
|
||||
#X obj 172 385 r~ phase;
|
||||
#X obj 357 210 s~ phase;
|
||||
#X obj 94 331 r~ phase;
|
||||
#X obj 42 355 r~ phase;
|
||||
#X obj 8 90 s chunk-size;
|
||||
#X floatatom 357 42 0 0 0 0 - - -;
|
||||
#X text 124 82 chunk size;
|
||||
#X text 121 96 in seconds;
|
||||
#X obj 369 79 r chunk-size;
|
||||
#X obj 369 104 t b f;
|
||||
#X obj 172 409 -~ 0.5;
|
||||
#X obj 172 433 *~ 0.5;
|
||||
#X obj 172 456 cos~;
|
||||
#X obj 7 560 output~;
|
||||
#X text 417 698 updated for Pd version 0.37;
|
||||
#X obj 357 184 phasor~;
|
||||
#N canvas 30 567 660 275 table 0;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table23 44103 float 0;
|
||||
#X coords 0 1.02 44100 -1.02 200 130 1;
|
||||
#X restore 442 61 graph;
|
||||
#X text 444 195 --- 44103 samples ---;
|
||||
#X obj 41 148 loadbang;
|
||||
#X obj 45 44 adc~ 1;
|
||||
#X obj 45 69 hip~ 5;
|
||||
#X msg 60 91 bang;
|
||||
#X obj 41 202 soundfiler;
|
||||
#X text 101 91 <-- record;
|
||||
#X text 134 155 v-- re-read original table;
|
||||
#X obj 45 118 tabwrite~ table23;
|
||||
#X msg 41 175 read ../sound/voice.wav table23;
|
||||
#X connect 2 0 10 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 4 0 9 0;
|
||||
#X connect 5 0 9 0;
|
||||
#X connect 10 0 6 0;
|
||||
#X restore 558 460 pd table;
|
||||
#X obj 7 263 s~ read-pt;
|
||||
#X obj 45 378 r~ read-pt;
|
||||
#X obj 444 203 +~ 0.5;
|
||||
#X obj 445 229 wrap~;
|
||||
#X obj 445 254 s~ phase2;
|
||||
#X obj 6 505 +~;
|
||||
#X text 391 43 <-- transposition \, halftones/10;
|
||||
#X obj 8 67 * 0.001;
|
||||
#X obj 7 215 phasor~;
|
||||
#X obj 7 402 *~ 44100;
|
||||
#X obj 7 452 tabread4~ table23;
|
||||
#X obj 6 305 r chunk-size;
|
||||
#X obj 6 428 +~ 1;
|
||||
#X floatatom 365 161 5 0 0 0 - - -;
|
||||
#X obj 15 169 s precession;
|
||||
#X obj 482 103 t b f;
|
||||
#X obj 482 78 r precession;
|
||||
#X obj 7 146 * 0.01;
|
||||
#X obj 258 485 *~;
|
||||
#X obj 258 387 +~;
|
||||
#X obj 257 339 samphold~;
|
||||
#X obj 258 363 *~;
|
||||
#X obj 423 418 -~ 0.5;
|
||||
#X obj 423 442 *~ 0.5;
|
||||
#X obj 423 465 cos~;
|
||||
#X obj 296 387 r~ read-pt;
|
||||
#X obj 258 411 *~ 44100;
|
||||
#X obj 258 461 tabread4~ table23;
|
||||
#X obj 257 314 r chunk-size;
|
||||
#X obj 257 437 +~ 1;
|
||||
#X obj 345 340 r~ phase2;
|
||||
#X obj 293 364 r~ phase2;
|
||||
#X obj 423 394 r~ phase2;
|
||||
#X text 37 123 <-- precession \, percent;
|
||||
#X obj 8 3 loadbang;
|
||||
#X text 158 3 TIME COMPRESSION/EXPANSION BY LOOPED SAMPLING;
|
||||
#X text 111 529 Here \, rather than ask you to push the read pointer
|
||||
back and forth in the sample \, we use a phasor~. This makes it possible
|
||||
to avoid the samphold~ on the read pointer (r~ read-pt) \, since \,
|
||||
knowing the precession \, we can correct for it in computing the frequency
|
||||
of the original phasor~ at right.;
|
||||
#X text 111 626 We've changed the control for "chunk size" to milliseconds
|
||||
for added convenience \, and delayed multiplying sample location by
|
||||
the sample rate (44100) until the last moment \, so that calculations
|
||||
using "read-pt" and "chunk size" can be in the same units (seconds.)
|
||||
;
|
||||
#X msg 8 25 25;
|
||||
#X floatatom 139 192 4 0 900 0 - - -;
|
||||
#X obj 139 212 * 0.001;
|
||||
#X msg 139 170 900;
|
||||
#X text 48 47 <-- chunk size (msec);
|
||||
#X obj 357 136 expr (pow(2 \, $f1/120)-$f3)/$f2;
|
||||
#X obj 139 237 t b f;
|
||||
#X obj 139 146 loadbang;
|
||||
#X text 182 188 <-- loop length;
|
||||
#X text 223 203 (msec);
|
||||
#X obj 7 239 *~;
|
||||
#X obj 7 191 /;
|
||||
#X connect 0 0 20 0;
|
||||
#X connect 0 0 20 1;
|
||||
#X connect 1 0 31 0;
|
||||
#X connect 2 0 29 0;
|
||||
#X connect 3 0 41 0;
|
||||
#X connect 4 0 33 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 6 0 4 0;
|
||||
#X connect 7 0 17 0;
|
||||
#X connect 9 0 5 1;
|
||||
#X connect 10 0 6 1;
|
||||
#X connect 12 0 67 0;
|
||||
#X connect 15 0 16 0;
|
||||
#X connect 16 0 67 0;
|
||||
#X connect 16 1 67 1;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 18 0 19 0;
|
||||
#X connect 19 0 2 1;
|
||||
#X connect 22 0 8 0;
|
||||
#X connect 22 0 26 0;
|
||||
#X connect 25 0 4 1;
|
||||
#X connect 26 0 27 0;
|
||||
#X connect 27 0 28 0;
|
||||
#X connect 29 0 0 0;
|
||||
#X connect 31 0 11 0;
|
||||
#X connect 32 0 72 0;
|
||||
#X connect 33 0 36 0;
|
||||
#X connect 34 0 2 0;
|
||||
#X connect 35 0 5 0;
|
||||
#X connect 36 0 34 0;
|
||||
#X connect 39 0 67 0;
|
||||
#X connect 39 1 67 2;
|
||||
#X connect 40 0 39 0;
|
||||
#X connect 41 0 38 0;
|
||||
#X connect 41 0 73 0;
|
||||
#X connect 42 0 29 1;
|
||||
#X connect 43 0 50 0;
|
||||
#X connect 44 0 45 0;
|
||||
#X connect 45 0 43 0;
|
||||
#X connect 46 0 47 0;
|
||||
#X connect 47 0 48 0;
|
||||
#X connect 48 0 42 1;
|
||||
#X connect 49 0 43 1;
|
||||
#X connect 50 0 53 0;
|
||||
#X connect 51 0 42 0;
|
||||
#X connect 52 0 44 0;
|
||||
#X connect 53 0 51 0;
|
||||
#X connect 54 0 44 1;
|
||||
#X connect 55 0 45 1;
|
||||
#X connect 56 0 46 0;
|
||||
#X connect 58 0 62 0;
|
||||
#X connect 62 0 1 0;
|
||||
#X connect 63 0 64 0;
|
||||
#X connect 64 0 68 0;
|
||||
#X connect 64 0 72 1;
|
||||
#X connect 65 0 63 0;
|
||||
#X connect 67 0 22 0;
|
||||
#X connect 67 0 37 0;
|
||||
#X connect 68 0 73 0;
|
||||
#X connect 68 1 73 1;
|
||||
#X connect 69 0 65 0;
|
||||
#X connect 72 0 24 0;
|
||||
#X connect 73 0 32 0;
|
66
pd-0.44-2/doc/3.audio.examples/B15.tabread4~-onset.pd
Normal file
|
@ -0,0 +1,66 @@
|
|||
#N canvas 87 57 580 690 12;
|
||||
#X text 355 655 updated for Pd version 0.42;
|
||||
#X text 28 36 Pd is usually compiled to work on 32-bit audio samples.
|
||||
These do not \, in general \, have enough precision for use as indices
|
||||
into an array of more than about 32K samples. This is because the mantissa
|
||||
of a 23-bit floating point number has only 24 bits \, out of which
|
||||
you would be using 16 bits or more to address a sample more than 32K
|
||||
into the array \, so there would remain 8 or fewer bits to supply the
|
||||
fraction. In the most extreme situation possible \, the sample could
|
||||
contain a Nyquist frequency sinusoid and the output would then have
|
||||
only about 8 bits of accuracy!;
|
||||
#X text 29 196 You can use the "onset" inlet to tabread4~ to get good
|
||||
accuracy reading longer arrays. The tabread4~ object adds the index
|
||||
and the "main" (signal) inlet in 64-bit precision. So if \, for example
|
||||
\, the onset inlet could specify an integer exactly up to about 8 million
|
||||
(190 seconds at 44100 Hz) \, and the signal inlet could act as a displacement.
|
||||
;
|
||||
#X text 116 13 USING ONSETS INTO TABREAD4~ TO IMPROVE ACCURACY;
|
||||
#X obj 41 587 output~;
|
||||
#X obj 395 507 samplerate~;
|
||||
#X obj 395 531 / 2;
|
||||
#X obj 384 445 loadbang;
|
||||
#X obj 384 582 tabwrite~ \$0-tab;
|
||||
#X obj 40 557 tabread4~ \$0-tab;
|
||||
#X obj 395 555 osc~;
|
||||
#X obj 172 557 tabread4~ \$0-tab;
|
||||
#X obj 173 589 output~;
|
||||
#X obj 384 486 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
|
||||
-1 -1;
|
||||
#X msg 408 468 \; pd dsp 1;
|
||||
#X obj 41 474 *~ 10000;
|
||||
#X obj 41 527 +~;
|
||||
#X floatatom 192 476 6 0 0 0 - - -;
|
||||
#X msg 247 446 1;
|
||||
#X obj 383 610 table \$0-tab 200000;
|
||||
#X obj 42 446 phasor~ 0.02;
|
||||
#X msg 192 446 150001;
|
||||
#X text 28 310 At left below an onset (1 or 150000 samples) is added
|
||||
to the index of a table lookup. If you select the onset of 150001 \,
|
||||
you should hear the truncation error. (The table contains a Nyquist
|
||||
signal and the "correct" output should be a 100 Hz. tone.) At right
|
||||
\, the onset is presented in the separate onset inlet. The worst-case
|
||||
truncation error drops by about 30 dB.;
|
||||
#X text 57 647 BAD;
|
||||
#X text 190 646 GOOD;
|
||||
#X text 193 425 ONSET INTO TABLE;
|
||||
#X text 384 426 This loads the table:;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 6 0 10 0;
|
||||
#X connect 7 0 13 0;
|
||||
#X connect 7 0 14 0;
|
||||
#X connect 9 0 4 0;
|
||||
#X connect 9 0 4 1;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 11 0 12 1;
|
||||
#X connect 13 0 5 0;
|
||||
#X connect 13 0 8 0;
|
||||
#X connect 15 0 16 0;
|
||||
#X connect 15 0 11 0;
|
||||
#X connect 16 0 9 0;
|
||||
#X connect 17 0 11 1;
|
||||
#X connect 17 0 16 1;
|
||||
#X connect 18 0 17 0;
|
||||
#X connect 20 0 15 0;
|
||||
#X connect 21 0 17 0;
|
158
pd-0.44-2/doc/3.audio.examples/B16.long-varispeed.pd
Normal file
|
@ -0,0 +1,158 @@
|
|||
#N canvas 332 70 817 861 12;
|
||||
#X obj 399 526 metro 100;
|
||||
#X obj 212 472 phasor~;
|
||||
#X obj 399 556 snapshot~;
|
||||
#X text 561 824 updated for Pd version 0.42;
|
||||
#X obj 23 557 output~;
|
||||
#X obj 23 461 phasor~;
|
||||
#X floatatom 23 329 5 -100 1000 0 - - -;
|
||||
#X obj 23 518 tabread4~ \$0-tab;
|
||||
#X msg 290 329 0.5;
|
||||
#X msg 326 329 0.01;
|
||||
#X obj 398 455 loadbang;
|
||||
#X msg 399 478 1;
|
||||
#X obj 344 635 +;
|
||||
#X obj 144 680 tabread4~ \$0-tab;
|
||||
#X obj 375 634 f;
|
||||
#X obj 312 612 t f f;
|
||||
#X obj 145 712 output~;
|
||||
#X floatatom 455 667 8 0 0 0 - - -;
|
||||
#X obj 344 670 t f b;
|
||||
#X obj 377 699 f;
|
||||
#X obj 344 699 -;
|
||||
#X floatatom 457 612 8 0 0 0 - - -;
|
||||
#X obj 326 726 -;
|
||||
#X obj 399 507 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
|
||||
1;
|
||||
#X obj 212 498 -~ 0.5;
|
||||
#X obj 290 811 + 0.5;
|
||||
#X obj 22 490 *~ 1e+06;
|
||||
#X floatatom 326 753 8 0 0 0 - - -;
|
||||
#X obj 530 519 samplerate~;
|
||||
#X obj 484 546 /;
|
||||
#X obj 484 519 t f b;
|
||||
#X obj 451 589 +;
|
||||
#X obj 295 787 / 10000;
|
||||
#X obj 212 523 *~ 10000;
|
||||
#X obj 484 570 * 10000;
|
||||
#X obj 532 155 samplerate~;
|
||||
#X obj 532 179 / 2;
|
||||
#X obj 521 93 loadbang;
|
||||
#X obj 521 230 tabwrite~ \$0-tab;
|
||||
#X obj 532 203 osc~;
|
||||
#X obj 521 134 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
|
||||
-1 -1;
|
||||
#X msg 545 116 \; pd dsp 1;
|
||||
#X obj 520 258 table \$0-tab 1e+06;
|
||||
#X text 488 61 and will take about 20 seconds to fill.;
|
||||
#X text 488 45 *** The table is now 1 million points \,;
|
||||
#X obj 23 433 / 1e+06;
|
||||
#X text 61 328 playback speed \, samples/sec;
|
||||
#X text 89 460 naive way: just;
|
||||
#X text 89 475 run a phasor;
|
||||
#X text 88 491 into tabread4~;
|
||||
#X text 454 680 new onset is phase plus old onset;
|
||||
#X obj 341 357 * 1e+06;
|
||||
#X text 458 626 extrapolated phase of next sample;
|
||||
#X text 409 700 new onset minus old onset;
|
||||
#X text 389 726 back up phasor output by amount the onset advanced
|
||||
;
|
||||
#X text 387 739 (approximately zero but not exactly because of;
|
||||
#X text 389 753 truncation error!);
|
||||
#X obj 341 383 t b f;
|
||||
#X text 400 357 convert to samples;
|
||||
#X text 385 384 set both last-onset and previous-onset;
|
||||
#X text 385 407 ... and also reset phasor.;
|
||||
#X text 354 791 convert phase back to range 0-1;
|
||||
#X text 215 548 convert phase to;
|
||||
#X text 215 562 range +/-5000;
|
||||
#X obj 212 435 / 10000;
|
||||
#X text 40 410 cycles/sec;
|
||||
#X text 30 400 convert to;
|
||||
#X text 216 412 cycles/sec;
|
||||
#X text 206 402 convert to;
|
||||
#X text 469 472 in order to change onset to reflect it;
|
||||
#X text 469 456 Each 100 msec \, poll phase of phasor~;
|
||||
#X text 24 29 Here is how to use the tabread~ "onset" input to allow
|
||||
clean varispeed playback from a long table. At left \, a phasor~ is
|
||||
naiveley rescaled to the size of the tble. At right \, the phasor~
|
||||
gets only a 10000-point range about a moving "onset". Ten times per
|
||||
second \, we poll tha phasor~ phase \, sum its value into the onset
|
||||
\, and back up the phase of the phasor~ correspondingly.;
|
||||
#X text 22 143 The tricky bits are \, first \, that we need to poll
|
||||
the phasor~ phase one sample into the future (so we add the per-sample
|
||||
increment into the snapshot~ result). Second \, we can't just reset
|
||||
the phasor~ to a fixed point - instead \, we measure how much the onset
|
||||
has actually increased (which has truncation error from summing in
|
||||
the phase snapshot) \, and subtract that increase from the phase \,
|
||||
giving a value that differs from zero by the truncation error but reflects
|
||||
the true phase we should reset to for continuity.;
|
||||
#X text 24 287 The metronome rate is arbitrary but should be fast enough
|
||||
that the phasor~ never has time to wrap.;
|
||||
#X text 518 539 extrapolate snapshot of phase by one;
|
||||
#X text 517 552 sample to sync with next block;
|
||||
#X text 41 617 BAD;
|
||||
#X text 160 770 GOOD;
|
||||
#X text 195 9 VARIABLE SPEED PLAYBACK FROM LONG TABLES;
|
||||
#X msg 340 408 0;
|
||||
#X text 369 328 <- reset phase. 0.5 causes trouble for the "bad" way.
|
||||
;
|
||||
#X connect 0 0 2 0;
|
||||
#X connect 1 0 24 0;
|
||||
#X connect 2 0 31 0;
|
||||
#X connect 5 0 26 0;
|
||||
#X connect 6 0 45 0;
|
||||
#X connect 6 0 64 0;
|
||||
#X connect 7 0 4 0;
|
||||
#X connect 7 0 4 1;
|
||||
#X connect 8 0 5 1;
|
||||
#X connect 8 0 51 0;
|
||||
#X connect 9 0 5 1;
|
||||
#X connect 9 0 51 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 23 0;
|
||||
#X connect 12 0 14 0;
|
||||
#X connect 12 0 18 0;
|
||||
#X connect 12 0 13 1;
|
||||
#X connect 12 0 17 0;
|
||||
#X connect 13 0 16 0;
|
||||
#X connect 13 0 16 1;
|
||||
#X connect 14 0 12 1;
|
||||
#X connect 15 0 22 0;
|
||||
#X connect 15 1 12 0;
|
||||
#X connect 18 0 19 1;
|
||||
#X connect 18 0 20 0;
|
||||
#X connect 18 1 19 0;
|
||||
#X connect 19 0 20 1;
|
||||
#X connect 20 0 22 1;
|
||||
#X connect 22 0 27 0;
|
||||
#X connect 22 0 32 0;
|
||||
#X connect 23 0 0 0;
|
||||
#X connect 24 0 33 0;
|
||||
#X connect 25 0 1 1;
|
||||
#X connect 26 0 7 0;
|
||||
#X connect 28 0 29 1;
|
||||
#X connect 29 0 34 0;
|
||||
#X connect 30 0 29 0;
|
||||
#X connect 30 1 28 0;
|
||||
#X connect 31 0 15 0;
|
||||
#X connect 31 0 21 0;
|
||||
#X connect 32 0 25 0;
|
||||
#X connect 33 0 2 0;
|
||||
#X connect 33 0 13 0;
|
||||
#X connect 34 0 31 1;
|
||||
#X connect 35 0 36 0;
|
||||
#X connect 36 0 39 0;
|
||||
#X connect 37 0 40 0;
|
||||
#X connect 37 0 41 0;
|
||||
#X connect 39 0 38 0;
|
||||
#X connect 40 0 35 0;
|
||||
#X connect 40 0 38 0;
|
||||
#X connect 45 0 5 0;
|
||||
#X connect 51 0 57 0;
|
||||
#X connect 57 0 79 0;
|
||||
#X connect 57 1 19 1;
|
||||
#X connect 57 1 12 1;
|
||||
#X connect 64 0 1 0;
|
||||
#X connect 64 0 30 0;
|
||||
#X connect 79 0 15 0;
|
102
pd-0.44-2/doc/3.audio.examples/C01.nyquist.pd
Normal file
|
@ -0,0 +1,102 @@
|
|||
#N canvas 601 188 580 659 12;
|
||||
#N canvas 0 0 450 300 graph1 0;
|
||||
#X array table24 259 float 1;
|
||||
#A 0 -0.294693 0 0.294693 0.4 0.28948 0.10749 0.022875 0.0789655 0.181673
|
||||
0.218249 0.171348 0.115564 0.119192 0.169863 0.201356 0.178657 0.137857
|
||||
0.138353 0.188891 0.23571 0.22487 0.164534 0.115848 0.125265 0.176634
|
||||
0.214361 0.205655 0.169043 0.14204 0.134157 0.124033 0.0997798 0.0859507
|
||||
0.118173 0.195202 0.270956 0.301868 0.293569 0.285908 0.289835 0.256276
|
||||
0.128881 -0.0684912 -0.215994 -0.195335 -0.0145421 0.174701 0.203986
|
||||
0.0451069 -0.159794 -0.231026 -0.119011 0.0575033 0.135323 0.0628509
|
||||
-0.0665307 -0.124779 -0.0776696 0.000279083 0.0247376 -0.00546273 -0.0222151
|
||||
0.017933 0.0755681 0.0749102 4.97367e-06 -0.0729564 -0.0490464 0.0834901
|
||||
0.232853 0.286943 0.213202 0.0759584 -0.0357248 -0.0863297 -0.101697
|
||||
-0.115455 -0.125625 -0.107127 -0.0530433 0.012152 0.0608637 0.0902219
|
||||
0.111597 0.119683 0.0910146 0.0236817 -0.0326555 -0.0100379 0.100844
|
||||
0.216022 0.223032 0.094995 -0.0649958 -0.110291 0.00678482 0.180334
|
||||
0.247439 0.144699 -0.0319975 -0.124321 -0.0648335 0.0680811 0.141409
|
||||
0.100343 0.00354248 -0.0636733 -0.0891566 -0.131987 -0.227286 -0.316392
|
||||
-0.293048 -0.12222 0.100475 0.222686 0.173879 0.0281889 -0.0714016
|
||||
-0.0482686 0.0482418 0.108884 0.0773858 -0.00559103 -0.0590099 -0.0454391
|
||||
0.00509731 0.0411467 0.0421476 0.0225557 2.40108e-06 -0.0225508 -0.0421448
|
||||
-0.0411506 -0.00510821 0.0454302 0.0590142 0.0056084 -0.0773706 -0.108887
|
||||
-0.0482625 0.048252 0.0714103 -0.0281575 -0.173853 -0.222693 -0.100517
|
||||
0.122172 0.293026 0.316402 0.22731 0.132002 0.0891614 0.063682 -0.00352253
|
||||
-0.100324 -0.141412 -0.0681076 0.0648079 0.124324 0.0320316 -0.144663
|
||||
-0.247435 -0.180365 -0.00682225 0.110282 0.0650224 -0.0949583 -0.223017
|
||||
-0.216038 -0.100873 0.010022 0.0326611 -0.0236657 -0.0910033 -0.119682
|
||||
-0.111601 -0.0902271 -0.0608718 -0.0121649 0.0530291 0.107119 0.125625
|
||||
0.115458 0.101699 0.0863353 0.0357423 -0.0759289 -0.213176 -0.28694
|
||||
-0.232878 -0.0835252 0.0490278 0.0729642 1.4921e-05 -0.0749008 -0.0755765
|
||||
-0.0179463 0.0222127 0.00547055 -0.0247352 -0.000292052 0.0776522 0.12478
|
||||
0.0665546 -0.062824 -0.135322 -0.0575355 0.118973 0.23102 0.159828
|
||||
-0.0450604 -0.203969 -0.174729 0.014495 0.195309 0.21601 0.0685338
|
||||
-0.128843 -0.25626 -0.289835 -0.285909 -0.293565 -0.30187 -0.270969
|
||||
-0.195221 -0.118186 -0.0859518 -0.0997742 -0.124029 -0.134156 -0.142036
|
||||
-0.169035 -0.205649 -0.214364 -0.176646 -0.125273 -0.115843 -0.16452
|
||||
-0.22486 -0.235715 -0.188904 -0.13836 -0.137851 -0.178647 -0.201357
|
||||
-0.169874 -0.1192 -0.115557 -0.171333 -0.218246 -0.181691 -0.0789875
|
||||
-0.0228734 -0.107456 -0.289441 -0.399997 -0.294741 -7.20325e-05 0.294645
|
||||
;
|
||||
#X coords 0 1.02 258 -1.02 258 130 1;
|
||||
#X restore 93 408 graph;
|
||||
#X obj 33 288 line~;
|
||||
#X msg 33 237 500 \, 1423 4000;
|
||||
#X floatatom 41 262 5 0 0 0 - - -;
|
||||
#X text 24 556 Synthesis techniques vary in their tendency to make
|
||||
foldover. For higher pitched sounds you'll want to try out relatively
|
||||
folvover-resistant ones.;
|
||||
#X obj 33 342 output~;
|
||||
#X obj 201 281 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#N canvas 0 0 618 384 make-tab 0;
|
||||
#X obj 13 28 inlet;
|
||||
#X obj 99 28 inlet;
|
||||
#X obj 183 28 inlet;
|
||||
#X obj 255 29 inlet;
|
||||
#X msg 38 176 \; table24 sinesum 256 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0
|
||||
1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 \, normalize
|
||||
0.4;
|
||||
#X msg 14 277 \; table24 sinesum 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 \, normalize
|
||||
0.2;
|
||||
#X msg 183 101 \; table24 const 0 \, 0 1 1 1 1 1;
|
||||
#X msg 255 58 \; table24 const 0;
|
||||
#X connect 0 0 5 0;
|
||||
#X connect 1 0 4 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 3 0 7 0;
|
||||
#X restore 201 355 pd make-tab;
|
||||
#X obj 232 300 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 263 317 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X obj 295 334 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
|
||||
-1;
|
||||
#X text 222 276 sine;
|
||||
#X text 252 297 complex;
|
||||
#X text 284 314 rectangle;
|
||||
#X text 313 332 clear;
|
||||
#X obj 33 315 tabosc4~ table24;
|
||||
#X text 56 2 THE NYQUIST THEOREM AND FOLDOVER;
|
||||
#X text 30 33 WARNING: PLAY THIS QUIETLY TO AVOID UNPLEASANTNESS AND
|
||||
POSSIBLE EAR DAMAGE.;
|
||||
#X text 29 77 Foldover occurs when you synthesize frequencies greater
|
||||
than the Nyquist frequency (half the sample rate). In this example
|
||||
\, the fundamental only reaches 1423 \, but the tables contain high
|
||||
partials. As the partials sweep upward you hear them reflect off the
|
||||
Nyquist frequency. Also \, partials can come into contact with each
|
||||
other causing beating. The value of 1423 was chosen to make the beating
|
||||
effect especially strong if you're running at a sample rate of 44100
|
||||
(the usual one.);
|
||||
#X text 330 616 updated for Pd version 0.37;
|
||||
#X text 219 245 waveforms:;
|
||||
#X connect 1 0 15 0;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 1 0;
|
||||
#X connect 6 0 7 0;
|
||||
#X connect 8 0 7 1;
|
||||
#X connect 9 0 7 2;
|
||||
#X connect 10 0 7 3;
|
||||
#X connect 15 0 5 0;
|
||||
#X connect 15 0 5 1;
|