There should be a way of indicating the standard musical notation of something in Wikidata. Currently there is no way to do so in a way which at least matches the functionality of the math datatype (which can render equations). It is already possible to use the string datatype but it is limited to four hundred characters and would not be able to render anything.
Two possible methods to solve this are:
- using LilyPond notation;
- using files hosted on Commons, probably MuseScore files (or MusicXML files).
There is already an Extension:Score (MediaWiki-extensions-Score) for LilyPond, which does rendering and MIDI audio output. Scores using this LilyPond datatype would also probably be limited to four hundred characters. Longer scores in the public domain (or compatibly licensed) would have to use a different solution, although this may be desired. Quoting @Mahir256:
Apologies if I'm drawing too many unneeded parallels to the present status of LaTeX equations, but I think the situations here are very similar. We have migrated quite a bit away from storing images of equations on Commons to simply rendering them on wikis where they are needed (whether on Wikipedia, on Wikisource, and now here), even as we don't store full-fledged mathematical derivations in statements here due to issues with the maximum length of the string datatype. Similarly we have the ability to migrate from storing images of music snippets on Commons to simply rendering them where they are needed (whether on Wikisource, on Wikipedia, and potentially here), and I am sure it will not be feasible to store full scores of pieces as statements here for the same technical reason. As such the use cases I have suggested above are intended to exclude the possibility of storing entire scores, just as entire derivations are excluded from being stored here.
Allowing MuseScore rendering or playback would require the creation of a MediaWiki extension which would basically incorporate MuseScore's (currently existing) command line export functions, likely for PDF rendering and Ogg audio playback. The scores would be hosted on Commons. Quoting @Mahir256:
I have noticed that the introduction of new extensions to Wikimedia sites becomes problematic as there are generally numerous security issues to be resolved and often there needs to be someone to maintain said extensions for use specifically with Wikimedia sites.
I am not sure if all the concerns are applicable, but there would obviously need to be a security review and post-deployment maintenance. My reasoning for not relying on Extension:Score (tied 97 of 214 in 2017 Community Wishlist Survey):
The Score extension is not particularly easy to use due to not having a graphical input option, and has not been updated in almost four years. Furthermore, the rendering is pixelated and PNG instead of SVG; and the image is hard to resize (a paper size has to be specified) and align (a div has to be made to align it and the audio player to anything). In addition, the double bass and possibly some other instruments are not playable.