PDA

View Full Version : QT app for Raspberry Pi that can play Midi - tools?



Linwood
6th January 2017, 19:16
I have an application running on the Pi in QT (5.5 because there is a distro for it) that sits on a piano as a music display.

The piano has a player that can be midi controlled.

I'd like to also have midi versions of the displayed sheet music that I could play, controlling in a simple fashion (start, stop, maybe start-at-measure).

I am not trying to do midi input or score editing (a la Musescore), and am not looking to do a general audio player for other formats. I would like to avoid trying to invoke some big, separate multitrack sequencer if I can; I'd prefer a library(s), hopefully with a QT wrapper ready made, but even if not.

Can someone suggest a good path to follow? I have been searching and find some big projects (e.g. QTractor) that I may be able to find pieces from, also I found RtMidi, though it looks like I'd have to read the midi file and provide timing, so I'm not even quite sure what the package is providing versus direct output to the device.

Can anyone suggest a good, clean, midi output (with timing) library for use with QT?

Or is output only so simple I'm better off doing it myself?

Thanks,

Linwood

Added after 1 41 minutes:

Additionally: Found TSE3, which looks old, but it has a distro for the pi, which includes a test program (tse3play) that runs and plays fine with my hardware.

Sadly my development environment (on HyperV, Ubuntu) can't access a USB port, so development is going to be a bit handicapped regardless of what I do (any suggestions on that welcomed).

Anyone ever use TSE3 with QT?

high_flyer
23rd January 2017, 23:40
Can anyone suggest a good, clean, midi output (with timing) library for use with QT?
As far as I can tell this is the actual question you are asking.

The answer is that it has nothing to do with Qt.
What it seems you are looking for is some sort of a backend lib that can do midi output, and if I understand correctly what you want then is to implement a UI using Qt.
You can use any library with Qt - this is why there is a linker.
Once you found your midi lib of choice, you can build a UI with Qt for it.

Linwood
24th January 2017, 14:05
The answer is that it has nothing to do with Qt.
What it seems you are looking for is some sort of a backend lib that can do midi output, and if I understand correctly what you want then is to implement a UI using Qt.
You can use any library with Qt - this is why there is a linker.
Once you found your midi lib of choice, you can build a UI with Qt for it.

Sometimes when we start, it is hard to understand ourselves what questions we really have. I know better now, and you are mostly correct, though I think with a somewhat unfair shading.

My main question is exactly that -- I'm (still) looking for a good midi library, specifically that will allow for import of a midi song, and then provide a mechanism to play it with controls over velocity and tempo, and to locate measures.

TSE3 does that, but is VERY old and has a lot of issues. First, it won't compile from the primary source. The launchpad patches to it for latest distros fix the compilation issues, but the distro version will not link. If you rebuild with their patches, but build it yourself, it does link, and does work mostly. The primary remaining issues are fine control over position, e.g. its scheduler and transport both provide positional status, but buffer way ahead of actual output, meaning you have a tough time telling the user what measure (bar) you are on, and at times hangs for long periods when you are playing at a scaled down tempo (i.e. the api calls hang, the music buffered keeps going).

So yes, I am still looking for such a library. The API in ALSA for example provides sequencing but not midi import. Most examples I've found have their own hard coded in. And a LOT of people hang out here who are multi-media wizards, given the projects done in QT, so I thought they may help.

However, that does not make it a non-QT question anyway. I also had hopes there were such libraries that had QT/C++ wrappers. Consider Poppler (the PDF program I use). It's more attractive than MuPDF (the primary alternative) as it comes packaged with a QT wrapper that makes it very easy to incorporate. So yes, I was hoping someone may know of a midi library that is more friendly toward QT use at the API level.

But thanks for letting me know that linux has a linker. Good, helpful information. :D

high_flyer
25th January 2017, 12:37
But thanks for letting me know that linux has a linker. Good, helpful information.
Well, I am sorry, I didn't mean to be unfair, quite on the contrary, but your post was not clear (to me) and I still gave my best shot to try and understand your question and what you need.


Can anyone suggest a good, clean, midi output (with timing) library for use with QT?
This can easily be so understood that you are not aware of how linkage work and in all fairness, this wouldn't have been the first post - based on your wording it was easy to get to that conclusion, sorry if I missed.
Based on your last post, again - if understand it correctly - by "use with Qt" you mean a lib that it self already uses Qt.

I personally don't know any such libs, but if I will stumble across one I will post.

Good luck!