Midi sequence with java

Class Sequence

A Sequence is a data structure containing musical information (often an entire song or composition) that can be played back by a Sequencer object. Specifically, the Sequence contains timing information and one or more tracks. Each track consists of a series of MIDI events (such as note-ons, note-offs, program changes, and meta-events). The sequence’s timing information specifies the type of unit that is used to time-stamp the events in the sequence.

A Sequence can be created from a MIDI file by reading the file into an input stream and invoking one of the getSequence methods of MidiSystem . A sequence can also be built from scratch by adding new Tracks to an empty Sequence , and adding MidiEvent objects to these Tracks .

Field Summary

The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.

The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).

Constructor Summary

Constructs a new MIDI sequence with the specified timing division type, timing resolution, and number of tracks.

Method Summary

Methods declared in class java.lang.Object

Field Details

PPQ

The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.

Читайте также:  Add to all elements in list python

SMPTE_24

SMPTE_25

SMPTE_30DROP

The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).

SMPTE_30

divisionType

resolution

tracks

Constructor Details

Sequence

Constructs a new MIDI sequence with the specified timing division type and timing resolution. The division type must be one of the recognized MIDI timing types. For tempo-based timing, divisionType is PPQ (pulses per quarter note) and the resolution is specified in ticks per beat. For SMTPE timing, divisionType specifies the number of frames per second and the resolution is specified in ticks per frame. The sequence will contain no initial tracks. Tracks may be added to or removed from the sequence using createTrack() and deleteTrack(javax.sound.midi.Track) .

Sequence

Constructs a new MIDI sequence with the specified timing division type, timing resolution, and number of tracks. The division type must be one of the recognized MIDI timing types. For tempo-based timing, divisionType is PPQ (pulses per quarter note) and the resolution is specified in ticks per beat. For SMTPE timing, divisionType specifies the number of frames per second and the resolution is specified in ticks per frame. The sequence will be initialized with the number of tracks specified by numTracks . These tracks are initially empty (i.e. they contain only the meta-event End of Track). The tracks may be retrieved for editing using the getTracks() method. Additional tracks may be added, or existing tracks removed, using createTrack() and deleteTrack(javax.sound.midi.Track) .

Method Details

getDivisionType

getResolution

Obtains the timing resolution for this sequence. If the sequence’s division type is PPQ, the resolution is specified in ticks per beat. For SMTPE timing, the resolution is specified in ticks per frame.

createTrack

Creates a new, initially empty track as part of this sequence. The track initially contains the meta-event End of Track. The newly created track is returned. All tracks in the sequence may be retrieved using getTracks() . Tracks may be removed from the sequence using deleteTrack(javax.sound.midi.Track) .

deleteTrack

getTracks

Obtains an array containing all the tracks in this sequence. If the sequence contains no tracks, an array of length 0 is returned.

getMicrosecondLength

getTickLength

getPatchList

Obtains a list of patches referenced in this sequence. This patch list may be used to load the required Instrument objects into a Synthesizer .

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Class Sequence

A Sequence is a data structure containing musical information (often an entire song or composition) that can be played back by a Sequencer object. Specifically, the Sequence contains timing information and one or more tracks. Each track consists of a series of MIDI events (such as note-ons, note-offs, program changes, and meta-events). The sequence’s timing information specifies the type of unit that is used to time-stamp the events in the sequence.

A Sequence can be created from a MIDI file by reading the file into an input stream and invoking one of the getSequence methods of MidiSystem . A sequence can also be built from scratch by adding new Tracks to an empty Sequence , and adding MidiEvent objects to these Tracks .

Field Summary

The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.

The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).

Constructor Summary

Constructs a new MIDI sequence with the specified timing division type, timing resolution, and number of tracks.

Method Summary

Methods declared in class java.lang.Object

Field Details

PPQ

The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.

SMPTE_24

SMPTE_25

SMPTE_30DROP

The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).

SMPTE_30

divisionType

resolution

tracks

Constructor Details

Sequence

Constructs a new MIDI sequence with the specified timing division type and timing resolution. The division type must be one of the recognized MIDI timing types. For tempo-based timing, divisionType is PPQ (pulses per quarter note) and the resolution is specified in ticks per beat. For SMTPE timing, divisionType specifies the number of frames per second and the resolution is specified in ticks per frame. The sequence will contain no initial tracks. Tracks may be added to or removed from the sequence using createTrack() and deleteTrack(javax.sound.midi.Track) .

Sequence

Constructs a new MIDI sequence with the specified timing division type, timing resolution, and number of tracks. The division type must be one of the recognized MIDI timing types. For tempo-based timing, divisionType is PPQ (pulses per quarter note) and the resolution is specified in ticks per beat. For SMTPE timing, divisionType specifies the number of frames per second and the resolution is specified in ticks per frame. The sequence will be initialized with the number of tracks specified by numTracks . These tracks are initially empty (i.e. they contain only the meta-event End of Track). The tracks may be retrieved for editing using the getTracks() method. Additional tracks may be added, or existing tracks removed, using createTrack() and deleteTrack(javax.sound.midi.Track) .

Method Details

getDivisionType

getResolution

Obtains the timing resolution for this sequence. If the sequence’s division type is PPQ, the resolution is specified in ticks per beat. For SMTPE timing, the resolution is specified in ticks per frame.

createTrack

Creates a new, initially empty track as part of this sequence. The track initially contains the meta-event End of Track. The newly created track is returned. All tracks in the sequence may be retrieved using getTracks() . Tracks may be removed from the sequence using deleteTrack(javax.sound.midi.Track) .

deleteTrack

getTracks

Obtains an array containing all the tracks in this sequence. If the sequence contains no tracks, an array of length 0 is returned.

getMicrosecondLength

getTickLength

getPatchList

Obtains a list of patches referenced in this sequence. This patch list may be used to load the required Instrument objects into a Synthesizer .

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Оцените статью