Music score display - is this possible?
#1
Hi All,

I know some people are working on a script for guitar tabs, but for classical music I've been thinking how to call up the score while the music is playing, Not knowing anything at the moment about python or scripting in general before I embark on an Everest scale learning curve could I ask if you think the following is even possible and also whether it's legal/responsible to do so (I don't want to inadvertently collapse a website).

- A group of talented people wrote the brilliant Lyrics script that basically accesses the tag of the playing file and uses that info to search for lyrics on various sites.
- The website http://imslp.org/wiki/Main_Page hosts a load of music scores. So for example searching for Beethoven's 'Fur Elise' takes you first to a google search result page and then to a list of scores in their database. Selecting one gives an image like this:

Image

- Would it be possible to use the lyric script as a basis to edit to call up and display such an image with either scroll or page down buttons?
- I only want to embed such a script in an onscreen display like I've done with the lyrics script as below. There's no need for checking embedded items, saving the file or anything like that. It also (at the moment) would only be one site unlike the Lyric script which searches loads.

Image

So what I was envisaging for classical music was like this:

Image

I've a feeling I'm being way too ambitious but really not sure how difficult it is to adapt existing scripts or access websites like IMSLP.
Thanks
Reply
#2
The lyrics plugins are probably way more complicated than you need for this. The hard part for you is going to be displaying the right part of the image at the right time. Once you've got that figured out, you just wait for Xbmc to start playing music, grab the title and look it up, create a window object and stick the image to it
Reply
#3
Thanks for the advice. I think you're right from what little I've learned about it thus far.

I've hit a snag, which I'm hoping someone can help me with. I've managed to access the site and capture the id of the image I want to call. I created a class called Score, successfully searched the website to get the image id (saved in variable "id") and I think scraped the image to a variable called "imagecapture".

Using the code copied from the wiki to display text I can show the image ID when I run the script:, i.e. using

Code:
class Score(xbmcgui.Window):
  def __init__(self):
    self.strAction = xbmcgui.ControlLabel(0, 0, 500, 300, '', 'font14', '0xFFFFFF00')
    self.addControl(self.strAction)
    self.strAction.setLabel(id)
mydisplay = Score()
mydisplay.doModal()
del My_Window

displays:

Image

Unfortunately I cannot work out how to display an image in python. I've tried the following and various permutations but every time I get an error log message saying "Error Contents: 'Score' object has no attribute 'ControlImage'".

Code:
    self.image = xbmcgui.ControlImage(0,0,1280,720,"")
    self.addControl(self.Image)
    self.image.setControlImage(imagecapture)

Does anyone know how I can display that variable to check the image is working,

BTW - I found they had their own API to fascilitate scraping of their website so I'm not worried about the legalities anymore.

Thanks

-----------
EDIT - if I use the first code with the variable "imagecapture" I get the following when I run the script, so I'm reasonably sure it is scraping the image.

Image
Reply
#4
You're not giving it an image in this line:
Code:
self.image = xbmcgui.ControlImage(0,0,1280,720,"")

Make that last parameter an image url and you should be in good shape
Reply

Logout Mark Read Team Forum Stats Members Help
Music score display - is this possible?0