Qt PDF MIDI Player

Everything and anything, but nothing about the LinuxSampler project.
Post Reply
Posts: 2
Joined: Sun Oct 31, 2010 2:55 pm

Qt PDF MIDI Player

Post by MatthiasFauconneau » Sun Oct 31, 2010 3:12 pm

I developed an application to practice piano on my computer.
I'm using Poppler to display the PDF scores and LinuxSampler to playback the corresponding MIDI files.
You can record your mouse cursor while playing the MIDI, this is used to synchronize the score display with MIDI playback.
It can also recognize MIDI input to follow the score as you're playing and scroll automatically.
Recording MIDI input to file and audio output to WAV is also supported.

Everything is integrated so you don't need to install and configure JACK, qJackctl, qSampler nor qTractor.
FreeVerb3 can be installed to add a reverb effect.

Source -> http://gitorious.org/qt-pdfviewer

Posts: 316
Joined: Wed Jan 23, 2008 9:08 pm

Re: Qt PDF MIDI Player

Post by Alex » Sun Dec 12, 2010 8:50 am

Matthias, is there some sort of doc to aid users when installing and using this app?


Posts: 2
Joined: Sun Oct 31, 2010 2:55 pm

Re: Qt PDF MIDI Player

Post by MatthiasFauconneau » Sun Dec 12, 2010 12:19 pm

Hi Alex,

I didn't wrote any documentation because there wasn't much interest. But I guess there will never be interest without docs, so here is a little more info:

I scrapped the mouse recording/following system because it wasn't practical. It was incredibly difficult to follow the sheet music with your mouse in sync with the music.
Instead, the program is now doing note recognition to synchronize with the MIDI.
Since poppler wasn't low-level enough, I implemented a small PDF renderer. so you don't need this dependency anymore.
Note recognition is much nicer to use since it doesn't need a manual preprocessing step and allow the program to highlight the next notes to be played.
On the other hand, It's nearly impossible to implement a generic recognition which works with every available files.
The heuristics I use are compatible with PDF files exported by Sibelius.
So it should work well with my test suite ( http://httyd.sebastianwolff.info/ ) but your mileage may vary for other Sibelius exported files.
I'll gladly accept any patch improving compatibility, so that this application doesn't stay limited to my test suite :)
It should also be possible to make it work with non-Sibelius PDF or in the future even scanned partitions.

Building and Installing:
emerge qt-gui linuxsampler freeverb3
git clone git://gitorious.org/qt-pdfviewer/qt-pdfviewer.git qt-pdfviewer
cd qt-pdfviewer
make install

This will install the binary ( /usr/bin/qt-pdf-midi-player ) and the .desktop file ( /usr/share/applications/qt-pdf-midi-player.desktop )
You can now launch "Qt PDF MIDI Player" from your application menu.

This applications loads soundfonts from /usr/share/sounds/gig/*.gig and /usr/share/sounds/sf2/*.sf2 (cf midi.cpp line 117)
By default, it will try to load maestro_concert_grand_v2.gig (configurable in qt-pdf-midi-player.desktop).
Since it can also work as a simple PDF Viewer, sheet music features are only loaded when a .mid file with the same name as the .pdf is found.
Once you loaded a PDF+MID score, you will be presented with an interface similar to this (assuming you have oxygen icons).


This button enable you to browse your music sheet collection using a standard file selection dialog.
Files with the same base name are assumed to be the same score (inaccurate MIDI representation of a score will prevent synchronization)

If you don't have the Maestro piano (and didn't configure another default instrument in the .desktop), you can select another instrument using Settings (highlighted). It will allow you to choose from any instrument installed in /usr/share/sounds/gig and /usr/share/sounds/sf2.
This dialog is also used to tweak the reverb parameters.

This button play the .mid file using the current instrument. Played notes will be highlighted on the score.
The highlighting may not work at all or desynchronize at some point (because of special notations or recognition failure).

You can record the synthesizer output to a .wav file.
Toggling this button only starts realtime recording, you then need to either toggle the play score button, or actually play on your instrument to record anything.
A new file will be created each time this button is toggled.

This button start/restart the score following algorithm.
When practice mode is enabled, The next expected notes are highlighted.
The trainer is not very strict (allows spurious notes, doesn't enforce legato) to avoid blocking the player.
This also mitigate inaccuracy in notations heuristics (e.g. there is currently no arpeggio detection).
Still, it may help you correct your mistakes since it will only advance when you finally hit the right note.
There is code which can be uncommented to make the algorithm more strict.
The highlighting may not work at all or desynchronize at some point (because of special notations or recognition failure).

You can record ALSA MIDI input to a Standard MIDI File (.mid).
Toggling this button starts realtime recording, you can then play on your instrument to record MIDI events.
A new file will be created each time this button is toggled.
Of course, it is possible to record in score following mode as this will avoid having to stop playing to scroll your page.

Post Reply