| 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 gen09.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 |
gi1 ftgen 1,0,2^10,9, 1,3,0, 3,1,0, 9,0.333,180 ;an approximation of a square wave |
| 17 |
gi2 ftgen 2,0,2^10,9, 1,3,180, 3,1,0, 9,0.333,0 ;same values as gi1, except some phase values |
| 18 |
gi3 ftgen 3,0,2^10,9, 1, .4, 0, 2.2, .5, 0, 3.8, 1, 0 ;inharmonic, but does not sound well --> wave does not end at same point as where it begins --> artefacts |
| 19 |
gi4 ftgen 4,0,2^10,9, 10, .4, 0, 22, .5, 0, 38, 1, 0 ;the same proportions, but value of partial number is multiplied 10 times -->the sound is much clearer, |
| 20 |
;because the sudden "jump" like the one in gi3 will pop up only once in 10 repetitions |
| 21 |
|
| 22 |
instr 1 |
| 23 |
|
| 24 |
kamp = .6 |
| 25 |
kcps = 220 |
| 26 |
ifn = p4 |
| 27 |
|
| 28 |
asig poscil kamp, kcps*p5, ifn |
| 29 |
outs asig,asig |
| 30 |
|
| 31 |
endin |
| 32 |
</CsInstruments> |
| 33 |
<CsScore> |
| 34 |
|
| 35 |
i 1 0 2 1 1 ;subtle difference between table 1 and 2 |
| 36 |
i 1 3 2 2 1 |
| 37 |
i 1 7 2 3 1 ;big difference between table 3 and 4 |
| 38 |
i 1 10 2 4 .1 ;p5 has to compensate for the 10 repetitions of gi4 as opposed to gi3 to get the same pitch |
| 39 |
|
| 40 |
e |
| 41 |
</CsScore> |
| 42 |
</CsoundSynthesizer> |
| 43 |
|