[linux-audio-user] changing speed without changing pitch

luis jure luisjure at multitel.com.uy
Tue Oct 22 19:04:16 EDT 2002


el Tue, 22 Oct 2002 09:33:48 +1100
Stuart Allie <allies at hydstra.com> escribió:

 
> Can anybody out there tell me what I (or csound :) did wrong?

well, i won't try to tell you what might be wrong with your orchestra, but
if you are interested in time-stretching using csound, try my instrument
below. with it you can do time-stretch and/or pitch transpose
independently.

it uses the newer streaming phase vocoder opcodes by richard dobson (you
need at least csound 4.13 or newer). not only are they easier to use (you
don't need to analyse first), they are also faster (you can easily get
real-time) and, most important, sound much better.

this instrument sounds good to me within reasonable amounts of
time-stretching, of course. should you have questions or problems, don't
hesitate to write.

good luck,

lj

(ps. aren't you interested in joining the csound mailing-list?)

<CsoundSynthesizer>
; ==============================================
<CsInstruments>
; time-stretching instrument
; luis jure 
; 2002

sr	=	44100
kr	=	44100
ksmps	=	1


instr 1	

ifile	=	p8	; sound-file to be processed 
ilen	filelen	ifile	; sound-file duration in seconds

istrch	=	(p4=0 ? p5 : p5/ilen)	; stretching factor 
iread	=	1/istrch
itransp	=	istrch*p6
iloop	=	p7	; play mode (with/without loop)

ifft	=	1024	; fft size
ihop	=	ifft*.25	; hop size
iwinsize	=	ifft*2	; window size
iwintype	=	0	; window type (hamming)
inbins	=	(ifft/2) + 1

asig	diskin	ifile, iread, 0, iloop	; read sound-file
fsrc	pvsanal	asig, ifft, ihop, iwinsize, iwintype	; analyze it 

astrch	pvsadsyn	fsrc, inbins, itransp	; transposed re-synthesis 
kenv	linen	1, .002, p3, .008	; de-click envelope
aout	=	astrch*kenv

	out	aout

endin

</CsInstruments>
; ==============================================
<CsScore>

; p4	p5 interpreter (istrch)
;		0 = compression/expansion ratio
;		1 = total duration of resynthesized signal
; p5	time-stretching factor, interpreted according to p4
; p6	pitch transposition factor
; p7	play mode:
;		0 = without loop
;		1 = with loop
; p8	name of soundfile 

;p1	p2	p3	p4	p5	p6	p7	p8
i1	0	5	0	.7	.9	1	"foo.wav"

e
</CsScore>
</CsoundSynthesizer>



More information about the Linux-audio-user mailing list