1

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?

BabaNew
  • 884
  • 1
  • 13
  • 27

1 Answers1

1

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
David Koelle
  • 20,726
  • 23
  • 93
  • 130