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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out Audio in No messages
-odac
; For Non-realtime ouput leave only the line below:
; -o madsr.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
/* Written by Michael Gogins */
; Initialize the global variables.
sr = 48000
ksmps = 100
nchnls = 2
; Connect up the instruments to create a signal flow graph.
connect "SimpleSine", "leftout", "Reverberator", "leftin"
connect "SimpleSine", "rightout", "Reverberator", "rightin"
connect "Moogy", "leftout", "Reverberator", "leftin"
connect "Moogy", "rightout", "Reverberator", "rightin"
connect "Reverberator", "leftout", "Compressor", "leftin"
connect "Reverberator", "rightout", "Compressor", "rightin"
connect "Compressor", "out", "Soundfile", "in"
; Turn on the "effect" units in the signal flow graph.
alwayson "Reverberator", 0.91, 12000
alwayson "Compressor"
alwayson "Soundfile"
instr SimpleSine
ihz = cpsmidinn(p4)
iamplitude = ampdb(p5)
print ihz, iamplitude
; Use ftgenonce instead of ftgen, ftgentmp, or f statement.
isine ftgenonce 0, 0, 4096, 10, 1
a1 oscili iamplitude, ihz, isine
aenv madsr 0.05, 0.1, 0.5, 0.2
asignal = a1 * aenv
; Stereo audio outlet to be routed in the orchestra header.
outleta "leftout", asignal * 0.25
outleta "rightout", asignal * 0.75
endin
instr Moogy
ihz = cpsmidinn(p4)
iamplitude = ampdb(p5)
; Use ftgenonce instead of ftgen, ftgentmp, or f statement.
isine ftgenonce 0, 0, 4096, 10, 1
asignal vco iamplitude, ihz, 1, 0.5, isine
kfco line 200, p3, 2000
krez init 0.9
asignal moogvcf asignal, kfco, krez, 100000
; Stereo audio outlet to be routed in the orchestra header.
outleta "leftout", asignal * 0.75
outleta "rightout", asignal * 0.25
endin
instr Reverberator
; Stereo input.
aleftin inleta "leftin"
arightin inleta "rightin"
idelay = p4
icutoff = p5
aleftout, arightout reverbsc aleftin, arightin, idelay, icutoff
; Stereo output.
outleta "leftout", aleftout
outleta "rightout", arightout
endin
instr Compressor
; Stereo input.
aleftin inleta "leftin"
arightin inleta "rightin"
kthreshold = 25000
icomp1 = 0.5
icomp2 = 0.763
irtime = 0.1
iftime = 0.1
prints "init Compressor"
asignal[] init 2
aleftout dam aleftin, kthreshold, icomp1, icomp2, irtime, iftime
arightout dam arightin, kthreshold, icomp1, icomp2, irtime, iftime
; Stereo output.
asignal[0] = aleftout
asignal[1] = arightout
outletv "out", asignal
endin
instr Soundfile
; Stereo input.
asignal[] init 2
asignal inletv "in"
out asignal
endin
</CsInstruments>
<CsScore>
; Not necessary to activate "effects" or create f-tables in the score!
; Overlapping notes to create new instances of instruments.
i "SimpleSine" 1 5 60 85
i "SimpleSine" 2 5 64 80
i "Moogy" 3 5 67 75
i "Moogy" 4 5 71 70
e 1
</CsScore>
</CsoundSynthesizer>
<bsbPanel>
<label>Widgets</label>
<objectName/>
<x>100</x>
<y>100</y>
<width>320</width>
<height>240</height>
<visible>true</visible>
<uuid/>
<bgcolor mode="nobackground">
<r>255</r>
<g>255</g>
<b>255</b>
</bgcolor>
</bsbPanel>
<bsbPresets>
</bsbPresets>
|