2

In the given code below freqs 240 and 254.1764 are far apart, but sounding both at 240. The same is true for 288 and 301.395, and same problem is with last two 432 and 552.09. I need help to sort out whether the problem is in java or JFugue part.

      class JFugueMicrotoneTest{


      public static void main(String[]arg)throws InvalidMidiDataException, IOException{

        MicrotoneNotation microtone = new MicrotoneNotation();
        microtone.put("C", 240.0);
        microtone.put("Df", 254.1764705882353);
        microtone.put("D", 270.0); 
        microtone.put("Ef", 288.0);
        microtone.put("E", 301.3953488372093);
        microtone.put("F", 320.0);
        microtone.put("F#", 338.8235294117647);
        microtone.put("G", 360.0);
        microtone.put("Af", 381.1764705882353);
        microtone.put("A", 405.0);
        microtone.put("Bf", 432.0);
        microtone.put("B", 452.09302325581393);

        Player player = new Player();
        String music="T[60] <C> <Df>    <D>     <Ef> <E>    <F> <F#> <G> <Af> <A>       <Bf> <B>";
        Pattern pattern=microtone.getPattern(music);
        player.play(pattern);
        }
} 
Harjit Singh
  • 905
  • 1
  • 8
  • 17

1 Answers1

1

JFugue 5.0.9 has been updated with a fix to the math conversions used to create microtones. Try it and hear the difference!

Also: The code you posted in your original question is JFugue 4.x code. In JFugue 5.x, there is no MicrotoneNotation class. Instead, you can write your frequency directly into the music string like this:

"T60 m240.0 m254.17 m270.0"

(notice also there are no square brackets around the numeric Tempo value in version 5.x)

You can also create a "Replacement Map" if you want to use <C>, <Cf>, etc. in your strings. See the last three examples currently shown on http://www.jfugue.org/examples.html

David Koelle
  • 20,726
  • 23
  • 93
  • 130