| 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 opcode_f.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
0dbfs = 1 |
| 14 |
nchnls = 2 |
| 15 |
|
| 16 |
; example by Luis Salgueiro and joachim heintz |
| 17 |
|
| 18 |
opcode Transpose, a, fk ; transpose a monophonic input signal through FFT. |
| 19 |
fsig, kInterval xin |
| 20 |
fScaled pvscale fsig, semitone(kInterval) |
| 21 |
aTransposed pvsynth fScaled |
| 22 |
xout aTransposed |
| 23 |
endop |
| 24 |
|
| 25 |
opcode Stretch,f,ik |
| 26 |
iTab, kSpeed xin |
| 27 |
fStretch pvstanal kSpeed, 1, 1, iTab |
| 28 |
xout fStretch |
| 29 |
endop |
| 30 |
|
| 31 |
giFox ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 |
| 32 |
|
| 33 |
instr 1 |
| 34 |
aSnd diskin2 "fox.wav" |
| 35 |
fSnd pvsanal aSnd, 1024, 256, 1024, 1 |
| 36 |
aTransposed Transpose fSnd, p4 ; p4 = transposition in semitones |
| 37 |
outall aTransposed/2 |
| 38 |
endin |
| 39 |
|
| 40 |
instr 2 |
| 41 |
fStretch Stretch giFox, transeg:k(1,p3,-3,0) |
| 42 |
aStretch pvsynth fStretch |
| 43 |
outall aStretch |
| 44 |
endin |
| 45 |
|
| 46 |
</CsInstruments> |
| 47 |
<CsScore> |
| 48 |
i1 0 3 0 |
| 49 |
i1 . . 7 |
| 50 |
i1 . . 12 |
| 51 |
i2 4 8 |
| 52 |
e |
| 53 |
</CsScore> |
| 54 |
</CsoundSynthesizer> |