sertansenturk / tomato

Turkish-Ottoman Makam (M)usic Analysis TOolbox
GNU Affero General Public License v3.0
34 stars 6 forks source link

Make predominantmelody faster #90

Open alastair opened 5 years ago

alastair commented 5 years ago

During our tests, the predominant melody algorithm takes a long time to run - up to 4-5x the length of an audio file. When the files are 30 minutes long this is a huge time to wait. Additionally, with a file of this length the memory usage is 4-5gb which restricts us from being able to run multiple processes on a single computer if we don't have a lot of ram. We should try and optimise this - either by improving the python code, or implementing the algorithm as a native essentia algorithm. We should check if this is something that should be integrated directly into essentia, or if we should compile the algorithm and python bindings in this repository (https://github.com/MTG/essentia-project-template)

sertansenturk commented 5 years ago

Hi Alastair,

I remember checking the time performance of this algorithm a few years ago; the biggest bottleneck was the serialization/deserialization between Python & C++ in the pitch contour computation step. Then, we discussed integrating this as a generic melody contour extraction algorithm in Essentia.

Next, the pitch filter step would be the slowest as it's written in Python. The algorithm exists in Essentia, however the Essentia implementation is not as good as Sercan's Python implementation. I think the best course of action would be to compare the differences, and fix the behaviour in Essentia implementation.

Sorry the above information may not be very informative as I'm writing it in a short duration. Please let me know if you need more info or clarifications...