Libjamu - A java music library

A simple music theory and midi library in java

What’s LibJaMu?

The idea to create LibJamu is from my master thesis and the conception of the prototype GenSession: A Flexible Zoomable Interface for Melody Generation. After this work, I decided to create this library to support the development of a new melody generator called MURAL.

The next step will be to write the javadoc. I think this library could be very powerful to write music tool needed music theory algorithm.

All of this is work in progress.

An example of use

This algorithm take a chord progression as text (like “C D- E” means Do major, Re minor and Mi major) and return the list of scales matching with these chords.

package com.cabrol.francois.libjamutest;

import com.cabrol.francois.libjamu.musictheory.entity.scaleNote.Chord;
import com.cabrol.francois.libjamu.musictheory.entity.scaleNote.ChordSuite;
import com.cabrol.francois.libjamu.musictheory.entity.scaleNote.Scale;
import com.cabrol.francois.libjamu.musictheory.entity.scaleNote.ScaleNote;
import com.cabrol.francois.libjamu.musictheory.utils.ScalesUtils;

import java.util.ArrayList;
import java.util.List;

class Main {
  public static void main(String[] args) {
    try {
        ChordSuite chordProgression = new ChordSuite("A- D-7");
        List<ScaleNote> scaleNotes = new ArrayList<ScaleNote>();
        for(Chord chord : chordProgression.getChords())  {
            scaleNotes.addAll(chord.getScaleNotes());
        }
        List<Scale> scales = ScalesUtils.getScalesFromNotes(scaleNotes);
        for (Scale scale: scales)
          System.out.println("For the "+chordProgression+ " you can improvise on " + scale);
    } catch (Exception e) {
        System.err.println("The analysis didn't work");
    }
  }

}

You will get this output:

    
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de C major ( C D E F G A B )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de F major ( F G A A# C D E )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de D minor ( D E F G A A# C )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de A minor ( A B C D E F G )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de C mixolydien ( C D E F G A A# )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de G mixolydien ( G A B C D E F )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de A harmonic ( A B C D E F G# )
    For the ChordSuite{ A-(A-C-E-) D-7(D-F-A-C-) } you can improvise on Gamme de E orient3 ( E F G# A A# C D )