| 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 strcmp.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
;modified example from Joachim Heintz |
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
opcode Triad, iii, S ;define UDO |
| 17 |
Sname xin |
| 18 |
iMaj strcmp "maj", Sname |
| 19 |
iMin strcmp "min", Sname |
| 20 |
iPrim = 8.00 ;notes in pitch notattion |
| 21 |
iQuint = 8.05 |
| 22 |
if iMaj == 0 then |
| 23 |
iTer = 8.03 |
| 24 |
elseif iMin == 0 then |
| 25 |
iTer = 8.02 |
| 26 |
endif |
| 27 |
xout iPrim, iTer, iQuint |
| 28 |
endop |
| 29 |
|
| 30 |
instr 1 |
| 31 |
|
| 32 |
Sname strget p4 |
| 33 |
ia, ib, ic Triad Sname ;apply UDO |
| 34 |
print ia, ib, ic |
| 35 |
asig1 pluck 0.7, cpspch(ia), 220, 0, 1 |
| 36 |
asig2 pluck 0.7, cpspch(ib), 220, 0, 1 |
| 37 |
asig3 pluck 0.7, cpspch(ic), 220, 0, 1 |
| 38 |
asig = (asig1+asig2+asig3)*.5 |
| 39 |
outs asig, asig |
| 40 |
|
| 41 |
endin |
| 42 |
</CsInstruments> |
| 43 |
<CsScore> |
| 44 |
i1 0 3 "maj" |
| 45 |
i1 4 3 "min" |
| 46 |
</CsScore> |
| 47 |
</CsoundSynthesizer> |
| 48 |
|