JFugue 5外置midi设备

时间:2015-02-23 20:26:48

标签: java midi javax.sound.midi jfugue

尝试使用jFugue 5将序列发送到midi设备很长时间了:

     MusicReceiver device = getDeviceByName("name");

     Player player = new Player(); 
     Pattern pattern = new Pattern("A");    

     device.sendSequence(player.getSequence(pattern));

无法在" device.sendSequence"

     static MidiDevice.Info getDeviceInfoByName(String name) {
        for (MidiDevice.Info info : MidiSystem.getMidiDeviceInfo()) {
          if (info.getName().equals(name)) {
            return info;
          }
        }
        return null;
      }

      static MusicReceiver getDeviceByName(String name) {
          return new MusicReceiver((MidiDevice) getDeviceInfoByName(name));
      }

1 个答案:

答案 0 :(得分:0)

您正在尝试将MidiDevice.Info的{​​{1}}实例投射到getDeviceByInfo。将MidiDevice函数替换为以下内容:

getDeviceByName