MythTV/mythtv — pull request #14 by mdda (2011-12-19 00:58:21+00:00)
Title: 88-Key Piano Visualization for MythMusic

I've created a Piano Visualization to mythmusic.

Basically, it's a spectrum analyzer that detects frequencies specifically at the pitches of a piano keyboard, and then displays the notes being pressed on a piano keyboard displayed across the screen.

It makes interesting viewing (particularly for piano music, of course). But it's cool to look at for all styles of music...

One feature, coding-wise, is that an additional private variable had to be added to MainVisual, and two extra virtual functions to VisualBase, so that the Piano visualization can inspect every sample of the audio.

Most visualizations don't inspect every sample of the audio, typically looking at 512 samples every 50ms. Since exact pitch detection (on each of the 88 keys) takes more than 512 samples, we need to collect data over far longer windows (rough calculation : 10 cycles of 440Hz ~=1000 samples at CD rates. Lower notes take correspondingly longer).

The interfaces to all the other visualizations require no changes - no extra work is done unless the plugins specifically use it.

Please let me know if there's anything else you need from me. Licensing (of course) to comply with the rest of MythTV.

And thanks for MythTV generally : I've been a happy user for many years - and am glad that I finally have something interesting to give back.

Martin
:-)