File: reverb.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 (104 lines) | stat: -rw-r--r-- 4,492 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
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>
<TITLE>GLOBAL_STEREO_REVERB</TITLE>
<CENTER><P><A NAME="Global_Stereo_Reverb"></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="./sound.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./filt.html">Next</A> 
<HR></P></CENTER>

<H2>Toot 9: Global Stereo Reverb</H2>

<P>In the previous example you may have noticed the soundin source being
&quot;cut off&quot; at ends of notes, because the reverb was <B>inside
</B>the instrument itself. It is better to create a companion instrument,
a global reverb instrument, to which the source signal can be sent. Let's
also make this stereo.</P>

<P>Variables are named cells which store numbers. In Csound, they can be
either <I>local</I> or <I>global</I>, are available continuously, and can
be updated at one of four rates - setup, <B>i</B>-rate, <B>k</B>-rate,
or <B>a</B>-rate. </P>

<P><B><A HREF="./../Syntax/const.html">Local Variables</A></B>
(which begin with the letters <B>p</B>, <B>i</B>, <B>k</B>, or <B>a</B>)
are private to a particular instrument. They cannot be read from, or written
to, by any other instrument. </P>

<P><B><A HREF="./../Syntax/const.html">Global Variables</A></B>
are cells which are accessible by all instruments. Three of the same four
variable types are supported (<B>i</B>, <B>k</B>, and <B>a)</B>, but these
letters are preceded by the letter <B>g</B> to identify them as &quot;global.&quot;
Global variables are used for &quot;broadcasting&quot; general values,
for communicating between instruments, and for sending sound from one instrument
to another.</P>

<P>The reverb instr99 below receives input from instr9 via the global a-rate
variable garvbsig. Since instr9 <I>adds into</I> this global, several copies
of instr9 can do this without losing any data. The addition requires <I>garvbsig</I>
to be cleared before each k-rate pass through any active instruments. This
is accomplished first with an <B><A HREF="./../Syntax/assign.html">init</A></B>
statement in the orchestra header, giving the reverb instrument a higher
number than any other (instruments are performed in numerical order), and
then clearing <I>garvbsig</I> within instr99 once its data has been placed
into the reverb.</P>

<PRE><TT>  sr        =    18900          ; toot9.orc
  kr        =    945
  ksmps     =    20
  nchnls    =    2              ; stereo
  garvbsig  init 0              ; make zero at orch init time

  instr 9
     idur        =    p3
     iamp        =    p4
     iskiptime   =    p5   
     iattack     =    p6
     irelease    =    p7
     ibalance    =    p8   ; panning: 1=left, .5=center, 0=right
     irvbgain    =    p9                  
     kamp        linen      iamp, iattack, idur, irelease  
     asig        soundin   &quot;soundin.aiff&quot;, iskiptime
     arampsig    =         kamp * asig            
                 outs      arampsig * ibalance,  arampsig * (1 - ibalance)
     garvbsig    =         garvbsig + arampsig * irvbgain  
  endin     

  instr 99                 ; global reverb
     irvbtime    =         p4 
     asig        reverb    garvbsig,  irvbtime ; put global signal into reverb
            outs asig, asig 
     garvbsig    =    0              ; then clear it
  endin     </TT>
</PRE>

<P>In the score we turn the global reverb on at time 0 and keep it on until
irvbtime after the last note.</P>

<PRE><TT>; ins     strt dur  rvbtime                  ; toot9.sco
  i99     0    9.85 2.6

; ins strt dur  amp  skip atk  rel  balance(0-1) rvbsend
   i9 0    1    .5   0    .02  .1   1            .2
   i9 2    2    .5   0    .03  .1   0            .3
   i9 3.5  2.25 .5   0    .9   .1   .5           .1
   i9 4.5  2.25 .5   0    1.2  .1   0            .2
   i9 5    2.25 .5   0    .2   .1   1            .3
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="./sound.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./filt.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>