SF2: bsefextract produces -inf

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SF2: bsefextract produces -inf

Tim Janik-6
Hi Stefan,

with current wip/soundfont, I'm getting -inf on some audio tests.

Here's a test case for -inf results from bsefextract:

  http://testbit.eu/~timj/.tmp/sum-diff-test.wav

(temporary URL, will be removed at some point in the future)

tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum \
  --spectrum --avg-energy

gives:

avg_energy = -inf;


Since 'master' works fine here, I suspect that the SF2 branch change *some*
timing aspects of the engine or engine initialization, which probably affects
the number of zeros initially generated by bsetool render2wav. E.g. fluidsynth
bootup, or the introduction of a master lock which I'm still not quite fond of...

After looking at a couple runs, I can say that the amount of non-zero samples in
the sum-diff-test.wav file varies a *lot* between runs. I've picked an example
from 'make check' for you that has astonishingly *few* samples.


--
Yours sincerely,
Tim Janik

https://testbit.eu/timj/
Free software author.
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SF2: bsefextract produces -inf

Stefan Westerfeld
   Hi!

On Thu, Mar 09, 2017 at 04:01:00PM +0100, Tim Janik wrote:

> with current wip/soundfont, I'm getting -inf on some audio tests.
>
> Here's a test case for -inf results from bsefextract:
>
>   http://testbit.eu/~timj/.tmp/sum-diff-test.wav
>
> (temporary URL, will be removed at some point in the future)
>
> tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum \
>   --spectrum --avg-energy
>
> gives:
>
> avg_energy = -inf;

Not here (with your file):

$ ../tools/bsefextract --cut-zeros --channel 0 --avg-spectrum --spectrum --avg-energy sum-diff-test.wav
# this output was generated by bsefextract 0.10.1~wip from channel 0 in file sum-diff-test.wav
#
# --spectrum: generate 30ms sliced frequency spectrums
spectrum[0,0] = {
};
# --avg-spectrum: average frequency spectrum
avg_spectrum[0] = { };
# --avg-energy: average signal energy in dB
avg_energy = -5.61784072;

Note that it will return -inf if the input sample is completely silent,
basically because average energy is measured in dB, and db(0) -> -inf.

> Since 'master' works fine here, I suspect that the SF2 branch change *some*
> timing aspects of the engine or engine initialization, which probably affects
> the number of zeros initially generated by bsetool render2wav. E.g. fluidsynth
> bootup, or the introduction of a master lock which I'm still not quite fond of...
>
> After looking at a couple runs, I can say that the amount of non-zero samples in
> the sum-diff-test.wav file varies a *lot* between runs. I've picked an example
> from 'make check' for you that has astonishingly *few* samples.

Anyway, if things are as extreme as in your file (18ms data)

$ ../tools/bsefextract --end-time --start-time sum-diff-test.wav --cut-zeros
# this output was generated by bsefextract 0.10.1~wip from channel 0 in file sum-diff-test.wav
#
# --start-time: signal start time in ms (first non-zero sample)
start_time = 0;
# --end-time: signal end time in ms (last non-zero sample)
end_time = 18.6458333;

and 25 seconds total, one could expect that feature tests fail completely.

This may even be related to the fluid warnings, maybe these are blocking due to
fflush(). But thats speculation. In any case I'd recommend finding a strategy
that reliably reduces the number of zeros produced before the actual output to
a minimum.

   Cu... Stefan
--
Stefan Westerfeld, http://space.twc.de/~stefan
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SF2: bsefextract produces -inf

Tim Janik-6
On 09.03.2017 17:33, Stefan Westerfeld wrote:

>    Hi!
>
> On Thu, Mar 09, 2017 at 04:01:00PM +0100, Tim Janik wrote:
>> with current wip/soundfont, I'm getting -inf on some audio tests.
>>
>> Here's a test case for -inf results from bsefextract:
>>
>>   http://testbit.eu/~timj/.tmp/sum-diff-test.wav
>>
>> (temporary URL, will be removed at some point in the future)
>>
>> tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum \
>>   --spectrum --avg-energy
>>
>> gives:
>>
>> avg_energy = -inf;
>
> Not here (with your file):
>
> $ ../tools/bsefextract --cut-zeros --channel 0 --avg-spectrum --spectrum --avg-energy sum-diff-test.wav
> # this output was generated by bsefextract 0.10.1~wip from channel 0 in file sum-diff-test.wav
> #
> # --spectrum: generate 30ms sliced frequency spectrums
> spectrum[0,0] = {
> };
> # --avg-spectrum: average frequency spectrum
> avg_spectrum[0] = { };
> # --avg-energy: average signal energy in dB
> avg_energy = -5.61784072;

Ah, ok, that was the file from a different run then.

Please download again, I've updated the file with one that has just zeros.

> Note that it will return -inf if the input sample is completely silent,
> basically because average energy is measured in dB, and db(0) -> -inf.

Right, but that still leaves this warning unfixed:

../../tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum
--spectrum --avg-energy  > sum-diff-test.tmp
../../tools/bsefcompare ./sum-diff-test.ref sum-diff-test.tmp --threshold 99.99
sum-diff-test.tmp:9: error: unexpected identifier 'inf', expected number (float)

I.e. either you change the output to say something like "0" if there's no
energy,or bsefcompare should be prepared to handle +inf and -inf.

> In any case I'd recommend finding a strategy
> that reliably reduces the number of zeros produced before the actual output to
> a minimum.

Yes, but that's a different topic/bug.

>
>    Cu... Stefan
>

--
Yours sincerely,
Tim Janik

https://testbit.eu/timj/
Free software author.
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Loading...