struct Haematite::Message

Overview

Represents a single message within a MIDI file.

Defined in:

haematite/message.cr

Constructors

Instance Method Summary

Constructor Detail

def self.common(status : UInt8, data1 : UInt8, data2 : UInt8, loopType : MidiFileLoopType) : Message #

Creates a normal MIDI message.


def self.common(status : UInt8, data1 : UInt8) : Message #

Creates a normal MIDI message.


def self.endOfTrack : Message #

Creates an "end of track" message.


def self.loopEnd : Message #

Creates a loop end point message.


def self.loopStart : Message #

Creates a loop start point message.


def self.new(channel : UInt8, command : UInt8, data1 : UInt8, data2 : UInt8) #

def self.tempoChange(tempo : Int) : Message #

Creates a tempo change message.


Instance Method Detail

def channel : UInt8 #

The channel this message's data is intended for.


def command : UInt8 #

The command this message represents.


def data1 : UInt8 #

Data byte 1 of the message.


def data2 : UInt8 #

Data byte 2 of the message.


def tempo : Float64 #

Returns the tempo this message represents.


def to_s(io : IO) #
Description copied from struct Struct

Same as #inspect(io).


def type : MessageType #

Returns the type for this message.