Example usage for javax.sound.midi MetaMessage META

List of usage examples for javax.sound.midi MetaMessage META

Introduction

In this page you can find the example usage for javax.sound.midi MetaMessage META.

Prototype

int META

To view the source code for javax.sound.midi MetaMessage META.

Click Source Link

Document

Status byte for MetaMessage (0xFF, or 255), which is used in MIDI files.

Usage

From source file:com.rockhoppertech.music.midi.js.MIDIEvent.java

@Override
public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("MIDIEvent [");
    sb.append(" tick=").append(tick);
    sb.append(" beat=").append(startBeat);
    sb.append(" division=").append(division);
    sb.append(" status=").append(Integer.toHexString(status)).append(' ');
    sb.append(MIDIUtils.getCommandName(status));

    StringBuilder data = new StringBuilder();
    for (int i = 0; i < bytes.length; i++) {
        data.append("0x").append(Integer.toHexString(bytes[i]).toUpperCase(Locale.ENGLISH));
        if (i != bytes.length - 1) {
            data.append(',');
        }/*  w w w  .  ja  v  a2s  .  com*/
    }
    sb.append(" metatype=").append(metaMessageType);
    if (status == MetaMessage.META) {
        sb.append("\nMeta text:").append(MIDIUtils.bytesToText(bytes));
    } else {
        sb.append("data=\"").append(data.toString()).append("\" ");
    }

    sb.append("]");

    return sb.toString();
}