Example C03.zipper.noise.pd (Figure <AHREF="node51.html#fig03.13">3.13</A>, part b) demonstrates the effect of
converting a slowly-updated control stream to an audio signal. This introduces
a new object:
<P>
<BR><!-- MATH
$\fbox{ $\mathrm{line}$}$
-->
<IMG
WIDTH="44" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
SRC="img345.png"
ALT="\fbox{ $\mathrm{line}$}">:
<ANAME="3847"></A>a ramp generator with control output. Like <TT>line~</TT>, <TT>line</TT> takes pairs of numbers as (target, time) pairs and ramps to the target in the
given amount of time; however, unlike <TT>line~</TT>, the output is
a numeric control stream, appearing, by default, at 20 msec time intervals.
<P>
In the example you can compare the sound of the rising and falling amplitude
controlled by the <TT>line</TT> output with one controlled by the audio
signal generated by <TT>line~</TT>.
<P>
The output of <TT>line</TT> is converted to an audio signal at the input of
the <TT>*~</TT> object. The conversion is implied here by connecting a
numeric control stream into a signal inlet. In Pd, implicit conversions from
numeric control streams to audio streams is done in the fast-as-possible mode
shown in Figure <AHREF="node43.html#fig03.04">3.4</A> (part a). The <TT>line</TT> output becomes a
staircase signal with 50 steps per second. The result is commonly called
``zipper noise".
<P>
Whereas the limitations of the <TT>line</TT> object for generating audio
signals were clearly audible even over such long time periods as 300 msec, the
signal variant, <TT>line~</TT>, does not yield audible problems until the time
periods involved become much shorter. Example C04.control.to.signal.pd (Figure <AHREF="node51.html#fig03.13">3.13</A>,
part c) demonstrates the effect of using <TT>line~</TT> to generate a 250 Hertz
triangle wave. Here the effects shown in Figure <AHREF="node43.html#fig03.05">3.5</A> come into
play. Since <TT>line~</TT> always aligns line segments to block boundaries, the
exact durations of line segments vary, and in this example the variation (on
the order of a millisecond) is a significant fraction of their
length.
<P>
A more precise object (and a more expensive one, in terms of computation time)
is provided for these situations:
<P>
<BR><!-- MATH
$\fbox{ $\mathrm{vline}\sim$}$
-->
<IMG
WIDTH="69" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
SRC="img346.png"
ALT="\fbox{ $\mathrm{vline}\sim$}">:
<ANAME="3848"></A>exact line segment generator. This third member of the ``line" family
outputs an audio signal (like <TT>line~</TT>), but aligns the endpoints of the signal to
the desired time points, accurate to a fraction of a sample. (The accuracy
is limited only by the floating-point numerical format used by Pd.) Further,
many line segments may be specified withing a single audio block;
<TT>vline~</TT> can generate waveforms at periods down to two samples
(beyond which you will just get foldover instead).
<P>
The <TT>vline~</TT> object can also be used for converting numeric
control streams to audio streams in the nearest-sample and two-point-interpolation
modes as shown in Figure <AHREF="node43.html#fig03.04">3.4</A> (parts b and
c). To get nearest-sample conversion, simply give <TT>vline~</TT> a
ramp time of zero. For linear interpolation, give it a ramp time of
one sample (0.0227 msec if the sample rate is 44100 Hertz).