IT. Expert System.

Java Standard Edition (SE)



Class Track

  • public class Track
    extends Object
    A MIDI track is an independent stream of MIDI events (time-stamped MIDI data) that can be stored along with other tracks in a standard MIDI file. The MIDI specification allows only 16 channels of MIDI data, but tracks are a way to get around this limitation. A MIDI file can contain any number of tracks, each containing its own stream of up to 16 channels of MIDI data.

    A Track occupies a middle level in the hierarchy of data played by a Sequencer: sequencers play sequences, which contain tracks, which contain MIDI events. A sequencer may provide controls that mute or solo individual tracks.

    The timing information and resolution for a track is controlled by and stored in the sequence containing the track. A given Track is considered to belong to the particular Sequence that maintains its timing. For this reason, a new (empty) track is created by calling the Sequence.createTrack() method, rather than by directly invoking a Track constructor.

    The Track class provides methods to edit the track by adding or removing MidiEvent objects from it. These operations keep the event list in the correct time order. Methods are also included to obtain the track's size, in terms of either the number of events it contains or its duration in ticks.

    See Also:
    Sequencer.setTrackMute(int, boolean), Sequencer.setTrackSolo(int, boolean)
    • Method Detail

      • add

        public boolean add(MidiEvent event)
        Adds a new event to the track. However, if the event is already contained in the track, it is not added again. The list of events is kept in time order, meaning that this event inserted at the appropriate place in the list, not necessarily at the end.
        event - the event to add
        true if the event did not already exist in the track and was added, otherwise false
      • remove

        public boolean remove(MidiEvent event)
        Removes the specified event from the track.
        event - the event to remove
        true if the event existed in the track and was removed, otherwise false
      • get

        public MidiEvent get(int index)
                      throws ArrayIndexOutOfBoundsException
        Obtains the event at the specified index.
        index - the location of the desired event in the event vector
        the event at the specified index
        ArrayIndexOutOfBoundsException - if the specified index is negative or not less than the current size of this track.
        See Also:
      • size

        public int size()
        Obtains the number of events in this track.
        the size of the track's event vector


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 35 / 159525178. Delta: 0.04416 с