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:
After downloading and uncompressing the source code, you can compile the programs using the following commands:
cd humextra make library make programsIf 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:
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:
Adding humextra/bin to the command search pathIn 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 $PATHto 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/binThe colon (:) separates individual directory names in the $PATH. Then type this command in any directory:
which barnumand the computer should reply:
/usr/local/humextra/bin/barnumif 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.