![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e721. Setting the Volume of Playing Midi Audio// To create a Sequencer object, see e716 Loading and Playing Midi Audio if (sequencer instanceof Synthesizer) { Synthesizer synthesizer = (Synthesizer)sequencer; MidiChannel[] channels = synthesizer.getChannels(); // gain is a value between 0 and 1 (loudest) double gain = 0.9D; for (int i=0; i<channels.length; i++) { channels[i].controlChange(7, (int)(gain * 127.0)); } }
e719. Determining the Duration of a Midi Audio File e720. Determining the Position of a Midi Sequencer
© 2002 Addison-Wesley. |