1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
<TITLE>PLUCK</TITLE>
</HEAD>
<BODY>
<CENTER><A NAME="pluck"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_GENS.html#">Top of this section</A></B> - <A HREF="granule.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="repluck.html">Next</A>
<HR></CENTER>
<H2>
pluck</H2>
<PRE> ar <B>pluck</B> kamp, kcps, icps, ifn, imeth [, iparm1, iparm2]</PRE>
<HR>
<H4>
<U>DESCRIPTION</U></H4>
Audio output is a naturally decaying plucked string or drum sound based
on the Karplus-Strong algorithms.
<H4>
<U>INITIALIZATION</U></H4>
<I>icps</I> - intended pitch value in cps, used to set up a buffer of 1
cycle of audio samples which will be smoothed over time by a chosen decay
method. <I>icps</I> normally anticipates the value of<I>kcps</I>, but may
be set artificially high or low to influence the size of the sample buffer.
<P><I>ifn</I> - table number of a stored function used to initialize the
cyclic decay buffer. If <I>ifn</I> = 0, a random sequence will be used
instead.
<P><I>imeth</I> - method of natural decay. There are six, some of which
use parameters values that follow.
<OL>
<LI>
simple averaging. A simple smoothing process, uninfluenced by parameter
values.</LI>
<LI>
stretched averaging. As above, with smoothing time stretched by a factor
of <I>iparm1</I> ( >= 1 ).</LI>
<LI>
simple drum. The range from pitch to noise is controlled by a 'roughness
factor' in <I>iparm1</I> (0 to 1). Zero gives the plucked string effect,
while 1 reverses the polarity of every sample (octave down, odd harmonics).
The setting .5 gives an optimum snare drum.</LI>
<LI>
stretched drum. Combines both roughness and stretch factors. <I>iparm1</I>
is roughness (0 to 1), and <I>iparm2</I> the stretch factor ( >= 1 ).</LI>
<LI>
weighted averaging. As method 1, with <I>iparm1</I> weighting the current
sample (the status quo) and <I>iparm2</I> weighting the previous adjacent
one. <I>iparm1 + iparm2</I>must be <= 1.</LI>
<LI>
1st order recursive filter, with coefs .5. Unaffected by parameter values.</LI>
</OL>
<I>iparm1, iparm2</I> (optional) - parameter values for use by the smoothing
algorithms (above). The default values are both 0.
<H4>
<U>PERFORMANCE</U></H4>
An internal audio buffer, filled at I-time according to <I>ifn</I>, is
continually resampled with periodicity <I>kcps</I> and the resulting output
is multiplied by <I>kamp</I>. Parallel with the sampling, the buffer is
smoothed to simulate the effect of natural decay.
<P>Plucked strings (1,2,5,6) are best realized by starting with a random
noise source, which is rich in initial harmonics. Drum sounds (methods
3,4) work best with a flat source (wide pulse), which produces a deep noise
attack and sharp decay.
<P>The original Karplus-Strong algorithm used a fixed number of samples
per cycle, which caused serious quantization of the pitches available and
their intonation. This implementation resamples a buffer at the exact pitch
given by <I>kcps</I>, which can be varied for vibrato and glissando effects.
For low values of the orch sampling rate (e.g. <I>sr</I> = 10000), high
frequencies will store only very few samples (<I>sr / icps</I>). Since
this may cause noticeable noise in the resampling process, the internal
buffer has a minimum size of 64 samples. This can be further enlarged by
setting <I>icps</I> to some artificially lower pitch.
<CENTER></CENTER>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_GENS.html#">Top of this section</A></B> - <A HREF="granule.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="repluck.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|