Hello **HUGers,
This year I created an online version of the Humdrum Extras programs:
The programs are downloaded and run directly within your browser as opposed to server-side processing. The programs are compiled from C++ into JavaScript code using emscripten:
I then interface with a hand-written JavaScript front-end for managing data input and output from the programs.
A tour of various features of the online interface can be found here:
The command pages have integrated help and sample data drop-down menus, making it easier for non-experts to use the programs (plus there is no installation step needed to run the programs). Not so great for power-users since there is no pipelining (except by copying the output of one program to the standard input box of another), and the programs and data need to be downloaded to the browser at the speed of your internet connection and distance from the server before running -- with JavaScript versions of the programs running about 2x slower than native compiling (Firefox being the fastest at about 1.6x slower and Safari being the slowest JavaScript interpreter).
One of the more interesting features can be seen in the mkeyscape program which calculates and displays an interactive key plot within the browser. If you click on the link below, it will take you to the online mkeyscape state of the online page, then it downloads the mkeyscape program and the data files from kernScores, then it calculates and display the resulting image within the page. Moving the mouse over the image will report the key represented by the color of the pixel which the mouse is pointing to.
The two parameters included in the URL above are:
command=mkeyscape -ln h://beethoven/sonatas/sonata01-1.krn
run=true
The command parameter specifies the command that you want to run. In this case the options to mkeyscape are -l for displaying a key-to-color legend below the plot, and the -n option displays tick marks for each measure underneath the plot. The data file comes from kernScores, where the h:// URI gets translated into a URL for kernScores. There is a drop-down menu on the page from which you can point-and-click to select sample data from various kernScores repertories. The run=true parameter means that the program should be run with the given command immediately upon loading the page (otherwise, you would have to click the "run" button to display the image). Spaces in URLs are encoded as %20 in case you are wondering.
Humdrum data output display can be either in plain text format, or displayed as a syntax-highlighted HTML table. Here is an example of the WTCII C#-minor fugue being transposed to C minor, shown as plain text:
To view with syntax highlighting, click on the "table" button on the above, page, or add the view=table parameter to the URL:
Another interesting feature is that you can drag and drop Humdrum files from your local computer into the standard input box (displayed with command-I or press the Standard Input button at the top of the page). Make sure to delete any file names from the command line, otherwise they will probably also be included in the programs's input (type control-backspace to delete the last filename on the command-line).
Click on the command name at the start of the command line to select a particular command to run. When selecting a new command, an example set of options and data file will be loaded for that command.
The Humdrum Toolkit requires two interpreters to run (awk, and the sh or bash shells), so not so easy to implement those programs directly in a web browser. However, you can copy/paste output from Humdrum Extras online programs into regular files to use with Humdrum Toolkit programs.
The Humdrum Extras online interface was presented at the Music Encoding Conference at the University of Virginia last month:
Also presented at the conference was Verovio:
which is a great in-browser notation display system using the same technology to compile C++ code into JavaScript. I will work on incorporating verovio with the Humdrum Extras online interface sometime this year... Further in the future, I might add pipelining capabilities, where there would be the ability to create multiple command lines entries in series along with paired tabbed outputs at the bottom of the page for viewing intermediate results.
-=+Craig