Humdrum Extras

humtable manpage


COMMAND

    humtable -- Markup Humdrum files in an HTML <table> element.

SYNOPSIS

    humtable [-pt[input[> output]

OPTIONS

-p Enclose table in a full HTML page.
-t Include Humdrum content in textarea at bottom of table.

DESCRIPTION

    The humtable program will markup a Humdrum file as an HTML table. By default, the program will produce only a <table> element which stores the Humdrum file line-by-line in the table as rows, and spines cell-by-cell in the table. In particular, the humtable program understands spine manipulations, and will align primary spines, with subspines subdividing a primary spine's cell into smaller units.

    humtable input

    **a**b**c
    abc
    abc
    abc
    *^**
    a1a2
    bc
    a1a2
    bc
    a1a2
    bc
    **
    **^
    **
    *
    **^
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    **
    *
    *v*v*
    a1a2
    b
    c12c3
    a1a2
    b
    c12c3
    a1a2
    b
    c12c3
    *v*v
    *
    **
    ab
    c12c3
    ab
    c12c3
    ab
    c12c3
    **^
    *v*v
    a
    b1b2
    c
    a
    b1b2
    c
    a
    b1b2
    c
    *
    *v*v
    *
    abc
    abc
    abc
    *-*-*-

    Compare the readability of the same data as plain text within a <pre> element:

     **a	**b	**c
    a	b	c
    a	b	c
    a	b	c
    *^	*	*
    a1	a2	b	c
    a1	a2	b	c
    a1	a2	b	c
    *	*	*	*^
    *	*	*	*	*^
    a1	a2	b	c1	c2	c3
    a1	a2	b	c1	c2	c3
    a1	a2	b	c1	c2	c3
    a1	a2	b	c1	c2	c3
    *	*	*	*v	*v	*
    a1	a2	b	c12	c3
    a1	a2	b	c12	c3
    a1	a2	b	c12	c3
    *v	*v	*	*	*
    a	b	c12	c3
    a	b	c12	c3
    a	b	c12	c3
    *	*^	*v	*v
    a	b1	b2	c
    a	b1	b2	c
    a	b1	b2	c
    *	*v	*v	*
    a	b	c
    a	b	c
    a	b	c
    *-	*-	*-
    
     

    For humdrum files with no subspines, the content of the Humdrum data can be recovered by copying/pasting the table from a webpage into a plain-text file if you are using Mozilla Firefox or Google Chrome. Microsoft Internet Explorer will separate columns by a space and not a tab, so it cannot be used in this way. For cases where you want to allow copy/paste of Humdrum data on a webpage in the general case with/without subspines, you can use the -t option to include a textarea underneath the table which contains a duplicate of the Humdrum data that can be copy/pasted from all browsers:

    humtable -t input

    **a**b**c
    abc
    abc
    abc
    *^**
    a1a2
    bc
    a1a2
    bc
    a1a2
    bc
    **
    **^
    **
    *
    **^
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    a1a2
    b
    c1c2c3
    **
    *
    *v*v*
    a1a2
    b
    c12c3
    a1a2
    b
    c12c3
    a1a2
    b
    c12c3
    *v*v
    *
    **
    ab
    c12c3
    ab
    c12c3
    ab
    c12c3
    **^
    *v*v
    a
    b1b2
    c
    a
    b1b2
    c
    a
    b1b2
    c
    *
    *v*v
    *
    abc
    abc
    abc
    *-*-*-

    For example, click in the above textarea box, then type control-A to select all of the text in the box, then control-C to copy the text, and then go to a text editor and type control-V to paste the Humdrum data.

    Using the -p option will generate a complete HTML page containing a the Humdrum table as its contents:

     humtable -p input > output
     

    Multiple Humdrum files can be given to humtable at the same time, and they will be concatenated into a series of tables in the output:

     humtable input1 input2

    !! file 1:
    **kern
    1c
    *-
    !! file 2:
    **kern
    1d
    *-

    Note that humtable currently has a few colorization features. In the above example, the global comments are highlighted in blue. Also, reference records will currently be highlighted in green.

    In the HTMLified Humdrum data, reference records lines contain tooltips which explain the meaning of the reference record abbreviation. Move your mouse over any of the following lines to see a brief description of the meaning of the reference record.

    !!!OTL@@GER: Tischlied
    !!!OTL@ENG: Table song
    !!!COM: Eberwein, Traugott Maximilian
    !!!CDT: 1775/10/27/-1831/12/02/
    !!!ODT: 1810
    !!!OMD@@GER: Lebhaft
    !!!OMD@ENG: Lively
    !!!OMD@ITA: Vivace
    !!!LYR: Goethe, Wolfgang von
    !!!LDT: 1802
    !!!OCL: Erk, Ludwig
    !!!GCO: Deutscher Liederschatz, Band 1
    !!!ENC: Craig Stuart Sapp
    !!!END: 2004/06/28/
    !!!EFL: 194/651

EXAMPLES

    Here is an example of a larger example, using the first movement of Beethoven's first piano sonata:

    humtable -p h://beethoven/sonatas/sonata01-1.krn > output

    In this example, note that you can click on labels in the thru expansion lists to navigate to the data line where the label is used.

DOWNLOAD

    The compiled humtable program can be downloaded for the following platforms:
    • Linux (i386 processors) (dynamically linked) compiled on 11 Nov 2013.
    • Windows compiled on 29 Jun 2012.
    • Mac OS X/i386 compiled on 13 Nov 2013.

    The source code for the program was last modified on 27 Mar 2011. Click here to go to the full source-code download page.