Am Tue, 14 Jul 2009 12:15:43 -0500 (CDT)
schrieb "Gabriel M. Beddingfield" <[email protected]>:

> On Tue, 14 Jul 2009, [email protected] wrote:
> 
> > so you can only restore your songs if you resample your samples you use 
> > with sox. than i think you get a normal result.
> 
> I think the OP is looking for an upgrade path... and we might be able to 
> provide one:
> 
> When opening a file:
> 
>    if... it was saved in a version before 0.9.4
>    and... pitch factor is set to a non-zero value
>    and... the AudioDriver sample rate is different from
>           the sample rate of the WAV/FLAC file
>    then:
>       fCorrection = 12.0 * log(fileRate / driverRate) / log(2.0)
>       fPitch -= fCorrection
> 
> In the case of the OP:
> 
>      fPitch = 1.20
>      fCorrection = 12.0 * log(48000.0 / 44100.0) / log(2.0)
>                  = 1.47
>      fPitch = fPitch - fCorrection = 1.20 - 1.47
>             = -0.27
> 
> This correction is not far from what the OP said the correction should be 
> (0.12).  Also, it's just a guess... but I'll bet that he originally set 
> the pitch to 1.2 to compensate for the sample rate mismatch (whether he 
> knew it or not).
> 
> -gabriel
you mean an correction, if song older 0.9.4 && sample-samplerate != 
audio-output-samplerate,
in realtime into sampler. imo that's not the best way. it's better to do that 
if the sample will load into memory.
so we don't lost rt time. its nearly the same effect. but without expanding the 
resample function.

the second thing i notice is, if i play with the pitch values using a sine wav, 
that the resample fuction produce distortion if the sample is longer. the 
distortion grows as longer the samle will play.
my example samples are 4 secons long. this is long enough to produce horrible 
distortion.

an other problem:
imo we have a problem with linear interpolation for more than one audio buffer. 
if the next buffer will computed maybe we get no interpolation between the last 
and the current computed buffer.
i export the pitched sine into a wav file of pitched in hydrogen :_/. i found 
all buffersize lenght an xy mismatch. see my snapshots.

the later error will display the mispatch if the sample plays nearly 4 seconds.
the early error png schows the error after ~ one second.

 
 

<<attachment: early-error.png>>

<<attachment: later-error.png>>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to