New VHV feature: URL with embedded data

14 views
Skip to first unread message

Craig Sapp

unread,
May 6, 2022, 9:35:40 PM5/6/22
to stars...@googlegroups.com
Hello **HUGers,

Here is an interesting recent feature added to VHV:  There is now a menu option to copy a short musical score into a URL.  This means that you can send a URL to someone with a short example rather than sending them the data only, requiring them to open VHV and copy the contents.   Also the URLs can be given as links on a webpage to open small examples in VHV without having to host the data somewhere on the web.

Example:

Here is a C melodic minor scale in VHV:

Screen Shot 2022-05-06 at 6.08.57 PM.png

To create the URL containing the Humdrum data, go to the File menu and then select the "Copy MIME URL" at the bottom of the menu:

Screen Shot 2022-05-06 at 6.09.09 PM.png

This will copy to the system clipboard the following URL:


The contents of the t parameter in the URL is MIME encoded contents from the editor.

If you paste that URL into a web browser, you can see the same text displayed in VHV that is extracted from the URL:

Screen Shot 2022-05-06 at 6.10.08 PM.png


You can also use some setup parameters to simplify the interface using the "k" url parameter:

k = E   hide the menu/toolbar when loading VHV
k = y    hide the text editor when loading VHV
k = b   hide the VHV logo when loading VHV
k = e   suppress the splash music when loading VHV

Here is an example using all of the settings:


Which will give a minimal display with only the title on the left and a play button on the right:

Screen Shot 2022-05-06 at 6.12.27 PM.png

Filters can also be used with the embedded score.  In the following case the scale is encoded in C minor, but the filter command transposed to F minor and changes the text from C minor to F minor in the text above the staff:


Screen Shot 2022-05-06 at 6.26.59 PM.png

Transposing the same data to G minor using the same data and modifying with filters:


Screen Shot 2022-05-06 at 6.27.58 PM.png

URL lengths are usually limited to around 2000 characters in many web browsers, so data creating a URL longer than 2083 characters will generate a warning message when copying the link to the system clipboard.

-=+Craig


Reply all
Reply to author
Forward
0 new messages