Midi volume control is broken
nittka opened this issue · 1 comments
The current implementation of the volume control is broken for two reasons.
a) sequencer.getTransmitter() returns a new transmitter whose receiver is set to the synthesizer's (the sequencer's original receiver remains). So basically there are now two receivers. This results in the score being played twice at the same time. You can notice this in two ways (at least I can on two different systems). Changing the volume to zero does not turn off the music completely (in fact, it turns of completely one of the two parallel streams). Also occasionally, the two streams go out of synch, so you can clearly hear the score being played twice.
This problem can be solved by adding for (Transmitter t: sequencer.getTransmitters()) {t.close();}
after opening the sequencer. That way, the score is played only once and the volume can really be set to 0.
b) It is not possible to globally set the relative volume of a track, you can only set the absolute volume at that moment. I.e. once a midi volume event arrives (mf, cresc...), the manual volume setting is lost again.
The solution for b is removing the volume control completely. It is not really needed, as you have better control (for the relative volume) using the system's volume settings.
The fix for a) is mandatory (in my opinion), the question is, whether we should get rid of the volume setting and the synthesizer completely. What do you think?
(When I played around with the midi view almost 2 years ago, I tried out whether changing the instruments during playback would work by making the instrument column editable - for this feature the same restriction as a would apply - a instrument setting midi event would undo the change if you do not remove all such events. For such a feature, the synthesizer would be necessary...)