Package javax.sound.midi

Examples of javax.sound.midi.MidiChannel.noteOn()


        // Make all voices busy, e.g.
        // send midi on and midi off on all available voices       
        MidiChannel ch1 = synth.getChannels()[0];
        ch1.programChange(48); // Use contionus instrument like string ensemble
        for (int i = 0; i < synth.getMaxPolyphony(); i++) {           
            ch1.noteOn(64, 64);
            ch1.noteOff(64);
        }
       
        // Now send single midi on, and midi off message
        ch1.noteOn(64, 64);
View Full Code Here


            ch1.noteOn(64, 64);
            ch1.noteOff(64);
        }
       
        // Now send single midi on, and midi off message
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
       
        // Read 10 sec from stream, by this time all voices should be inactvie
        stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

 
View Full Code Here

        synth.loadAllInstruments(sf2);
       
        // Send out one midi on message
        MidiChannel ch1 = synth.getChannels()[0];
        ch1.programChange(0);
        ch1.noteOn(64, 64);
       
        // Read 1 sec from stream
        stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 2)));

        // Close the synthesizer after use
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.