basic-pitch icon indicating copy to clipboard operation
basic-pitch copied to clipboard

Using basic-pitch in an iOS application

Open adamjuls opened this issue 2 years ago • 3 comments

Hi,

I would like to use basic-pitch in an iOS mobile application. It seems that it is possible to convert the model into a tflite. format, but I am stuck trying to change the output into MIDI notes. Can someone help me with suggesting Pretty MIDI alternatives that work well with the basic pitch model for Swift?

adamjuls avatar Feb 22 '23 02:02 adamjuls

It shouldn't be too hard to port the Python code that converts the model outputs to notes (https://github.com/spotify/basic-pitch/blob/ad9ab8a65d18a1cb06dee25f45855acc4598a10a/basic_pitch/note_creation.py#L46) to Swift, you could even try using a numpy-like library like https://github.com/jjjkkkjjj/Matft.

I did the same thing in C++ using the xtensor library and using onnxruntime for model inference, works great.

martingasser avatar Feb 24 '23 13:02 martingasser

Thank you for answering my question @martingasser . By any chance is your C++ implementation open source?

adamjuls avatar Feb 24 '23 17:02 adamjuls

@adamjuls did you end up making this work?

e7mac avatar Jan 24 '24 19:01 e7mac