diff options
Diffstat (limited to 'examples/sndwarp.csd')
-rw-r--r-- | examples/sndwarp.csd | 63 |
1 files changed, 20 insertions, 43 deletions
diff --git a/examples/sndwarp.csd b/examples/sndwarp.csd index 018f2ee..b783807 100644 --- a/examples/sndwarp.csd +++ b/examples/sndwarp.csd @@ -1,64 +1,41 @@ <CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform -; Audio out Audio in No messages --odac -iadc -d ;;;RT audio I/O +-odac ;;;realtime audio out +;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o sndwarp.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> -; Initialize the global variables. -sr = 44100 -kr = 4410 -ksmps = 10 -nchnls = 1 +sr = 44100 +ksmps = 32 +0dbfs = 1 +nchnls = 2 -; Instrument #1 - play an audio file. instr 1 - ; Use the audio file defined in Table #1. - a1 loscil 30000, 1, 1, 1 - out a1 -endin +ktimewarp line 0, p3, 2.7 ;length of "fox.wav" +kresample init 1 ;do not change pitch +ibeg = 0 ;start at beginning +iwsize = 4410 ;window size in samples with +irandw = 882 ;bandwidth of a random number generator +itimemode = 1 ;ktimewarp is "time" pointer +ioverlap = p4 -; Instrument #2 - time-stretch an audio file. -instr 2 - kamp init 6500 - ; Start at 1 second and end at 3.5 seconds. - ktimewarp line 1, p3, 3.5 - ; Playback at the normal speed. - kresample init 1 - ; Use the audio file defined in Table #1. - ifn1 = 1 - ibeg = 0 - iwsize = 4410 - irandw = 882 - ioverlap = 15 - ; Use Table #2 for the windowing function. - ifn2 = 2 - ; Use the ktimewarp parameter as a "time" pointer. - itimemode = 1 +asig sndwarp .5, ktimewarp, kresample, 1, ibeg, iwsize, irandw, ioverlap, 2, itimemode + outs asig, asig - a1 sndwarp kamp, ktimewarp, kresample, ifn1, ibeg, iwsize, irandw, ioverlap, ifn2, itimemode - out a1 endin - - </CsInstruments> <CsScore> +f 1 0 131072 1 "fox.wav" 0 0 0 ; audio file +f 2 0 1024 9 0.5 1 0 ; half of a sine wave -; Table #1: an audio file. -f 1 0 262144 1 "mary.wav" 0 0 0 -; Table #2: half of a sine wave. -f 2 0 16384 9 0.5 1 0 - -; Play Instrument #1 for 3.5 seconds. -i 1 0 3.5 -; Play Instrument #2 for 7 seconds (time-stretched). -i 2 3.5 10.5 +i 1 0 7 2 ;different overlaps +i 1 + 7 5 +i 1 + 7 15 e - </CsScore> </CsoundSynthesizer> |