swipe icon indicating copy to clipboard operation
swipe copied to clipboard

Wrong values when using from python

Open Laubeee opened this issue 3 years ago • 1 comments

Hi, it seems there are some issues with either your code or how I invoke it.

For a file playing piano notes, then converting them to "midi pitch", I get following results for the first 10 (time in ms, pitch):

[(341, 54), (342, 54), (343, 54), (344, 54), (345, 53), (10988, 35), (10989, 35), (10990, 35), (10991, 35), (10992, 35)]

doing the same in the provided matlab script gives me very different values, specifically, pitch 35 is getting recognized from 3752ms on. (The first five notes in the ground truth file are (again: pitch in ms, midi-pitch): 3680,35 3987,35 4304,36 4604,35 4914,41)

In other words, the matlab script correctly finds the first pitch 80ms after the "true" onset (and most others as well), but your script completely fails to recognize most things.

I made sure the params are the same, i.e. pmin=60, pmax=1200, st=0.3, dt=0.001, mel=False

I noticed it seems to be a 24bit wav file, which some libraries can't read correctly - may that be the issue? Although I must admit that would IMO result in an incorrect detection length in the time dimension, which seems to be correct in your code.

If you are interested in reproducing & debugging, I can provide the testfile privately, just leave me an email addy or sth.

Laubeee avatar Dec 23 '21 16:12 Laubeee

I have no idea what would cause this.

First debugging step would be to try downsampling to 16 bits and see if it goes away?

Other than that though I don't really have time to study this issue myself---I haven't used this software in an age---but I'm happy to review PRs.

On Thu, Dec 23, 2021 at 11:48 AM Silvan Laube @.***> wrote:

Hi, it seems there are some issues with either your code or how I invoke it.

For a file playing piano notes, then converting them to "midi pitch", I get following results for the first 10 (time in ms, pitch):

[(341, 54), (342, 54), (343, 54), (344, 54), (345, 53), (10988, 35), (10989, 35), (10990, 35), (10991, 35), (10992, 35)]

doing the same in the provided matlab script gives me very different values, specifically, pitch 35 is getting recognized from 3752ms on. (The first five notes in the ground truth file are (again: pitch in ms, midi-pitch): 3680,35 3987,35 4304,36 4604,35 4914,41)

In other words, the matlab script correctly finds the first pitch 80ms after the "true" onset (and most others as well), but your script completely fails to recognize most things.

I made sure the params are the same, i.e. pmin=60, pmax=1200, st=0.3, dt=0.001, mel=False

I noticed it seems to be a 24bit-float wav file, which some libraries can't read correctly - may that be the issue? Although I must admit that would IMO result in an incorrect detection length in the time dimension, which seems to be correct in your code.

If you are interested in reproducing & debugging, I can provide the testfile privately, just leave me an email addy or sth.

— Reply to this email directly, view it on GitHub https://github.com/kylebgorman/swipe/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABG4OO33UP467WB73AQN7LUSNHEDANCNFSM5KVEKQBA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

kylebgorman avatar Dec 23 '21 16:12 kylebgorman