2

我正在运行 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
    }
}

到目前为止,代码确实有效,也就是说,它编译并播放了音符。然而,我可以随心所欲地改变乐器,我总是得到钢琴音乐。

我怎样才能改变这个?

4

1 回答 1

5

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

于 2013-03-31T20:04:44.170 回答