Top Description Fields Constructors Methods
javax.sound.midi

public Class MidiEvent

extends Object
Class Inheritance

MIDI events contain a MIDI message and a corresponding time-stamp expressed in ticks, and can represent the MIDI event information stored in a MIDI file or a Sequence object. The duration of a tick is specified by the timing information contained in the MIDI file or Sequence object.

In Java Sound, MidiEvent objects are typically contained in a Track, and Tracks are likewise contained in a Sequence.

Authors
David Rivas, Kara Kytle

Field Summary

Modifier and TypeField and Description
private final MidiMessage
message

The MIDI message for this event.

private long
tick

The tick value for this event.

Constructor Summary

AccessConstructor and Description
public
MidiEvent(MidiMessage
the MIDI message contained in the event
message
,
long
the time-stamp for the event, in MIDI ticks
tick
)

Constructs a new MidiEvent.

Method Summary

Modifier and TypeMethod and Description
public MidiMessage

Returns:

the MIDI message
getMessage
()

Obtains the MIDI message contained in the event.

public long

Returns:

the time-stamp for the event, in MIDI ticks
getTick
()

Obtains the time-stamp for the event, in MIDI ticks.

public void
setTick(long
the new time-stamp, in MIDI ticks
tick
)

Sets the time-stamp for the event, in MIDI ticks.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messageback to summary
private final MidiMessage message

The MIDI message for this event.

tickback to summary
private long tick

The tick value for this event.

Constructor Detail

MidiEventback to summary
public MidiEvent(MidiMessage message, long tick)

Constructs a new MidiEvent.

Parameters
message:MidiMessage

the MIDI message contained in the event

tick:long

the time-stamp for the event, in MIDI ticks

Method Detail

getMessageback to summary
public MidiMessage getMessage()

Obtains the MIDI message contained in the event.

Returns:MidiMessage

the MIDI message

getTickback to summary
public long getTick()

Obtains the time-stamp for the event, in MIDI ticks.

Returns:long

the time-stamp for the event, in MIDI ticks

setTickback to summary
public void setTick(long tick)

Sets the time-stamp for the event, in MIDI ticks.

Parameters
tick:long

the new time-stamp, in MIDI ticks