MuSEarch: searching within embedded MuseScore.com scores [Fri, 26 Dec 2014 20:56:41 +0000]
OK, gonna try and keep this short. I've been obsessing the last few days over the Christmas holiday on this micro-project/demo ... i.e. I been working from morning until midday and taking a shower and brushing my teeth only well, well past the afternoon. Don't judge. I start a new job in January (more later) and, while it will require a good deal of technical know-how, coding won't be part of my job. That's fine, I don't need work to keep me working, so to speak. I thought I'd get back to programming music-related stuff. It's been a while since I checked out MuseScore.com so I did. They now have this nice feature where you can upload a score from MuseScore and then you can read and listen online (with score-following). And you can embed the score into your own pages. Anyway, I wanted to play around with a demo for being able to search the music data and then go to a specific measure - with the measure getting highlighted when selected from the search results. So, here's my demo requirements and what I did for my chosen score, "Lascia ch'io pianga [https://musescore.com/user/202630/scores/191220]" from Handel's Rinaldo. I first heard the piece when I saw Farinelli [http://en.wikipedia.org/wiki/Farinelli_%28film%29] back in the days. Requirements
1. Read the compressed MusicXML version of the score; index the note names (no sharps/flats [DEL: or rests :DEL] , etc.) in each measure into a SQLite database along with the measure number.
2. Read the MuseScore.com "div" element which has the position coordinates for each measure against the score image; index the page and measure numbers.
3. Create an API that takes an ordered series of notes (e.g. "eee") and returns a JSON response with the page and measure numbers as well as all the notes for all measures starting with that series of notes. Example JSON:
4. Embed the score in an HTML page where one can type in a note or a series or notes, click on a result, and be "taken" to that measure.
* It seems to be working OK in my desktop versions of Firefox, Chrome, and Internet Explorer.
* I couldn't get smooth-scrolling in the iframe-embed to work on Chrome, so I dropped it. That issue's out-of-scope for this demo.
* Only Internet Explorer seems to be embedding the audio player but that, too, is not relevant for this demo.
* On my Android, scrolling to the specific measure isn't working, so I need to look into that. But you can resize a desktop browser to the size of a small tablet or so and refresh the page to get an idea of what I want it to look like on mobile.
I'm OK with the demo. I met my main goals. But ultimately, the real issue here is this ... What the hell is a useful search for music notation? I'm not sure learned musicians even need search. Isn't learning a piece and studying the score far more revealing than searching for pitches and potentially durations and intervals, etc.? But tech is tech and research is research, and you know people are going to work on this stuff because it's intriguing at the least.