MidiFile

Inherits: Resource < Reference < Object

MIDI data file.

Description

This is a resource which stores MIDI data used by MidiPlayer. At load time, format will be set accordingly.

To load data into the MidiPlayer simply load a MidiFile with FORMAT_MIDI into MidiPlayer.midi or a MidiFile with FORMAT_SF2 into MidiPlayer.soundfont.

Note: It is not recommended that you set byte data directly or change the format. These methods are more useful when loading MIDI data from a File and you need to set byte data and format manually.

Properties

PoolByteArray data PoolByteArray(  )
Format format 0

Methods

Error load ( String file_path )

Enumerations

enum Format:

  • FORMAT_MIDI = 0 — MIDI song data.
  • FORMAT_SF2 = 1 — SoundFont data.

Property Descriptions

Default PoolByteArray(  )
Setter set_data(value)
Getter get_data()

A stream of bytes which represents MIDI data. This data is not meant to be modified, as MIDI files are imported automatically.


  • Format format
Default 0
Setter set_format(value)
Getter get_format()

Represents the internal format of the MidiFile data. This is set automatically at import time.

Method Descriptions

Load MIDI data from a file anywhere on the filesystem. It must be the correct format.