| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac -F pgmassign_advanced.mid ;;;realtime audio out with midifile in |
| 5 |
;-iadc ;;;uncomment -iadc if real audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o pgmassign_advanced.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 |
|
| 16 |
massign 1, 1 ; channels 1 to 4 use instr 1 by default |
| 17 |
massign 2, 1 |
| 18 |
massign 3, 1 |
| 19 |
massign 4, 1 |
| 20 |
|
| 21 |
; pgmassign_advanced.mid can be found in /manual/examples |
| 22 |
; pgmassign.mid has 4 notes with these parameters: |
| 23 |
; |
| 24 |
; Start time Channel Program |
| 25 |
; |
| 26 |
; note 1 0.5 1 10 |
| 27 |
; note 2 1.5 2 11 |
| 28 |
; note 3 2.5 3 12 |
| 29 |
; note 4 3.5 4 13 |
| 30 |
|
| 31 |
pgmassign 0, 0 ; disable program changes |
| 32 |
pgmassign 11, 3 ; program 11 uses instr 3 |
| 33 |
pgmassign 12, 2 ; program 12 uses instr 2 |
| 34 |
|
| 35 |
; waveforms for instruments |
| 36 |
itmp ftgen 1, 0, 1024, 10, 1 |
| 37 |
itmp ftgen 2, 0, 1024, 10, 1, 0.5, 0.3333, 0.25, 0.2, 0.1667, 0.1429, 0.125 |
| 38 |
itmp ftgen 3, 0, 1024, 10, 1, 0, 0.3333, 0, 0.2, 0, 0.1429, 0, 0.10101 |
| 39 |
|
| 40 |
instr 1 /* sine */ |
| 41 |
|
| 42 |
kcps cpsmidib 2 ; note frequency |
| 43 |
asnd oscili .6, kcps, 1 |
| 44 |
outs asnd, asnd |
| 45 |
|
| 46 |
endin |
| 47 |
|
| 48 |
instr 2 /* band-limited sawtooth */ |
| 49 |
|
| 50 |
kcps cpsmidib 2 ; note frequency |
| 51 |
asnd oscili .6, kcps, 2 |
| 52 |
outs asnd, asnd |
| 53 |
|
| 54 |
endin |
| 55 |
|
| 56 |
instr 3 /* band-limited square */ |
| 57 |
|
| 58 |
kcps cpsmidib 2 ; note frequency |
| 59 |
asnd oscili .6, kcps, 3 |
| 60 |
outs asnd, asnd |
| 61 |
|
| 62 |
endin |
| 63 |
|
| 64 |
|
| 65 |
</CsInstruments> |
| 66 |
<CsScore> |
| 67 |
|
| 68 |
t 0 120 |
| 69 |
f 0 8.5 2 -2 0 |
| 70 |
e |
| 71 |
|
| 72 |
|
| 73 |
</CsScore> |
| 74 |
</CsoundSynthesizer> |