tuwien-musicir / rp_extract

Rhythm Pattern music feature extractor by IFS @ TU-Vienna
GNU General Public License v3.0
110 stars 27 forks source link

Fixed float error which causes rp-extract to crash on some inputs #21

Closed ScJa closed 7 years ago

ScJa commented 7 years ago

Worked with librosa and some .au files in the course advanced information retrieval.

When running rp_extract() it crashed on one input, because the n_frames value was "511.0" which results in a crash in the loop below (line 202, TypeError).

audiofeature commented 7 years ago

Hi, thanks.

Normally, the value should be an int anyway, if the fft_window_size and the hop_size (i.e. fft_overlap) are chosen properly.

A value of 511 for n_frames should also not result in a crash. I can merge this pull request, but still curious how it is possible.

Can you provide the audio file in question, or at least post the number of samples it has and/or the output of line if verbose: print "Analyzing", n_segments, "segments"

?

ScJa commented 7 years ago

Hi Thomas,

I looked into the issue again and realized that we were using an almost identical, but not quite the same, rp_extract.py for the AIR course.

It has been adjusted to work for python 3. After I have tested the extraction with the current version of this repo in python 2, no error occured. (The n_frames value was 511.0 in python3 and 511 in python2)

So, as far as I know, there was no bug in the code in the repo. The error happened when the course team ported it to python 3. However the pull request doesn't break anything either.

Sorry for the trouble, Jakob

audiofeature commented 7 years ago

Hi,

Do you know who ported it to Python 3 and where this version is available?

Also, can you let us know where is the problem in the subsequent code for n_frames being a float not an int?

best Thomas

Am 26.05.2017 um 00:03 schrieb Schneider Jakob notifications@github.com:

Hi Thomas,

I looked into the issue again and realized that we were using an almost identical, but not quite the same, rp_extract.py for the AIR course.

It has been adjusted to work for python 3. After I have tested the extraction with the current version of this repo in python 2, no error occured. (The n_frames value was 511.0 in python3 and 511 in python2)

So, as far as I know, there was no bug in the code in the repo. The error happened when the course team ported it to python 3. However the pull request doesn't break anything either.

Sorry for the trouble, Jakob

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/tuwien-musicir/rp_extract/pull/21#issuecomment-304137066, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHE6dybiBC4r4b061KBV8rWdX-d7nY6ks5r9frBgaJpZM4NmhUF.

-- Thomas Lidy Vienna University of Technology Institute of Software Technology and Interactive Systems Favoritenstraße 9-11/188 A-1040 Vienna, Austria

http://www.ifs.tuwien.ac.at/~lidy

ScJa commented 7 years ago

Hi,

I'm not sure who exactly worked on it, but Alexander Schindler is in the course team, so he should know.

I haven't debugged the file to find the origin, but I've attached it if you want to take a look at it. rp_extract.py.zip