File: chorus.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (62 lines) | stat: -rw-r--r-- 2,796 bytes parent folder | download | duplicates (6)
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
<HTML>
<TITLE>CHORUSING</TITLE>
<CENTER><P><A NAME="Chorusing"></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="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./envel.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./vibr.html">Next</A> 
<HR></P></CENTER>

<H2>Toot 4: Chorusing</H2>

<P>Next we'll animate the basic sound by mixing it with two slightly detuned
copies of itself. We'll employ Csound's &quot;cpspch&quot; value converter
which will allow us to specify the pitches by octave and pitch-class rather
than by frequency, and we'll use the &quot;ampdb&quot; converter to specify
loudness in dB rather than linearly. </P>

<P>Since we are adding the outputs of three oscillators, each with the
same amplitude envelope, we'll scale the amplitude before we mix them.
Both &quot;iscale&quot; and &quot;inote&quot; are arbitrary names to make
the design a bit easier to read. Each is an <B>i</B>-rate variable, evaluated
when the instrument is initialized.</P>

<PRE><TT>  instr 4                            ; toot4.orc
   iamp    = ampdb(p4)               ; convert decibels to linear amp
   iscale  = iamp * .333             ; scale the amp at initialization
   inote   = cpspch(p5)              ; convert &quot;octave.pitch&quot; to cps
   k1  linen     iscale, p6, p3, p7  ; p4=amp
   a3  oscil     k1, inote*.996, 1   ; p5=freq
   a2  oscil     k1, inote*1.004, 1  ; p6=attack time
   a1  oscil     k1, inote, 1        ; p7=release time
   a1  =         a1 + a2 + a3 
       out       a1             
  endin     

  f1 0 4096 10 1                                 ; sine wave
;instr    start  duration  amp(p4)   freq(p5)  attack(p6) release(p7)
  i4       0     1         75        8.04     .1          .7
  i4       1     1         70        8.02     .07         .6
  i4       2     1         75        8.00     .05         .5
  i4       3     1         70        8.02     .05         .4
  i4       4     1         85        8.04     .1          .5
  i4       5     1         80        8.04     .05         .5
  i4       6     2         90        8.04     .03          1
e</TT>

</PRE>

<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="./TUTORIALS.html">Top of this section</A></B> - <A HREF="./envel.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./vibr.html">Next</A> 
<HR></P></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>