| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in |
| 5 |
-odac ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o pvscent.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 |
;; example written by joachim heintz 2009 |
| 17 |
|
| 18 |
giSine ftgen 0, 0, 4096, 10, 1 |
| 19 |
|
| 20 |
instr 1 |
| 21 |
irefrtm = p4; time for generating new values for the spectral centroid |
| 22 |
ifftsize = 1024 |
| 23 |
ioverlap = ifftsize / 4 |
| 24 |
iwinsize = ifftsize |
| 25 |
iwinshape = 1; von-Hann window |
| 26 |
;Sfile = "flute-C-octave0.wav" |
| 27 |
Sfile = "fox.wav" |
| 28 |
ain soundin Sfile |
| 29 |
fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal |
| 30 |
ktrig metro 1 / irefrtm |
| 31 |
if ktrig == 1 then |
| 32 |
kcenter pvscent fftin; spectral center |
| 33 |
endif |
| 34 |
aout oscil .2, kcenter, giSine |
| 35 |
outs aout, aout |
| 36 |
endin |
| 37 |
|
| 38 |
</CsInstruments> |
| 39 |
<CsScore> |
| 40 |
i 1 0 2.757 .3 |
| 41 |
i 1 3 2.757 .05 |
| 42 |
i 1 6 2.757 .005 |
| 43 |
i 1 9 2.757 .001 |
| 44 |
e |
| 45 |
</CsScore> |
| 46 |
</CsoundSynthesizer> |