JFugue semitones between 2 notes

62 Views Asked by At

What is the fastest way (if any) to get the semitones between 2 notes in JFugue (vr 5.0.9) ?

For instance, how can i get the number of semitones between F4 and G5?

1

There are 1 best solutions below

0
David Koelle On BEST ANSWER

I think the getValue() method on a Note will give you what you're looking for.

    Note n1 = new Note("F4");
    Note n2 = new Note("G5");
    int semitoneDelta = n2.getValue() - n1.getValue(); 
    System.out.println(semitoneDelta); // returns 14 in this case