class Haematite::MidiFile
- Haematite::MidiFile
- Haematite::SequencedFile
- Reference
- Object
Overview
Represents a Standard MIDI File.
Defined in:
haematite/midifile.crConstructors
-
.new(filename : String | Path, *, loopPoint : Int32 = 0, headerAlreadyRead : Bool = false)
Creates a new
MidiFileinstance by loading a MIDI file from the given filename. -
.new(stream : IO, *, headerAlreadyRead : Bool = false)
Creates a new
MidiFileinstance by loading a MIDI file from the given stream. -
.new(stream : IO, *, loopType : MidiFileLoopType, headerAlreadyRead : Bool = false)
Creates a new
MidiFileinstance by loading a MIDI file from the given stream.
Class Method Summary
-
.validMidiFile(io : IO) : Bool
Attempts to determine if the data in
iois valid MIDI data.
Instance Method Summary
-
#resolution : Int16
The timing resolution.
-
#trackCount : Int16
The number of tracks in the sequence.
Instance methods inherited from class Haematite::SequencedFile
length : Int64
length,
messages : Array(Message)
messages,
times : Array(Int64)
times
Constructor methods inherited from class Haematite::SequencedFile
load(path : String | Path) : SequencedFile
load
Constructor Detail
Creates a new MidiFile instance by loading a MIDI file from the given
filename. A loopPoint greater than zero specifies the point in the MIDI
file at which it should loop (otherwise it's assumed to loop at the end).
Creates a new MidiFile instance by loading a MIDI file from the given
stream. loopType specifies how any loop point messages are interpreted.
Class Method Detail
Attempts to determine if the data in io is valid MIDI data.
If it is, this returns true, otherwise it returns false.
If this is true, then the header in the io has already been
read, and you should pass headerAlreadyRead: true when calling
one of the constructors.