2

I'm working with JFugue , when i tried to execute the code

Player myPlayer = new Player();
myPlayer.play( ":DEFAULT(duration=.25)");  
Pattern test=new Pattern(" m327.0  m348.8  ( m392.4/0.25  m413.393 m392.4 )/0.5 m348.8 ");
myPlayer.play(test);

I'm getting a Parser exception,The character, parsed as a note velocity, is not recognized: : 0

when i remove the 0 from ')/0.5' , it works properly

Pattern test=new Pattern(" m327.0  m348.8  ( m392.4/0.25  m413.393 m392.4 )/.5 m348.8 "); 

The same exception is showing for all values greater than or equal to 1(for eg: ')/1.5' ) But, I noticed that m392.4/0.25 is working without any problem.

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

1 Answers1

1

The problem is in here:

( m392.4/0.25  m413.393 m392.4 )/.5

When JFugue parses elements in parentheses, it adds whatever immediately follows the parentheses to each element within the parentheses. In this case, the JFugue parser adds /.5 to each of the microtone elements, giving:

m392.4/0.25/0.5 m413.393/0.5 m392.4/0.5

Look at that first token. m392.4/0.25/0.5 is not valid; it contains two durations, and JFugue does not know how to interpret this. After successfully parsing the first duration (/0.25), the JFugue parser is now expecting to either see a velocity, a connector (like + or _), or nothing. The error message does seem misleading, so I'll look into that.

David Koelle
  • 20,726
  • 23
  • 93
  • 130
  • Thank you David for helping me to find the problem... I know that there is no one other than you to give the solution.. Thank you very much... and Good luck... – Shana Kalyan Feb 24 '15 at 04:35