3
3
; Select audio/midi flags here according to platform
4
; Audio out Audio in No messages
5
-odac -iadc -d ;;;RT audio I/O
5
;-iadc ;;;uncomment -iadc if RT audio input is needed too
6
6
; For Non-realtime ouput leave only the line below:
7
7
; -o adsr.wav -W ;;; for file output any platform
11
; Initialize the global variables.
17
; Instrument #1 - a simple instrument.
21
; Get the frequency from the fourth p-field.
28
; Instrument #2 - instrument with an ADSR envelope.
35
; Create an amplitude envelope.
36
kenv adsr iatt, idec, islev, irel
39
; Get the frequency from the fourth p-field.
23
kenv adsr iatt, idec, islev, irel
24
kcps = cpspch(p4) ;frequency
26
asig vco2 kenv * 0.8, kcps
50
; Table #1, a sine wave.
53
; Set the tempo to 120 beats per minute.
56
; Play a melody with Instrument #1.
57
; p4 = frequency in pitch-class notation.
73
; Repeat the melody with Instrument #2.
74
; p4 = frequency in pitch-class notation.
34
i 1 0 1 7.00 .0001 1 .01 .001 ; short attack
35
i 1 2 1 7.02 1 .5 .01 .001 ; long attack
36
i 1 4 2 6.09 .0001 1 .1 .7 ; long release
93
41
</CsoundSynthesizer>