Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 赋格曲中的乐器没有变化_Java_Jfugue - Fatal编程技术网

Java 赋格曲中的乐器没有变化

Java 赋格曲中的乐器没有变化,java,jfugue,Java,Jfugue,我正在运行Jfugue测试程序,下面是代码: package ge; import org.jfugue.*; public class GE { /** * @param args the command line arguments */ public static void main(String[] args) { Player player = new Player(); Pattern pattern = new P

我正在运行Jfugue测试程序,下面是代码:

package ge;

import org.jfugue.*;

public class GE {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       Player player = new Player();
       Pattern pattern = new Pattern("C D E F G A B I[MARIMBA]");
       player.play(pattern);
       System.exit(0); // If using Java 1.4 or lower
    }
}
到目前为止,代码确实有效,也就是说,它编译并播放音符。然而,我可以改变周围的乐器,无论我多么希望,我总是得到钢琴音乐


如何更改此设置?

您应该在序列的开头设置仪器,而不是在序列的结尾。序列
“I[MARIMBA]C D E F G A B”
对我来说是一种木琴乐器。

JFugue的作者插话说@Archeg的答案应该被认为是正确的答案!