midi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MThd

type MThd struct {
	Tag           string
	Length        uint32
	Format        uint16
	Tracks        uint16
	Division      uint16
	PPQN          uint16  // TODO make getter/TextUnmarshal
	SMPTETimeCode bool    // TODO make getter/TextUnmarshal
	SubFrames     uint16  // TODO make getter/TextUnmarshal
	FPS           uint8   // TODO make getter/TextUnmarshal
	DropFrame     bool    // TODO make getter/TextUnmarshal
	Bytes         lib.Hex `json:"-"` // TODO make getter/TextUnmarshal
}

func MakeMThd added in v0.2.0

func MakeMThd(format uint16, tracks uint16, division uint16, bytes ...byte) MThd

func (MThd) MarshalBinary added in v0.2.0

func (mthd MThd) MarshalBinary() (encoded []byte, err error)

type MTrk

type MTrk struct {
	Tag         string           `json:"tag"`
	TrackNumber lib.TrackNumber  `json:"track-number"`
	Length      uint32           `json:"-"`
	Bytes       lib.Hex          `json:"-"`
	Events      []*events.Event  `json:"events"`
	Context     *context.Context `json:"-"`
}

func NewMTrk added in v0.2.0

func NewMTrk() (*MTrk, error)

func (*MTrk) UnmarshalBinary

func (chunk *MTrk) UnmarshalBinary(data []byte) error

type SMF

type SMF struct {
	MThd   *MThd   `json:"header"`
	Tracks []*MTrk `json:"tracks"`
}

func (*SMF) Validate

func (smf *SMF) Validate() []ValidationError

type ValidationError

type ValidationError error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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