File: xfade.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 (66 lines) | stat: -rw-r--r-- 3,142 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
<HTML>
<TITLE>CROSSFADE</TITLE>
<CENTER><P><A NAME="Crossfade"></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="./genstut.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./sound.html">Next</A> 
<HR></P></CENTER>

<H2>Toot 7: Crossfade</H2>

<P>Now we will add the ability to do a linear crossfade between any two
of our four basic waveforms. We will employ our delayed vibrato scheme
to regulate the speed of the crossfade. </P>

<PRE><TT>     instr 7                         ; toot7.orc
     ifunc1 = p11                    ; initial waveform
     ifunc2 = p12                    ; crossfade waveform
     ifad1 = p3 - (p13 * p3)         ; calculate initial fade
     ifad2 = p3 - ifad1              ; calculate remaining dur
     irel = .01                      ; set vibrato release
     idel1 = p3 - (p10 * p3)         ; calculate initial delay
     isus   = p3 - (idel1- irel)     ; calculate remaining dur
     iamp = ampdb(p4)
     iscale = iamp * .166                 ; p4=amp
     inote = cpspch(p5)                   ; p5=freq
     k3  linseg    0, idel1, p9, isus, p9, irel, 0    ; p6=attack time
     k2  oscil     k3, p8, 1                     ; p7=release time
     k1  linen     iscale, p6, p3, p7            ; p8=vib rate
     a6  oscil     k1, inote*.998+k2, ifunc2     ; p9=vib depth
     a5  oscil     k1, inote*1.002+k2, ifunc2    ; p10=vib delay (0-1)
     a4  oscil     k1, inote+k2, ifunc2          ; p11=initial wave
     a3  oscil     k1, inote*.997+k2, ifunc1     ; p12=cross wave
     a2  oscil     k1, inote*1.003+k2, ifunc1    ; p13=fade time
     a1  oscil     k1, inote+k2, ifunc1             
     kfade  linseg 1, ifad1, 0, ifad2, 1
     afunc1 = kfade * (a1+a2+a3)
     afunc2 = (1 - kfade) * (a4+a5+a6)
         out  afunc1 + afunc2
  endin
 
   f1 0 2048 10 1                                           ; Sine
   f2 0 2048 10 1 .5 .3 .25 .2 .167 .14 .125 .111           ; Sawtooth
   f3 0 2048 10 1 0  .3  0   .2  0  .14  0   .111           ; Square
   f4 0 2048 10 1 1 1 1 .7 .5 .3 .1                         ; Pulse
;ins  strt  dur  amp   frq    atk rel vibrt vbdpt vibdel startwave  endwave  crosstime
 i7   0     5     96   8.07  .03  .1    5     6   .99    1          2        .1
 i7   6     5     96   8.09  .03  .1    5     6   .99    1          3        .1
 i7  12     8     96   8.07  .03  .1    5     6   .99    1          4        .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="./genstut.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./sound.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>