meta

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package meta provides MIDI Meta Messages

Index

Constants

View Source
const (
	// EndOfTrack represents the end of track MIDI message. It must be written at the end of a track
	EndOfTrack = endOfTrack(true)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Copyright string

Copyright represents the MIDI copyright message

func (Copyright) Raw

func (m Copyright) Raw() []byte

Raw returns the raw MIDI data

func (Copyright) String

func (m Copyright) String() string

String returns the copyright message as a string (for debugging)

func (Copyright) Text

func (m Copyright) Text() string

Text returns the copyright text

type Cuepoint

type Cuepoint string

Cuepoint represents a MIDI cue point message

func (Cuepoint) Raw

func (m Cuepoint) Raw() []byte

Raw returns the raw MIDI bytes

func (Cuepoint) String

func (m Cuepoint) String() string

String represents the cue point MIDI message as a string (for debugging)

func (Cuepoint) Text

func (m Cuepoint) Text() string

Text returns the text of the cue point

type DevicePort

type DevicePort string

DevicePort represents a MIDI device point message

func (DevicePort) Raw

func (m DevicePort) Raw() []byte

Raw returns the raw MIDI data

func (DevicePort) String

func (m DevicePort) String() string

String represents the device point MIDI message as a string (for debugging)

func (DevicePort) Text

func (m DevicePort) Text() string

Text returns the name of the device port

type KeySignature

type KeySignature struct {
	Key     uint8
	IsMajor bool
	Num     uint8
	//	SharpsOrFlats int8
	IsFlat bool
}

KeySignature sets the key/scale of the SMF file. If you want a more comfortable way to set the key, use the key subpackage.

func (KeySignature) Note

func (m KeySignature) Note() (note string)

Note returns the note of the key signature as a string, e.g. C♯ or E♭

func (KeySignature) Raw

func (m KeySignature) Raw() []byte

Raw returns the raw MIDI data

func (KeySignature) String

func (m KeySignature) String() string

String represents the key signature message as a string (for debugging)

func (KeySignature) Text

func (m KeySignature) Text() string

Text returns a the text of the key signature

type Lyric

type Lyric string

Lyric represents a lyric MIDI message

func (Lyric) Raw

func (m Lyric) Raw() []byte

Raw returns the raw MIDI data

func (Lyric) String

func (m Lyric) String() string

String represents the lyric message as a string (for debugging)

func (Lyric) Text

func (m Lyric) Text() string

Text returns the text of the lyric

type MIDIChannel

type MIDIChannel uint8

MIDIChannel represents the deprecated MIDI channel meta message

func (MIDIChannel) Number

func (m MIDIChannel) Number() uint8

Number returns the number of the MIDI channel (starting with 0)

func (MIDIChannel) Raw

func (m MIDIChannel) Raw() []byte

Raw returns the raw bytes for the message

func (MIDIChannel) String

func (m MIDIChannel) String() string

String represents the MIDIChannel message as a string (for debugging)

type MIDIPort

type MIDIPort uint8

MIDIPort represents the deprecated MIDI port message

func (MIDIPort) Number

func (m MIDIPort) Number() uint8

Number returns the number of the port

func (MIDIPort) Raw

func (m MIDIPort) Raw() []byte

Raw returns the raw MIDI data

func (MIDIPort) String

func (m MIDIPort) String() string

String represents the MIDI port message as a string (for debugging)

type Marker

type Marker string

Marker represents a MIDI marker message

func (Marker) Raw

func (m Marker) Raw() []byte

Raw returns the raw MIDI data

func (Marker) String

func (m Marker) String() string

String represents the marker MIDI message as a string (for debugging)

func (Marker) Text

func (m Marker) Text() string

Text returns the text of the marker

type Message

type Message interface {
	String() string
	Raw() []byte
	// contains filtered or unexported methods
}

Message is a MIDI meta message

type ProgramName

type ProgramName string

ProgramName represents a MIDI program name

func (ProgramName) Raw

func (p ProgramName) Raw() []byte

Raw returns the raw bytes for the message

func (ProgramName) String

func (p ProgramName) String() string

String represents the MIDI program name message as a string (for debugging)

func (ProgramName) Text

func (p ProgramName) Text() string

Text returns the program name

type Reader

type Reader interface {
	// Read reads a single Meta Message.
	// It may just be called once per Reader. A second call returns io.EOF
	Read() (Message, error)
}

Reader reads a Meta Message

func NewReader

func NewReader(input io.Reader, typ byte) Reader

NewReader returns a reader that can read a single Meta Message Read may just be called once per Reader. A second call returns io.EOF

type SMPTEOffset

type SMPTEOffset struct {
	Hour            byte
	Minute          byte
	Second          byte
	Frame           byte
	FractionalFrame byte
}

SMPTEOffset represents a smpte offset MIDI meta message

func (SMPTEOffset) Raw

func (s SMPTEOffset) Raw() []byte

Raw returns the raw bytes for the message

func (SMPTEOffset) String

func (s SMPTEOffset) String() string

String represents the smpte offset MIDI message as a string (for debugging)

type Sequence

type Sequence string

Sequence represents a MIDI sequence message (name of a sequence)

func (Sequence) Raw

func (m Sequence) Raw() []byte

Raw returns the raw bytes for the message

func (Sequence) String

func (m Sequence) String() string

String represents the MIDI sequence message as a string (for debugging)

func (Sequence) Text

func (m Sequence) Text() string

Text returns the name of the sequence

type SequenceNumber

type SequenceNumber uint16

SequenceNumber represents the sequence number MIDI meta message

func (SequenceNumber) Number

func (s SequenceNumber) Number() uint16

Number returns the number of the sequence

func (SequenceNumber) Raw

func (s SequenceNumber) Raw() []byte

Raw returns the raw bytes for the message

func (SequenceNumber) String

func (s SequenceNumber) String() string

String represents the MIDI sequence name message as a string (for debugging)

type SequencerSpecific

type SequencerSpecific []byte

SequencerSpecific is a sequencer specific meta message

func (SequencerSpecific) Data

func (s SequencerSpecific) Data() []byte

Data returns the sequencer specific data

func (SequencerSpecific) Len

func (s SequencerSpecific) Len() int

Len returns the length of the sequencer specific data

func (SequencerSpecific) Raw

func (s SequencerSpecific) Raw() []byte

Raw returns the raw MIDI data

func (SequencerSpecific) String

func (s SequencerSpecific) String() string

String represents the sequencer spefici MIDI message as a string (for debugging)

type Tempo

type Tempo uint32

Tempo represents a MIDI tempo (change) message in BPM

func (Tempo) BPM

func (m Tempo) BPM() uint32

BPM returns the tempo in beats per minute

func (Tempo) Raw

func (m Tempo) Raw() []byte

Raw returns the raw MIDI data

func (Tempo) String

func (m Tempo) String() string

String represents the tempo message as a string (for debugging)

type Text

type Text string

Text is a MIDI text meta message

func (Text) Raw

func (m Text) Raw() []byte

Raw returns the raw bytes for the message

func (Text) String

func (m Text) String() string

String represents the MIDI text message as a string (for debugging)

func (Text) Text

func (m Text) Text() string

Text returns the text within the message

type TimeSignature

type TimeSignature struct {
	Numerator                uint8
	Denominator              uint8
	ClocksPerClick           uint8
	DemiSemiQuaverPerQuarter uint8
}

TimeSignature sets the time signature according to the SMF spec. Denominator isn't a power of 2, but a readable decimal number (uint8). If you want an easy way without having to worry about ClocksPerClick and DemiSemiQuaverPerQuarter, use the meter subpackage.

func (TimeSignature) Raw

func (m TimeSignature) Raw() []byte

Raw returns the raw MIDI data

func (TimeSignature) Signature

func (m TimeSignature) Signature() string

Signature returns the time signature in a readable way

func (TimeSignature) String

func (m TimeSignature) String() string

String represents the time signature MIDI message as a string (for debugging)

type Track

type Track string

Track represents the MIDI track message

func (Track) Raw

func (m Track) Raw() []byte

Raw returns the raw MIDI data

func (Track) String

func (m Track) String() string

String repesents the MIDI track message as a string (for debugging)

func (Track) Text

func (m Track) Text() string

Text returns the name of the track

type Undefined

type Undefined struct {
	Typ  byte
	Data []byte
}

Undefined represents an undefined meta message

func (Undefined) Raw

func (m Undefined) Raw() []byte

Raw returns the raw MIDI data

func (Undefined) String

func (m Undefined) String() string

String represents the undefined meta message as a string (for debugging)

Directories

Path Synopsis
Package key provides helper functions for key signature meta messages.
Package key provides helper functions for key signature meta messages.
Package meter provides helper functions for time signature meta messages.
Package meter provides helper functions for time signature meta messages.

Jump to

Keyboard shortcuts

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