As described in section 2.3, it is sometimes desirable to use two or more overlapping looping samplers to produce a reasonably continuous sound without having to envelope too sharply at the ends of the loop. This is especially likely in situations where the chunk that is looped is short, a tenth of a second or less. Patch B10.sampler.overlap.pd, shown in Figure 2.16 (part a), realizes two looping samplers a half-cycle out of phase from each other. New object classes are:
:
output a ``bang" message on load. This is used in this patch to make sure the
division of transposition by chunk size will have a valid transposition factor
in case ``chunk size" is moused on first.
:
evaluate arithmetic expressions. Variables appear as $f1, $f2, and so on,
corresponding to the object's inlets. Arithmetic expressions are allowed,
with parentheses for grouping, and many library functions are supplied,
such as exponentiation, which shows up in this example as ``pow" (the
power function.)
:
wrap to the interval from 0 to 1. So, for instance, 1.2 becomes 0.2; 0.5
remains unchanged; and -0.6 goes to 0.4.
,
:
,
:
signal versions of and
. An audio
signal sent to a
appears at the outlets of any and
all
objects of the same name. Unlike
and
, you may not have more than one
object with the same name (in that connection, see
the
and
objects).
In the example, part of the wavetable reading machinery is duplicated, using
identical calculations of chunk-size-samples
(a message stream) and
read-pt
(an audio signal smoothed as before). However, the phase
audio signal, in the other copy, is replaced by phase2
. The top part
of the figure shows the calculation of the two phase signals: the first one
as the output of a
object, and the second by adding
0.5 and wrapping, thereby subtracting 0.5 cycles ( radians) from the
phase. The two phase signals are each used, with the same range adjustments as
before, to calculate indices into the wavetable and the
object, and to control the two
objects. Finally, the
outputs of the two copies are added for output.