Open VHV with score payload

10 views
Skip to first unread message

alexande...@gmail.com

unread,
Nov 24, 2023, 6:44:01 AM11/24/23
to starstarhug
Hi Craig,

VHV is fantastic! Is there a way to open VHV with a score passed as a string or url? I know that you can go to VHV and drag&drop a score on the page or paste the contents of the file, but if we wanted to automate that little step, is there an api for that? I saw that there is myVHV but it would be great to try this out directly on the VHV.

Thanks,

Alex

Craig Sapp

unread,
Nov 24, 2023, 7:38:39 AM11/24/23
to stars...@googlegroups.com
Hi Alex,

Yes, both Humdrum data URLs and raw Humdrum contents embedded into the VHV URL can be loaded into VHV.

For raw contents there is a limitation of about 2000 characters for most browsers (maximum allowed length of a URL).   So only fairly short examples can be directly embedded in the URL.

You can embed Humdrum data by typing the score into VHV, and then select File->Copy MIME URL from the menu:

Screenshot 2023-11-24 at 21.23.47.png  <--------

Here is a short example:


which loads the example into VHV:

Screenshot 2023-11-24 at 21.26.10.png

If you want to generate your own content for the URL, the string KiprZXJuCjFjOwo9PQoqLQo= is MIME encoded contents, specifically Base64: https://en.wikipedia.org/wiki/Base64

For URLs pointing to Humdrum data files on the web, here is an example:



For Github, you can also give a URL to the webpage for the file in the repository (which will be converted into the raw data URL):



MusicXML and MEI files can also be loaded in this way (although they are usually too long for the MIME encoded method).

Embedded URLs should preferably use https rather than http since most browsers do not allow mixing https and http content anymore.


-=+Craig



--
--
This is a message is from the **HUG newgroup.
To post to this group, send email to stars...@googlegroups.com
To unsubscribe from this group, send email to
starstarhug...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/starstarhug?hl=en
---
You received this message because you are subscribed to the Google Groups "starstarhug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to starstarhug...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/starstarhug/694922c7-01a6-4ae5-9b66-b7800523ad89n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages