How to control the MIDI channel's volume

痞子三分冷 提交于 2019-11-29 11:12:57

You can use CC 7 for setting channel volume.

channel.controlChange(7, value);

see: http://improv.sapp.org/doc/class/MidiOutput/controllers/controllers.html

Sometimes you have some volume events in the midi file so you cannot change channel volume. After getting the sequence, remove these events :

Track[] tracks = sequence.getTracks();
for (Track track : tracks){
for(int i = 0; i < track.size(); i++){
    if(!track.remove(track.get(i))){
        System.out.println("MIDI Event not removed");
    }
}}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!