xmi

package
v0.0.0-...-f01e09b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MidiMessageNoteOnValue           = 0b1001
	MidiMessageControlChangeValue    = 0b1011
	MidiMessageProgramChangeValue    = 0b1100
	MidiMessageChannelPressureValue  = 0b1101 // after touch
	MidiMessagePitchWheelChangeValue = 0b1110
)
View Source
const (
	MidiMetaEvent uint8 = 0xff
)

Variables

This section is empty.

Functions

func ConvertToMidi

func ConvertToMidi(data io.Reader) (*smf.SMF, error)

func ReadMidi

func ReadMidi(file *lbx.LbxFile, index int) (*smf.SMF, error)

func ReadMidiFromCache

func ReadMidiFromCache(cache *lbx.LbxCache, name string, index int) (*smf.SMF, error)

Types

type IFFChunk

type IFFChunk struct {
	ID   []byte
	Data []byte
}

func (*IFFChunk) GetFormType

func (chunk *IFFChunk) GetFormType() string

func (*IFFChunk) GetInfoSequence

func (chunk *IFFChunk) GetInfoSequence() int

func (*IFFChunk) IsCat

func (chunk *IFFChunk) IsCat() bool

func (*IFFChunk) IsEvent

func (chunk *IFFChunk) IsEvent() bool

func (*IFFChunk) IsForm

func (chunk *IFFChunk) IsForm() bool

func (*IFFChunk) IsInfo

func (chunk *IFFChunk) IsInfo() bool

func (*IFFChunk) IsTimbre

func (chunk *IFFChunk) IsTimbre() bool

func (*IFFChunk) Name

func (chunk *IFFChunk) Name() string

func (*IFFChunk) RawData

func (chunk *IFFChunk) RawData() []byte

func (*IFFChunk) ReadEvent

func (chunk *IFFChunk) ReadEvent() (MidiEvent, error)

func (*IFFChunk) ReadTimbre

func (chunk *IFFChunk) ReadTimbre() (IFFTimbre, error)

func (*IFFChunk) Size

func (chunk *IFFChunk) Size() int

func (*IFFChunk) SubChunk

func (chunk *IFFChunk) SubChunk() IFFChunk

func (*IFFChunk) SubChunkReader

func (chunk *IFFChunk) SubChunkReader() *IFFReader

type IFFEvent

type IFFEvent struct {
}

type IFFReader

type IFFReader struct {
	// contains filtered or unexported fields
}

func NewIFFReader

func NewIFFReader(reader io.Reader) *IFFReader

func (*IFFReader) HasMore

func (reader *IFFReader) HasMore() bool

func (*IFFReader) ReadChunk

func (reader *IFFReader) ReadChunk() (IFFChunk, error)

type IFFTimbre

type IFFTimbre struct {
	Entries []IFFTimbreEntry
}

type IFFTimbreEntry

type IFFTimbreEntry struct {
	Patch uint8
	Bank  uint8
}

type MidiEvent

type MidiEvent struct {
	Messages []MidiMessage
}

func (*MidiEvent) ConvertToSMF

func (event *MidiEvent) ConvertToSMF() *smf.SMF

convert from an XMI midi event to a standard midi event by keeping track of note on durations

type MidiMessage

type MidiMessage interface {
}

midi message events that XMI supports. Notably there is no note off

type MidiMessageChannelPrefix

type MidiMessageChannelPrefix struct {
	Channel uint8
}

type MidiMessageChannelPressure

type MidiMessageChannelPressure struct {
	Channel  uint8
	Pressure uint8
}

type MidiMessageControlChange

type MidiMessageControlChange struct {
	Channel    uint8
	Controller uint8
	Value      uint8
}

type MidiMessageDelay

type MidiMessageDelay struct {
	Delay int64
}

type MidiMessageEndOfTrack

type MidiMessageEndOfTrack struct {
}

type MidiMessageKeySignature

type MidiMessageKeySignature struct {
	Flats int8
	Major uint8
}

type MidiMessageNoteOn

type MidiMessageNoteOn struct {
	Channel  uint8
	Note     uint8
	Velocity uint8
	Duration int64
}

type MidiMessagePitchWheelChange

type MidiMessagePitchWheelChange struct {
	Channel uint8
	Value   int16
}

type MidiMessagePortPrefix

type MidiMessagePortPrefix struct {
	Port uint8
}

type MidiMessageProgramChange

type MidiMessageProgramChange struct {
	Channel uint8
	Program uint8
}

type MidiMessageSMPTEOffset

type MidiMessageSMPTEOffset struct {
	Fps      float32
	Hour     uint8
	Minute   uint8
	Second   uint8
	Frame    uint8
	SubFrame uint8
}

type MidiMessageTempoSetting

type MidiMessageTempoSetting struct {
	Tempo float64
}

type MidiMessageTimeSignature

type MidiMessageTimeSignature struct {
	Numerator                uint8
	Denominator              uint8
	Metronome                uint8
	DemiSemiQuaverPerQuarter uint8
}

type MidiMessageValue

type MidiMessageValue uint8

type MidiMetaEventKind

type MidiMetaEventKind uint8

https://www.ccarh.org/courses/253/handout/smf/

const (
	MidiEventSequenceNumber    MidiMetaEventKind = 0x00
	MidiEventTextEvent         MidiMetaEventKind = 0x01
	MidiEventCopyrightNotice   MidiMetaEventKind = 0x02
	MidiEventSequenceTrackName MidiMetaEventKind = 0x03
	MidiEventInstrumentName    MidiMetaEventKind = 0x04
	MidiEventLyric             MidiMetaEventKind = 0x05
	MidiEventMarker            MidiMetaEventKind = 0x06
	MidiEventCuePoint          MidiMetaEventKind = 0x07

	MidiEventChannelPrefix MidiMetaEventKind = 0x20
	MidiEventPortPrefix    MidiMetaEventKind = 0x21
	MidiEventEndOfTrack    MidiMetaEventKind = 0x2f
	MidiEventTempoSetting  MidiMetaEventKind = 0x51
	MidiEventSMPTEOffset   MidiMetaEventKind = 0x54
	MidiEventTimeSignature MidiMetaEventKind = 0x58
	MidiEventKeySignature  MidiMetaEventKind = 0x59
)

type NoteOffDuration

type NoteOffDuration struct {
	Channel  uint8
	Note     uint8
	Duration int64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL