Humdrum Extras

Downloads

Firstly, here are the lazy person's instructions for downloading and compiling Humextra programs:

  • Linux or Cygwin (for Microsoft Windows):
  • OS X:
  • Running the above commands will first download a master makefile. Then running that makefile will download the source code for humextras, uncompress it to the directory humextra, compile the library code, and finally compile the programs, which will be placed in humextra/bin. You may want to create and cd to an empty directory before running the commands. If you want to compile humplay, type "make all" rather than "make" to also download and compile the required additional library. The source code for Humdrum Extras can also be downloaded from Github.


    The source code for compiling programs in the Humdrum Extra collection is available in three compressed formats, plus a fourth file containing the most recent (unstable) version of the code:

    humextra.tgz Source code compressed as a GNU zipped tar file. Uncompress this file in Linux using the command:
       tar xvzf humextra.tgz
    . The file can be downloaded from the command-line in Linux with the command:
       wget http://extras.humdrum.org/download/humextra.tgz
    or in OS X using Terminal.app:
       curl http://extras.humdrum.org/download/humextra.tgz -o humextra.tgz
    humextra.zip Source code compressed as a ZIP file (most common distribution type for Windows). Uncompress this file in Linux using the command:
       unzip humextra.zip
    . The file can be downloaded from the command-line in Linux with the command:
       wget http://extras.humdrum.org/download/humextra.zip
    or in OS X using Terminal.app:
       curl http://extras.humdrum.org/download/humextra.zip \
          -o humextra.zip
    humextra.tar.bz2 Source code compressed as a bzip2 tar file. Uncompress this file in Linux using the command:
       tar xvjf humextra.tar.bz2
    . The file can be downloaded from the command-line in Linux with the command:
       wget http://extras.humdrum.org/download/humextra.tar.bz2
    or in OS X using Terminal.app:
       curl http://extras.humdrum.org/download/humextra.tar.bz2 \
          -o humextra.tar.bz2
    bleedingedge This is the most recent version of the code (as of today) which contain the latest changes and bug fixes as well as bonus new bugs. Uncompress this file in Linux using the command:
       tar xvjf humextra-`date +"%Y%m%d"`.tar.bz2
    . The file can be downloaded from the command-line in Linux with the command:
       wget http://extras.humdrum.org/cgi-bin/humextra \
          -O humextra-`date +"%Y%m%d"`.tar.bz2
    or in OS X using Terminal.app:
       curl http://extras.humdrum.org/cgi-bin/humextra \
          -o humextra-`date +"%Y%m%d"`.tar.bz2
    where %Y = four-digit year, %m = two-digit month, %d = two-digit day.

    After downloading and uncompressing the source code, you can compile the programs using the following commands:

       cd humextra
       make library
       make programs
    
    If you want to compile the humplay command, then you will have to also download the improv interactive-MIDI library. The easiest way to download the most-recent improv library code from the command-line:

      Linux:
      wget http://improv.sapp.org/cgi-bin/improv \
            -O improv-`date +"%Y%m%d"`.tar.bz2
      OS X:
      curl http://improv.sapp.org/cgi-bin/improv \
            -o improv-`date +"%Y%m%d"`.tar.bz2
    If you do not compile the improv library first, the humplay command will be ignored by the humextra makefile. You can also use this makefile to control the downloading and compiling of everything in one step as mentioned at the top of this page. Using this makefile, you should be able to type "make" to download and compile everything in a single step. The makefile will create two directories called humextra and improv, then compiles the improv library (if you are running make all), the humextra library, and finally the humextra programs. Note that the make file will erase any existing directories called humextra and improv before downloading and unpacking the source code.

    If you are not using Linux on Intel CPUs or OS X on Intel CPUs, you may have to edit the Makefiles to manually set the OSTYPE and OSSUBTYPE variables in the makefiles: humextra/Makefile.library and humextra/Makefile.programs.

    Compiled programs will be written to the directory humextra/bin. The file humextra/TIMESTAMP contains the date at which time the source code files were last collected into the first three distribution files listed above. The TIMESTAMP in the unstable release is the time of the last double-checked release, not the date of the unstable release (which is now).

    Note that in order to compile the programs in OS X, you must have the development tools installed on your computer first. Try running gcc --version to see if the GNU C compiler can be found from the terminal. If gcc is not found, you must first install Xcode.app from the Apple App store. Xcode.app is a free application used to compile OS X applications. To compile in Terminal.app, first install Xcode.app and then inside XCode preferences, do these three steps:

    1. click on Downloads tab
    2. Select command line tools
    3. click on install button (180 MB download)

    Adding humextra/bin to the command search path

    In order for humextra commands to be run from any directory, the humextra/bin directory must be added to the command search path which is stored in the environmental variable $PATH. To add another directory to the command search path, place it into the environmental variable $PATH. Try typing:
       echo $PATH
    
    to see its current setting. To add a directory to the $PATH variable in bash shells (assuming the following location is where you place the humextra directory):
       export PATH=$PATH:/usr/local/humextra/bin
    
    The colon (:) separates individual directory names in the $PATH. Then type this command in any directory:
      which barnum
    
    and the computer should reply:
        /usr/local/humextra/bin/barnum
    
    if the $PATH variable can find the barnum command.

    To permanently adjust the $PATH variable, you can edit /etc/profile.d/humdrum.sh (or where ever you have stored the Humdrum initialization script) so it looks like this:

    The if-statements check to see if the variables HUMDRUM/HUMEXTRA are defined or not, and if defined, check if the variable is set to the correct value. If the variable does not exist or is set incorrectly, then the if-statment code is run. The export command allows the changes in the environmental variables to persist after the humdrum.sh script is exited (it makes them global variables). You should restart the shell to have the variables updated, or you can type "source /etc/profile.d/humdrum.sh" to run the setup script without needing to restart the bash shell program.


    Programming Documentation:

    If you want to write your own programs using the humextra library, then you might want to look at these slides: (PDF) (PowerPoint) as well as the accompanying tutorial.