+ Reply to Thread
Results 1 to 4 of 4

Thread: QT app for Raspberry Pi that can play Midi - tools?

  1. #1
    Join Date
    Nov 2016
    Location
    Florida, US
    Posts
    25
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QT app for Raspberry Pi that can play Midi - tools?

    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?
    Last edited by Linwood; 6th January 2017 at 19:16.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,403
    Thanks
    21
    Thanked 384 Times in 378 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT app for Raspberry Pi that can play Midi - tools?

    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.
    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
    Watch these videos, and read his books they are must if you want to write clean code:
    https://sites.google.com/site/unclebobconsultingllc/

    Recommended off-line reading Qt:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  3. #3
    Join Date
    Nov 2016
    Location
    Florida, US
    Posts
    25
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QT app for Raspberry Pi that can play Midi - tools?

    Quote Originally Posted by high_flyer View Post
    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,403
    Thanks
    21
    Thanked 384 Times in 378 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT app for Raspberry Pi that can play Midi - tools?

    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!
    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
    Watch these videos, and read his books they are must if you want to write clean code:
    https://sites.google.com/site/unclebobconsultingllc/

    Recommended off-line reading Qt:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

+ Reply to Thread

Similar Threads

  1. QDrag but on Raspberry Pi?
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 3rd April 2016, 17:28
  2. Compiling qt 5.4 for raspberry
    By dram in forum Newbie
    Replies: 5
    Last Post: 15th February 2015, 23:21
  3. midi child does not close when I call close()
    By qlands in forum Qt Programming
    Replies: 7
    Last Post: 29th July 2011, 22:25
  4. [Tab play list]Load play lists on start
    By petrusPL in forum Qt Programming
    Replies: 0
    Last Post: 18th March 2011, 18:12
  5. Midi editing widget
    By dentist in forum Newbie
    Replies: 1
    Last Post: 24th March 2010, 23:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts