| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac -M0 ;;;realtime audio out and midi input |
| 5 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o gen51.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
;example by Iain McCurdy |
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
giEqTmp12 ftgen 1,0,128,-51,12,2,cpsoct(8),60,1,2^(1/12),2^(2/12),2^(3/12),2^(4/12),2^(5/12),2^(6/12),2^(7/12),2^(8/12),2^(9/12),2^(10/12),2^(11/12),2^(12/12) |
| 17 |
giEqTmp10 ftgen 2,0,128,-51,10,2,cpsoct(8),60,1,2^(1/10),2^(2/10),2^(3/10),2^(4/10),2^(5/10),2^(6/10),2^(7/10),2^(8/10),2^(9/10),2^(10/10) |
| 18 |
giEqTmp24 ftgen 3,0,128,-51,24,2,cpsoct(8),60,1,2^(1/24),2^(2/24),2^(3/24),2^(4/24),2^(5/24),2^(6/24),2^(7/24),2^(8/24),2^(9/24),2^(10/24),2^(11/24), \ 2^(12/24),2^(13/24),2^(14/24),2^(15/24),2^(16/24),2^(17/24),2^(18/24),2^(19/24),2^(20/24),2^(21/24),2^(22/24),2^(23/24),2^(24/24) |
| 19 |
|
| 20 |
instr 1 ;midi input instrument |
| 21 |
/*USE PITCH BEND TO MODULATE NOTE NUMBER UP OR DOWN ONE STEP - ACTUAL INTERVAL IT WILL MODULATE BY WILL BE DEPENDENT UPON THE GEN51 SCALE USED*/ |
| 22 |
;kbend pchbend 0,2 |
| 23 |
|
| 24 |
/*ALTERNATIVELY IF USING VIRTUAL MIDI DEVICE OR A KEYBOARD WITH NO PITCH BEND WHEEL, USE CONTROLLERS 1 AND 2 TO MODULATE PITCH UP OR DOWN 1 STEP*/ |
| 25 |
kup ctrl7 1, 1, 0, 1 |
| 26 |
kdown ctrl7 1, 2, 0, -1 |
| 27 |
kbend = kup+kdown |
| 28 |
|
| 29 |
inum notnum |
| 30 |
kcps tablei inum+kbend, giEqTmp24 ;read cps values from GEN51, scale table using a combination of note played and pitch bend/controllers 1 and 2 |
| 31 |
a1 vco2 0.2, kcps, 4, 0.5 |
| 32 |
outs a1, a1 |
| 33 |
endin |
| 34 |
|
| 35 |
instr 2 ;score input instrument |
| 36 |
|
| 37 |
knum line p4, p3, p5 ;gliss using a straight line bewteen p4 and p5 for the entire note duration |
| 38 |
kcps tablei knum, giEqTmp24 ;read cps values from GEN51 scale table |
| 39 |
a1 vco2 0.2, kcps, 4, 0.5 |
| 40 |
outs a1, a1 |
| 41 |
endin |
| 42 |
|
| 43 |
</CsInstruments> |
| 44 |
<CsScore> |
| 45 |
f 0 3600 |
| 46 |
|
| 47 |
;instr 2. Score input. Gliss from step number p4 to step number p5 |
| 48 |
;p4 - starting note number |
| 49 |
;p5 - ending note number |
| 50 |
i 2 0 2 60 61 |
| 51 |
i 2 + 2 70 58 |
| 52 |
i 2 + 2 66 66.5 |
| 53 |
i 2 + 2 71.25 71 |
| 54 |
e |
| 55 |
</CsScore> |
| 56 |
</CsoundSynthesizer> |
| 57 |
|