javax.sound.midi

Class Sequence


  • public class Sequence
    extends Object
    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.

    See Also:
    Sequencer.setSequence(java.io.InputStream stream), Sequencer.setSequence(Sequence sequence), Track.add(MidiEvent), MidiFileFormat
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected float divisionType
      The timing division type of the sequence.
      static float PPQ
      The tempo-based timing type, for which the resolution is expressed in pulses (ticks) per quarter note.
      protected int resolution
      The timing resolution of the sequence.
      static float SMPTE_24
      The SMPTE-based timing type with 24 frames per second (resolution is expressed in ticks per frame).
      static float SMPTE_25
      The SMPTE-based timing type with 25 frames per second (resolution is expressed in ticks per frame).
      static float SMPTE_30
      The SMPTE-based timing type with 30 frames per second (resolution is expressed in ticks per frame).
      static float SMPTE_30DROP
      The SMPTE-based timing type with 29.97 frames per second (resolution is expressed in ticks per frame).
      protected Vector<Track> tracks
      The MIDI tracks in this sequence.

      Erste Seite von API Java Inhaltsverzeichnis Haut

    • Constructor Summary

      Constructors 
      Constructor and Description
      Sequence(float divisionType, int resolution)
      Constructs a new MIDI sequence with the specified timing division type and timing resolution.
      Sequence(float divisionType, int resolution, int numTracks)
      Constructs a new MIDI sequence with the specified timing division type, timing resolution, and number of tracks.

      Erste Seite von API Java Inhaltsverzeichnis Haut

    • Constructor Detail

      • Sequence

        public Sequence(float divisionType,
                int resolution)
                 throws InvalidMidiDataException
        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).
        Parameters:
        divisionType - the timing division type (PPQ or one of the SMPTE types)
        resolution - the timing resolution
        Throws:
        InvalidMidiDataException - if divisionType is not valid
        See Also:
        PPQ, SMPTE_24, SMPTE_25, SMPTE_30DROP, SMPTE_30, getDivisionType(), getResolution(), getTracks()
      • Sequence

        public Sequence(float divisionType,
                int resolution,
                int numTracks)
                 throws InvalidMidiDataException
        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).
        Parameters:
        divisionType - the timing division type (PPQ or one of the SMPTE types)
        resolution - the timing resolution
        numTracks - the initial number of tracks in the sequence.
        Throws:
        InvalidMidiDataException - if divisionType is not valid
        See Also:
        PPQ, SMPTE_24, SMPTE_25, SMPTE_30DROP, SMPTE_30, getDivisionType(), getResolution()
    • Method Detail

      • getResolution

        public int 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.
        Returns:
        the number of ticks per beat (PPQ) or per frame (SMPTE)
        See Also:
        getDivisionType(), Sequence(float, int), MidiFileFormat.getResolution()
      • createTrack

        public Track 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).
        Returns:
        the newly created track
      • deleteTrack

        public boolean deleteTrack(Track track)
        Removes the specified track from the sequence.
        Parameters:
        track - the track to remove
        Returns:
        true if the track existed in the track and was removed, otherwise false.
        See Also:
        createTrack(), getTracks()
      • getMicrosecondLength

        public long getMicrosecondLength()
        Obtains the duration of this sequence, expressed in microseconds.
        Returns:
        this sequence's duration in microseconds.
      • getTickLength

        public long getTickLength()
        Obtains the duration of this sequence, expressed in MIDI ticks.
        Returns:
        this sequence's length in ticks
        See Also:
        getMicrosecondLength()

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/sound/midi/Sequence.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut