尝试使用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));
}
答案 0 :(得分:0)
您正在尝试将MidiDevice.Info
的{{1}}实例投射到getDeviceByInfo
。将MidiDevice
函数替换为以下内容:
getDeviceByName