I want to be able to control the 'master' or overall volume of a midi file that I play.
The setup:
- I have a midi file in my java gui program that I want to play
- I also have some interface which allows user input via keyboard/mouse/midi device to play sound
- Finally I have sampled audio effects as well
What I want:
- to be able to control the overall volume of the midi file on the fly as it plays in the background, without affecting the volume of any other audio element
Usual solution:
- change the channel volume of each channel in the Synthesizer used to play the midi file
- problem with this method is that if the midi file sends any volume messages to the Synthesizer, my volume settings are overridden
My solution (not finished yet)
- implement a homespun Receiver/Transmitter to put in between the Sequencer and the Synthesizer
- I plan on intercepting the channel volume related messages from the Sequencer, applying a gain set by my JSlider, and then relaying the edited messages to the Synthesizer.
Related question:
- If my solution is the only way, other than the channel volume messages, are their any other volume related messages that I would have to intercept and edit as well?
Main question:
How can I just change the 'master' volume of the midi file?