Csound Csound-dev Csound-tekno Search About

[Csnd] mincer question.

Date2012-03-17 16:06
FromRoger Kelly
Subject[Csnd] mincer question.
I am using the example from the manual below.   My questions are about the FFT size, and idecim.  I would have thought that a larger FFT size would only affect sound quality and resolution of the original sample, as well as decimation size, but it seems to have other audio effects.

I am looking for advice for what would be an ideal setting with FFT and decimation for best quality that is simply doing time shifting independent of frequency.

<CsoundSynthesizer>

<CsOptions>

; Select audio/midi flags here according to platform

-odac ;;;realtime audio out

;-iadc ;;;uncomment -iadc if realtime audio input is needed too

; For Non-realtime ouput leave only the line below:

; -o mincer.wav -W ;;; for file output any platform

</CsOptions>

<CsInstruments>


sr = 48000

ksmps = 32

nchnls = 2

0dbfs = 1


instr 1


idur = p3

ilock = 1

ipitch = 1

itimescale = 1

iamp = 0.8


atime line 0,idur,idur*itimescale

asigl, asigr mincer atime, iamp, ipitch, 1, ilock,2048,6

outs asigl, asigr


endin

</CsInstruments>

<CsScore>

f 1 0 0 1 "D:/proj/soundgen/sounds/samples/drums/lime120.wav" 0 0 0



i 1 0 7 1 ;locked


e


</CsScore>

</CsoundSynthesizer>


Date2012-03-17 17:03
FromJustin Smith
SubjectRe: [Csnd] mincer question.

There is an unavoidable tradeoff between timing and frequency information. With more overlaps / larger FFT size, you preserve more frequency information and lose more timing information when time stretching (frequencies preserved, time smearing), with a smaller FFT size / fewer overlaps you preserve more timing and dynamics, and lose more frequency information when time stretching (dynamics and timing preserved, frequency breebles). This isn't just a limitation of FFT, it is a byproduct of the fact that frequency is the derivitive of amplitude over time, so any time stretching algorithm must deal with this dilemma.

There is no universal best setting, otherwise it wouldn't need to be a setting. It depends on whether you can tolerate losing dynamics or losing frequencies, which is entirely dependent on your own compositional goals. It may even turn out that a composite approach is best, with amplitude envelopes over multiple instances, using crossfades to improve timing accuracy in one moment, frequency accuracy in another.

Also time shifting is a delay, you mean time stretching.

----- Original message -----
> I am using the example from the manual below.    My questions are about
> the FFT size, and idecim.  I would have thought that a larger FFT size
> would only affect sound quality and resolution of the original sample,
> as well as decimation size, but it seems to have other audio effects.
>
> I am looking for advice for what would be an ideal setting with FFT and
> decimation for best quality that is simply doing time shifting
> independent of frequency.
>
> <CsoundSynthesizer>
>
> <CsOptions>
>
> ; Select audio/midi flags here according to platform
>
> -odac ;;;realtime audio out
>
> ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
>
> ; For Non-realtime ouput leave only the line below:
>
> ; -o mincer.wav -W ;;; for file output any platform
>
> </CsOptions>
>
> <CsInstruments>
>
>
> sr = 48000
>
> ksmps = 32
>
> nchnls = 2
>
> 0dbfs = 1
>
>
> instr 1
>
>
> idur = p3
>
> ilock = 1
>
> ipitch = 1
>
> itimescale = 1
>
> iamp = 0.8
>
>
> atime line 0,idur,idur*itimescale
>
> asigl, asigr mincer atime, iamp, ipitch, 1, ilock,2048,6
>
> outs asigl, asigr
>
>
> endin
>
> </CsInstruments>
>
> <CsScore>
>
> f 1 0 0 1 "D:/proj/soundgen/sounds/samples/drums/lime120.wav" 0 0 0
>
>
>
> i 1 0 7 1 ;locked
>
>
> e
>
>
> </CsScore>
>
> </CsoundSynthesizer>
>
> Send bugs reports to the Sourceforge bug tracker
>                        https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>