Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1 KB

README.md

File metadata and controls

33 lines (23 loc) · 1 KB

Chroma

A pitch and chroma implementation in written Java

The implementation is based on http://resources.mpi-inf.mpg.de/MIR/chromatoolbox/

Usage

After loading the .wav file using the Wave class, we can use the Chroma class to generate the chroma.

The signal2Chroma function gets as input a wave file and returns a 2D matrix which represents the chroma.

Usage Example

    String filename = "data/piano.wav"; // THE PATH TO THE WAV FILE
    Wave wave = new Wave(filename);
    Chroma chromaGenerator = new Chroma();
    double [][] chroma;
    chroma = chromaGenerator.signal2Chroma(wave.getNormalizedAmplitudes());
    DataAccess dal = new DataAccess();
    dal.writeMatrixToFile(chroma,"src/test/resources/data/chroma.txt");

Visualize

In order to visualize the chroma, you can use the python script inside the python folder.

cd into the python folder and type:

    python plot_matrix.py --chroma 'src/test/resources/data/chroma.txt'

chroma