/harmony-analyser

Cross-platform Java application for analysing harmony progression using WAV or MIDI input.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Circle CI Coverage Status

harmony-analyser

Cross-platform Java application for analysing harmony progression of WAV or MIDI input.

Project website: harmony-analyser.org

harmony-analyser

Installation

For a simple chord analysis, simply download the latest stable version ha-executable-1.1.jar and run it using java -jar ha-executable-1.1.jar. If you wish to run the latest beta, or perform a song analysis, a more thourough setup is needed as external libraries need to be present on your system. Please check the pre-requisites below.

Pre-requisites:

  • Running JRE 8 or higher on your machine
  • Download and install libsndfile 1.0.27 or higher (Linux: Usually supported by package manager)
  • Download and install Vamp Plugins SDK 2.6 or higher (Linux: Supported by package manager, or ./configure && make sdk && make install)
  • Download and install jVamp 1.3 or higher (Linux: compile and place libvamp-jni.so to your java.library.path folder; run java -XshowSettings:properties if you are unsure of the location)
  • Download and install Chordino and NNLS Chroma Vamp plugins 1.1 or higher, and QM Vamp plugins set 1.7.1 or higher, for getting the most out of the analysis (Linux: compile and place nnls-chroma.so and qm-vamp-plugins.so to usr/local/lib/vamp folder)

To run the application:

  • Download and open ha-executable-<version>.jar (where version is the currently available version) located in target folder, using your Java Virtual Machine (or invoke java -jar target/ha-executable-<version>.jar in command-line)
  • For Command-line interface, move the file ha-script-<version>.jar from target folder into the folder with WAV files for analysis. Then invoke java -jar harmony-analyser-script-jar-with-dependencies -p <plugin name> -s .wav, or -h for help.

Development

You are welcome to fork, push your changes to your fork, and pull request at anytime! We will also be happy to add you as collaborator upon request. In addition to installation pre-requisites, a functional JDK needs to be installed in order to compile the source. Project uses Maven as the project management tool. Dependencies available in the public Maven repositories are pulled in automatically. Project uses one local dependency in form of JAR located in lib:

  • jVamp: Since the Vamp plugins are typically written in C++, we are using jVamp wrappers to load them in Java (jVamp uses JNI to work with native C++ code)

To install the dependency properly, issue from the project root: mvn install:install-file -DgroupId=org.vamp_plugins -DartifactId=jvamp -Dversion=1.3 -Dpackaging=jar -Dfile=./lib/jvamp.jar

Documentation

For more details and sample analysis please refer to the documentation located in documentation folder. For any questions and comments please contact the author on GitHub or [mail](mailto: marsik@ksi.mff.cuni.cz).

Troubleshooting

  1. You may get: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/harmony_analyser/application/HarmonyAnalyser : Unsupported major.minor version 52.0. That means you have a wrong version of JRE set up as your default JRE. The same error occurs when you don't have Java 8 on your system. Make sure you have Java 8 installed and your JRE is set up properly. You can check the default Java version used on your UNIX system with: sudo update-alternatives --config java.
  2. You may get jni.h: no such file or directory while failing to compile jVamp on UNIX. If so, you have to manually add the path to jni.h in the Makefile of jVamp. It should be something on line 18 looking like: INCLUDES := -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux and you will have to update it to something like: INCLUDES := -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I/path/to/jni.h