| 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 sndwarpst.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; by Menno Knevel 2022 |
| 12 |
|
| 13 |
sr = 44100 |
| 14 |
ksmps = 32 |
| 15 |
nchnls = 2 |
| 16 |
0dbfs = 1 |
| 17 |
|
| 18 |
|
| 19 |
instr 1 |
| 20 |
|
| 21 |
ktimewarp line 0, p3, 1 ;length of stereo file "drumsSlp.wav" |
| 22 |
kresample init 1 ;playback at the normal speed |
| 23 |
ibeg = 0 |
| 24 |
iwsize = 4410 |
| 25 |
irandw = 441 |
| 26 |
ioverlap = p4 |
| 27 |
itimemode = 1 ; Use the ktimewarp parameter as a "time" pointer |
| 28 |
prints "\nnumber of overlaps = %d\n\n", p4 |
| 29 |
|
| 30 |
aL, aR sndwarpst .35, ktimewarp, kresample, 1, ibeg, iwsize, irandw, ioverlap, 2, itimemode |
| 31 |
aL dcblock aL ;get rid of DC offsets for left channel & |
| 32 |
aR dcblock aR ;right channel |
| 33 |
outs aL, aR |
| 34 |
|
| 35 |
endin |
| 36 |
</CsInstruments> |
| 37 |
<CsScore> |
| 38 |
f 1 0 0 1 "drumsSlp.wav" 0 0 0 |
| 39 |
f 2 0 16384 9 0.5 1 0 ;half of a sine wave |
| 40 |
|
| 41 |
i 1 0 7 2 ;different overlaps |
| 42 |
i 1 + 7 5 |
| 43 |
i 1 + 7 15 |
| 44 |
e |
| 45 |
</CsScore> |
| 46 |
</CsoundSynthesizer> |