Debian Codegraph @

examples/lorismorph.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o lorismorph.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15 ; clarinet.sdif and meow.sdif can be found in /manual/examples
16
17 ; Morph the partials in meow.sdif into the partials in clarinet.sdif over the duration of
18 ; the sustained portion of the two tones (from .2 to 2.0 seconds in the meow, and from
19 ; .5 to 2.1 seconds in the clarinet). The onset and decay portions in the morphed sound are
20 ; specified by parameters p4 and p5, respectively. The morphing time is the time between the
21 ; onset and the decay. The meow partials are shfited in pitch to match the pitch of the clarinet
22 ; tone (D above middle C).
23
24 instr 1
25
26 ionset = p4
27 idecay = p5
28 itmorph = p3 - (ionset + idecay)
29 ipshift = cpspch(8.02)/cpspch(8.08)
30
31 ktme linseg 0, ionset, .2, itmorph, 2.0, idecay, 2.1 ; meow time function, morph from .2 to 2.0 seconds
32 ktcl linseg 0, ionset, .5, itmorph, 2.1, idecay, 2.3 ; clarinet time function, morph from .5 to 2.1 seconds
33 kmurph linseg 0, ionset, 0, itmorph, 1, idecay, 1
34 lorisread ktme, "meow.sdif", 1, ipshift, 2, 1, .001
35 lorisread ktcl, "clarinet.sdif", 2, 1, 1, 1, .001
36 lorismorph 1, 2, 3, kmurph, kmurph, kmurph
37 asig lorisplay 3, 1, 1, 1
38 outs asig, asig
39 endin
40
41 ; Morph the partials in clarinet.sdif into the partials in meow.sdif. The start and end times
42 ; for the morph are specified by parameters p4 and p5, respectively. The morph occurs over the
43 ; second of four pitches in each of the sounds, from .75 to 1.2 seconds in the flutter-tongued
44 ; clarinet tone, and from 1.7 to 2.2 seconds in the cat's meow. Different morphing functions are
45 ; used for the frequency and amplitude envelopes, so that the partial amplitudes make a faster
46 ; transition from clarinet to cat than the frequencies. (The bandwidth envelopes use the same
47 ; morphing function as the amplitudes.)
48
49 instr 2
50
51 ionset = p4
52 imorph = p5 - p4
53 irelease = p3 - p5
54
55 ktclar linseg 0, ionset, .75, imorph, 1.2, irelease, 2.4
56 ktmeow linseg 0, ionset, 1.7, imorph, 2.2, irelease, 3.4
57
58 kmfreq linseg 0, ionset, 0, .75*imorph, .25, .25*imorph, 1, irelease, 1
59 kmamp linseg 0, ionset, 0, .75*imorph, .9, .25*imorph, 1, irelease, 1
60
61 lorisread ktclar, "clarinet.sdif", 1, 1, 1, 1, .001
62 lorisread ktmeow, "meow.sdif", 2, 1, 1, 1, .001
63 lorismorph 1, 2, 3, kmfreq, kmamp, kmamp
64 asig lorisplay 3, 1, 1, 1
65 outs asig, asig
66 endin
67
68 </CsInstruments>
69 <CsScore>
70 ; strt dur onset decay
71 i 1 0 3 .25 .15
72 i 1 + 1 .10 .10
73 i 1 + 6 1. 1.
74
75 ; strt dur morph_start morph_end
76 i 2 9 4 .75 2.75
77
78 e
79 </CsScore>
80 </CsoundSynthesizer>