Java 8 MetaMessage - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MetaMessage class.

This code example shows how to use the following methods:getData, getType
 
         
        // And now to parse the MIDI! 
        for (int t = 0; t < tracks.length; t++)
        { 
            int trackSize = tracks[t].size();
            if (trackSize > 0)
            { 
                fireVoiceEvent(new Voice((byte)t)); 
 
                for (int ev = 0; ev < trackSize; ev++)
                { 
                    counter++;
                    fireProgressReported("Parsing MIDI...", counter, totalCount);
                     
                    MidiEvent event = tracks[t].get(ev);
                    MidiMessage message = event.getMessage();
 
                    trace("Message received: ",message);
                    parse(message, event.getTick());

4
CodeRank
This code example shows how to use the following methods:getType
		this.sequencer.setMicrosecondPosition(0);
		this.sequencer.removeMetaEventListener(this);
	} 
 
	public void meta(MetaMessage msg) {
		if (msg.getType() == MIDI_EOT_MESSAGE) {
			this.sequencer.setMicrosecondPosition(0);
			this.sequencer.removeMetaEventListener(this);
		} 
	} 
 
	public void setSoundVolume(int volume) {
		if (this.sequencer == null) {
			return; 
		} 
		if (volumeSupported) {
			MidiChannel[] channels = ((Synthesizer) this.sequencer)
					.getChannels();
			for (int i = 0; i < channels.length; i++) {
				channels[i].controlChange(GAIN_CONTROLLER, volume);
4
CodeRank
This code example shows how to use the following methods:getData
        return new byte[] { (byte)d1, (byte)d2, (byte)d3 }; 
    } 
     
    public static final int parseMicrosecondsPerBeat(MetaMessage message, long timestamp)
    { 
        int tempo = message.getData()[0]*16384 + message.getData()[1]*128 + message.getData()[2];
        int beatsPerMinute = (int)convertMicrosecondsPerBeatToBPM(tempo);
        return beatsPerMinute;
    } 
     
    /** Converts microseconds per beat to BPM -- and vice versa */ 
    public static final double convertMicrosecondsPerBeatToBPM(double value) {
        double microsecondsPerMinute = 60000000.0D;
        if (value == 0.0d) {
            return 0.0d; 
        } 
        return microsecondsPerMinute / value;
    } 
     
    /** Converts microseconds per beat to BPM -- and vice versa */ 
4
CodeRank
See Code Examples for Java 8 MetaMessage Methods: