2022-04-12 22:02:59 -03:00
|
|
|
<!DOCTYPE html>
|
2022-04-12 21:54:18 -03:00
|
|
|
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
|
|
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
|
|
* with significant contributions from:
|
|
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
2022-04-12 22:02:59 -03:00
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
|
2022-04-12 21:54:18 -03:00
|
|
|
<TITLE>Using a wavetable as a sampler</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Using a wavetable as a sampler">
|
|
|
|
<META NAME="keywords" CONTENT="book">
|
|
|
|
<META NAME="resource-type" CONTENT="document">
|
|
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
|
|
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
|
|
|
|
<LINK REL="STYLESHEET" HREF="book.css">
|
|
|
|
|
|
|
|
<LINK REL="next" HREF="node36.html">
|
|
|
|
<LINK REL="previous" HREF="node34.html">
|
|
|
|
<LINK REL="up" HREF="node32.html">
|
|
|
|
<LINK REL="next" HREF="node36.html">
|
|
|
|
</HEAD>
|
|
|
|
|
|
|
|
<BODY >
|
|
|
|
<!--Navigation Panel-->
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1064"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node36.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="next.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1058"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node32.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="up.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1052"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node34.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="prev.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1060"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">
|
|
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="contents.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1062"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">
|
|
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="index.png"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<BR>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Next:</B> <A ID="tex2html1065"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node36.html">Looping samplers</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Up:</B> <A ID="tex2html1059"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node32.html">Examples</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Previous:</B> <A ID="tex2html1053"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node34.html">Wavetable lookup in general</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1061"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">Contents</A></B>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1063"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">Index</A></B>
|
|
|
|
<BR>
|
|
|
|
<BR>
|
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
|
2022-04-12 23:32:40 -03:00
|
|
|
<H2><A ID="SECTION00663000000000000000">
|
2022-04-12 21:54:18 -03:00
|
|
|
Using a wavetable as a sampler</A>
|
|
|
|
</H2>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Example B04.sampler.pd (Figure <A HREF="#fig02.14">2.14</A>) shows how to use a wavetable as a
|
|
|
|
sampler. In this example the index into the sample (the wavetable) is controlled
|
|
|
|
by mousing on a number box at top. A convenient scaling for the number box is
|
|
|
|
hundredths of a second; to convert to samples (as the input of
|
|
|
|
<TT>tabread4~</TT> requires) we multiply by 44100 samples/sec times 0.01 sec to get 441 samples
|
|
|
|
per unit, before applying <TT>pack</TT> and <TT>line~</TT> in much the same way
|
|
|
|
as they were used in the previous example.
|
|
|
|
The transposition you hear depends on how quickly you mouse up and down.
|
|
|
|
This example has introduced one new object class:
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2022-04-12 23:32:40 -03:00
|
|
|
<DIV ALIGN="CENTER"><A ID="fig02.14"></A><A ID="2430"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<TABLE>
|
|
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.14:</STRONG>
|
|
|
|
A sampler with mouse-controlled index: B04.sampler.pd.</CAPTION>
|
|
|
|
<TR><TD><IMG
|
|
|
|
WIDTH="336" HEIGHT="468" BORDER="0"
|
|
|
|
SRC="img279.png"
|
|
|
|
ALT="\begin{figure}\psfig{file=figs/fig02.14.ps}\end{figure}"></TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
</DIV>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<BR><!-- MATH
|
|
|
|
$\fbox{ $\mathrm{hip}\sim$\ }$
|
|
|
|
-->
|
|
|
|
<IMG
|
|
|
|
WIDTH="63" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
|
|
|
|
SRC="img280.png"
|
|
|
|
ALT="\fbox{ $\mathrm{hip}\sim$\ }">:
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="2558"></A>simple high-pass (low-cut) filter. The creation argument gives the roll-off
|
2022-04-12 21:54:18 -03:00
|
|
|
frequency in cycles per second. We use it here to eliminate the constant
|
|
|
|
(zero-frequency)
|
|
|
|
output when the input sits in a single sample (whenever you aren't actively
|
|
|
|
changing the wavetable reading location with the mouse). Filters are discussed
|
|
|
|
in Chapter <A HREF="node127.html#chapter-filter">8</A>.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
The <TT>pack</TT> and <TT>line~</TT> in this example are not included merely to
|
|
|
|
make the sound more continuous, but are essential to making the sound
|
|
|
|
intelligible at all. If the index into the wavetable lookup simply changed
|
|
|
|
every time the mouse moved a pixel (say, twenty to fifty times a second) the
|
|
|
|
overwhelming majority of samples would get the same index as the previous
|
|
|
|
sample (the other 44000+ samples, not counting the ones where the mouse
|
|
|
|
moved.) So the speed of precession would almost always be zero. Instead of
|
|
|
|
changing transpositions, you would hear 20 to 50 cycles-per-second grit. (Try
|
|
|
|
it to find out what that sounds like!)
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
|
|
<!--Navigation Panel-->
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1064"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node36.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="next.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1058"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node32.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="up.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1052"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node34.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="prev.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1060"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">
|
|
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="contents.png"></A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<A ID="tex2html1062"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">
|
|
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
2022-04-12 22:02:59 -03:00
|
|
|
SRC="index.png"></A>
|
2022-04-12 21:54:18 -03:00
|
|
|
<BR>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Next:</B> <A ID="tex2html1065"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node36.html">Looping samplers</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Up:</B> <A ID="tex2html1059"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node32.html">Examples</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> Previous:</B> <A ID="tex2html1053"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node34.html">Wavetable lookup in general</A>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1061"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node4.html">Contents</A></B>
|
2022-04-12 23:32:40 -03:00
|
|
|
<B> <A ID="tex2html1063"
|
2022-04-12 21:54:18 -03:00
|
|
|
HREF="node201.html">Index</A></B>
|
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
<ADDRESS>
|
|
|
|
Miller Puckette
|
|
|
|
2006-12-30
|
|
|
|
</ADDRESS>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|