| 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 semitone.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 |
instr 1 |
| 17 |
|
| 18 |
iroot = 440 ; root note is A above middle-C (440 Hz) |
| 19 |
ksem lfo 12, .5, 5 ; generate sawtooth, go from 5 octaves higher to root |
| 20 |
ksm = int(ksem) ; produce only whole numbers |
| 21 |
kfactor = semitone(ksm) ; for semitones |
| 22 |
knew = iroot * kfactor |
| 23 |
printk2 knew |
| 24 |
printk2 kfactor |
| 25 |
asig pluck 1, knew, 1000, 0, 1 |
| 26 |
asig dcblock asig ;remove DC |
| 27 |
outs asig, asig |
| 28 |
|
| 29 |
endin |
| 30 |
</CsInstruments> |
| 31 |
<CsScore> |
| 32 |
|
| 33 |
i 1 0 5 |
| 34 |
e |
| 35 |
|
| 36 |
</CsScore> |
| 37 |
</CsoundSynthesizer> |