You are here

QTractor (or other?) as starting point for small midi-play application

I hope this is considered at least someone on topic, and apologies if it is deemed inappropriate. I have a question about how QTractor was done in general and hope also for advice how to do something similar (and whether QTractor may be a good starting point).

I found QTractor as part of working on a QT project to which I wanted to add limited midi support. The project is a Raspberry Pi based music display for piano performance, but as part of that I wanted the ability to OMR some music to Midi, so that someone learning a piece could hear the (albeit somewhat mechanical) timing as-written. And they could slow down the time scale dramatically to hear/watch it played (the piano is a Pianodisc driven one).

The Pi is a low powered device (even though i am using a 3B). It will (almost) run QTractor, but there's far more overhead there than needed, plus I want to control it from a simple interface, and not have a general purpose sequencer.

However, it is one of the more recent projects using QT and also using Midi, so I hoped to learn from it, and have a somewhat philosophical set of questions I am hoping the authors or users can help with.

To provide minimal midi output (no plans for input) to a midi device (i.e. piano), can anyone advise the best approach in terms of existing library support. In a brief look it appears QTractor does its own midi import and most processing, and then feeds ALSA (JACK, etc.). Would you suggest (and I assume since open source it is appropriate?) to try to lift those portions (only)? I really do not want to reinvent the wheel on midi file import/syntax/etc.

I started doing this with a library called TSE3, which is a long ago, apparently abandoned project. I grabbed it because it is actually in the Pi/Ubuntu distro (though I later found out that version does not work properly with QT and had to rebuild). It is working, sort of, but has a number of issues (some of which are more documentation than coding as I have dug in, but notably when I change its time scale I think it just has some broken parts, especially in its transport/scheduler portion).

If anyone has insight into current and available development libraries, I would sure appreciate a pointer as to good places to start if I want to discard TSE3 and use something else. Take a current project (like QTractor) and lift their midi import and related? Or are their better choices for libraries? Or have I misread the source of QTractor, and indeed it is using such a library (other than ALSA, which as best I can tell does not provide for midi file import).

Fundamentally I want to be able to import a midi file, and play it to a (real) midi output device, with an API (not GUI) for control, especially control over tempo (preferably to scale generally not interact at each tempo change) and velocity (again, scale preferably) and start/stop at measure. Oh, and for that measure calculations from time signature and midi data so I can "start at bar 15" type commands.

If I started with QTractor and started removing all the extraneous pieces, is that a good approach (and consistent with the spirit in which you offer it?)?

Or are there better, ready-made libraries?

Thanks in advance for any insights.

Linwood

Forums: 
rncbc's picture

tough question and maybe TL;DR

well, assuming qtractor is overwhelming or overkill to your purposes, i'd suggest from the top my head to look into aplaymidi which comes standard packaged under alsa-utils...

maybe that's the best, no-nonsense-dependency, lean-and-mean, starting point you may find around, i believe :)

hth.
cheers

Add new comment