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.
- Read the compressed MusicXML version of the score; index the note names (no sharps/flats
or rests, etc.) in each measure into a SQLite database along with the measure number.
- Read the MuseScore.com "div" element which has the position coordinates for each measure against the score image; index the page and measure numbers.
- 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:
- 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.
Before I link to the demo, let me say that this is just a demo and I'm not looking to do anything to tick off the MuseScore crew. I probably shouldn't be proxying the score embed, but I needed to for the demo.
What I'd really like to see is something like this in MuseScore.com itself.
And maybe even an API for the embedded score, if there's not already one (I didn't see anything about that). Update: OK, I'm completely blind. Here's the API docs: http://developers.musescore.com/. I'll need to, at some point, work on the backend of this demo so I can automate all processes with the API provided they will grant me an API key.
I should also see what's up with Noteflight these days. They used to have an embed API and may still, but it's also been a while since I've looked at what they're up to.
Anyway, here's the demo link: http://blog.humaneguitarist.org/uploads/musearch/musearch_example.html.
- 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.--------------