midi

package module
v0.0.0-...-6be5ee3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinChannel = Channel(0)
	MaxChannel = Channel(15)
)
View Source
const (
	LocalOff = Local(false)
	LocalOn  = Local(true)

	MinChannelCount = ChannelCount(0)
	MaxChannelCount = ChannelCount(16)
)
View Source
const (
	MinNote = Note(0)
	MaxNote = Note(127)

	MinVelocity     = Velocity(0)
	MaxVelocity     = Velocity(127)
	DefaultVelocity = Velocity(64)

	MinPressure = Pressure(0)
	MaxPressure = Pressure(127)

	MinSingleByteController = SingleByteController(64)
	MaxSingleByteController = SingleByteController(119)

	MinSingleByteControllerValue = SingleByteControllerValue(0)
	MaxSingleByteControllerValue = SingleByteControllerValue(127)

	MinTwoByteController = TwoByteController(0)
	MaxTwoByteController = TwoByteController(31)

	MinTwoByteControllerValue = TwoByteControllerValue(0)
	MaxTwoByteControllerValue = TwoByteControllerValue(16383)

	MinProgram = Program(0)
	MaxProgram = Program(127)

	MinPitchBend     = PitchBend(-8192)
	MaxPitchBend     = PitchBend(8191)
	DefaultPitchBend = PitchBend(0)
)

Variables

View Source
var (
	ErrInvalidLength       = errors.New("invalid length")
	ErrInvalidChannel      = errors.New("invalid channel")
	ErrInvalidChannelCount = errors.New("invalid channelCount")
	ErrInvalidController   = errors.New("invalid controller")
	ErrInvalidNote         = errors.New("invalid note")
	ErrInvalidPitchBend    = errors.New("invalid pitchBend")
	ErrInvalidPressure     = errors.New("invalid pressure")
	ErrInvalidProgram      = errors.New("invalid program")
	ErrInvalidValue        = errors.New("invalid value")
	ErrInvalidVelocity     = errors.New("invalid velocity")
)
View Source
var (
	ErrInvalidStatus = errors.New("invalid status")
	ErrInvalidData   = errors.New("invalid data")
)

Functions

This section is empty.

Types

type AllNotesOff

type AllNotesOff [3]byte

func NewAllNotesOff

func NewAllNotesOff(
	channel Channel,
) (msg AllNotesOff, err error)

func (*AllNotesOff) Channel

func (self *AllNotesOff) Channel() Channel

func (*AllNotesOff) MarshalBinary

func (self *AllNotesOff) MarshalBinary() ([]byte, error)

func (*AllNotesOff) SetChannel

func (self *AllNotesOff) SetChannel(channel Channel) bool

func (*AllNotesOff) UnmarshalBinary

func (self *AllNotesOff) UnmarshalBinary(data []byte) error

type AllSoundOff

type AllSoundOff [3]byte

func NewAllSoundOff

func NewAllSoundOff(
	channel Channel,
) (msg AllSoundOff, err error)

func (*AllSoundOff) Channel

func (self *AllSoundOff) Channel() Channel

func (*AllSoundOff) MarshalBinary

func (self *AllSoundOff) MarshalBinary() ([]byte, error)

func (*AllSoundOff) SetChannel

func (self *AllSoundOff) SetChannel(channel Channel) bool

func (*AllSoundOff) UnmarshalBinary

func (self *AllSoundOff) UnmarshalBinary(data []byte) error

type Channel

type Channel uint8

func (Channel) GoString

func (self Channel) GoString() string

func (Channel) IsValid

func (self Channel) IsValid() bool

type ChannelCount

type ChannelCount uint8

func (ChannelCount) GoString

func (self ChannelCount) GoString() string

func (ChannelCount) IsValid

func (self ChannelCount) IsValid() bool

func (ChannelCount) Truncated

func (self ChannelCount) Truncated() ChannelCount

type ChannelPressure

type ChannelPressure [2]byte

func NewChannelPressure

func NewChannelPressure(
	channel Channel,
	pressure Pressure,
) (msg ChannelPressure, err error)

func (*ChannelPressure) Channel

func (self *ChannelPressure) Channel() Channel

func (*ChannelPressure) MarshalBinary

func (self *ChannelPressure) MarshalBinary() ([]byte, error)

func (*ChannelPressure) Pressure

func (self *ChannelPressure) Pressure() Pressure

func (*ChannelPressure) SetChannel

func (self *ChannelPressure) SetChannel(channel Channel) bool

func (*ChannelPressure) SetPressure

func (self *ChannelPressure) SetPressure(pressure Pressure) bool

func (*ChannelPressure) UnmarshalBinary

func (self *ChannelPressure) UnmarshalBinary(data []byte) error

type Local

type Local bool

func (Local) GoString

func (self Local) GoString() string

func (Local) IsValid

func (self Local) IsValid() bool

type LocalControl

type LocalControl [3]byte

func NewLocalControl

func NewLocalControl(
	channel Channel,
	value Local,
) (msg LocalControl, err error)

func (*LocalControl) Channel

func (self *LocalControl) Channel() Channel

func (*LocalControl) MarshalBinary

func (self *LocalControl) MarshalBinary() ([]byte, error)

func (*LocalControl) SetChannel

func (self *LocalControl) SetChannel(channel Channel) bool

func (*LocalControl) SetValue

func (self *LocalControl) SetValue(value Local) bool

func (*LocalControl) UnmarshalBinary

func (self *LocalControl) UnmarshalBinary(data []byte) error

func (*LocalControl) Value

func (self *LocalControl) Value() Local

type MonoModeOn

type MonoModeOn [3]byte

func NewMonoModeOn

func NewMonoModeOn(
	channel Channel,
	channelCount ChannelCount,
) (msg MonoModeOn, err error)

func (*MonoModeOn) Channel

func (self *MonoModeOn) Channel() Channel

func (*MonoModeOn) ChannelCount

func (self *MonoModeOn) ChannelCount() ChannelCount

func (*MonoModeOn) MarshalBinary

func (self *MonoModeOn) MarshalBinary() ([]byte, error)

func (*MonoModeOn) SetChannel

func (self *MonoModeOn) SetChannel(channel Channel) bool

func (*MonoModeOn) SetChannelCount

func (self *MonoModeOn) SetChannelCount(channelCount ChannelCount) bool

func (*MonoModeOn) UnmarshalBinary

func (self *MonoModeOn) UnmarshalBinary(data []byte) error

type Note

type Note uint8

func (Note) GoString

func (self Note) GoString() string

func (Note) IsValid

func (self Note) IsValid() bool

type NoteOff

type NoteOff [3]byte

func NewNoteOff

func NewNoteOff(
	channel Channel,
	note Note,
	velocity Velocity,
) (msg NoteOff, err error)

func (*NoteOff) Channel

func (self *NoteOff) Channel() Channel

func (*NoteOff) MarshalBinary

func (self *NoteOff) MarshalBinary() ([]byte, error)

func (*NoteOff) Note

func (self *NoteOff) Note() Note

func (*NoteOff) SetChannel

func (self *NoteOff) SetChannel(channel Channel) bool

func (*NoteOff) SetNote

func (self *NoteOff) SetNote(note Note) bool

func (*NoteOff) SetVelocity

func (self *NoteOff) SetVelocity(velocity Velocity) bool

func (*NoteOff) UnmarshalBinary

func (self *NoteOff) UnmarshalBinary(data []byte) error

func (*NoteOff) Velocity

func (self *NoteOff) Velocity() Velocity

type NoteOn

type NoteOn [3]byte

func NewNoteOn

func NewNoteOn(
	channel Channel,
	note Note,
	velocity Velocity,
) (msg NoteOn, err error)

func (*NoteOn) Channel

func (self *NoteOn) Channel() Channel

func (*NoteOn) MarshalBinary

func (self *NoteOn) MarshalBinary() ([]byte, error)

func (*NoteOn) Note

func (self *NoteOn) Note() Note

func (*NoteOn) SetChannel

func (self *NoteOn) SetChannel(channel Channel) bool

func (*NoteOn) SetNote

func (self *NoteOn) SetNote(note Note) bool

func (*NoteOn) SetVelocity

func (self *NoteOn) SetVelocity(velocity Velocity) bool

func (*NoteOn) UnmarshalBinary

func (self *NoteOn) UnmarshalBinary(data []byte) error

func (*NoteOn) Velocity

func (self *NoteOn) Velocity() Velocity

type OmniModeOff

type OmniModeOff [3]byte

func NewOmniModeOff

func NewOmniModeOff(
	channel Channel,
) (msg OmniModeOff, err error)

func (*OmniModeOff) Channel

func (self *OmniModeOff) Channel() Channel

func (*OmniModeOff) MarshalBinary

func (self *OmniModeOff) MarshalBinary() ([]byte, error)

func (*OmniModeOff) SetChannel

func (self *OmniModeOff) SetChannel(channel Channel) bool

func (*OmniModeOff) UnmarshalBinary

func (self *OmniModeOff) UnmarshalBinary(data []byte) error

type OmniModeOn

type OmniModeOn [3]byte

func NewOmniModeOn

func NewOmniModeOn(
	channel Channel,
) (msg OmniModeOn, err error)

func (*OmniModeOn) Channel

func (self *OmniModeOn) Channel() Channel

func (*OmniModeOn) MarshalBinary

func (self *OmniModeOn) MarshalBinary() ([]byte, error)

func (*OmniModeOn) SetChannel

func (self *OmniModeOn) SetChannel(channel Channel) bool

func (*OmniModeOn) UnmarshalBinary

func (self *OmniModeOn) UnmarshalBinary(data []byte) error

type PitchBend

type PitchBend int16

func (PitchBend) GoString

func (self PitchBend) GoString() string

func (PitchBend) IsValid

func (self PitchBend) IsValid() bool

func (PitchBend) Truncated

func (self PitchBend) Truncated() PitchBend

type PitchBendChange

type PitchBendChange [3]byte

func NewPitchBendChange

func NewPitchBendChange(
	channel Channel,
	pitchBend PitchBend,
) (msg PitchBendChange, err error)

func (*PitchBendChange) Channel

func (self *PitchBendChange) Channel() Channel

func (*PitchBendChange) MarshalBinary

func (self *PitchBendChange) MarshalBinary() ([]byte, error)

func (*PitchBendChange) PitchBend

func (self *PitchBendChange) PitchBend() PitchBend

func (*PitchBendChange) SetChannel

func (self *PitchBendChange) SetChannel(channel Channel) bool

func (*PitchBendChange) SetPitchBend

func (self *PitchBendChange) SetPitchBend(pitchBend PitchBend) bool

func (*PitchBendChange) UnmarshalBinary

func (self *PitchBendChange) UnmarshalBinary(data []byte) error

type PolyModeOn

type PolyModeOn [3]byte

func NewPolyModeOn

func NewPolyModeOn(
	channel Channel,
) (msg PolyModeOn, err error)

func (*PolyModeOn) Channel

func (self *PolyModeOn) Channel() Channel

func (*PolyModeOn) MarshalBinary

func (self *PolyModeOn) MarshalBinary() ([]byte, error)

func (*PolyModeOn) SetChannel

func (self *PolyModeOn) SetChannel(channel Channel) bool

func (*PolyModeOn) UnmarshalBinary

func (self *PolyModeOn) UnmarshalBinary(data []byte) error

type PolyphonicKeyPressure

type PolyphonicKeyPressure [3]byte

func NewPolyphonicKeyPressure

func NewPolyphonicKeyPressure(
	channel Channel,
	note Note,
	pressure Pressure,
) (msg PolyphonicKeyPressure, err error)

func (*PolyphonicKeyPressure) Channel

func (self *PolyphonicKeyPressure) Channel() Channel

func (*PolyphonicKeyPressure) MarshalBinary

func (self *PolyphonicKeyPressure) MarshalBinary() ([]byte, error)

func (*PolyphonicKeyPressure) Note

func (self *PolyphonicKeyPressure) Note() Note

func (*PolyphonicKeyPressure) Pressure

func (self *PolyphonicKeyPressure) Pressure() Pressure

func (*PolyphonicKeyPressure) SetChannel

func (self *PolyphonicKeyPressure) SetChannel(channel Channel) bool

func (*PolyphonicKeyPressure) SetNote

func (self *PolyphonicKeyPressure) SetNote(note Note) bool

func (*PolyphonicKeyPressure) SetPressure

func (self *PolyphonicKeyPressure) SetPressure(pressure Pressure) bool

func (*PolyphonicKeyPressure) UnmarshalBinary

func (self *PolyphonicKeyPressure) UnmarshalBinary(data []byte) error

type Pressure

type Pressure uint8

func (Pressure) GoString

func (self Pressure) GoString() string

func (Pressure) IsValid

func (self Pressure) IsValid() bool

func (Pressure) Truncated

func (self Pressure) Truncated() Pressure

type Program

type Program uint8

func (Program) GoString

func (self Program) GoString() string

func (Program) IsValid

func (self Program) IsValid() bool

type ProgramChange

type ProgramChange [2]byte

func NewProgramChange

func NewProgramChange(
	channel Channel,
	program Program,
) (msg ProgramChange, err error)

func (*ProgramChange) Channel

func (self *ProgramChange) Channel() Channel

func (*ProgramChange) MarshalBinary

func (self *ProgramChange) MarshalBinary() ([]byte, error)

func (*ProgramChange) Program

func (self *ProgramChange) Program() Program

func (*ProgramChange) SetChannel

func (self *ProgramChange) SetChannel(channel Channel) bool

func (*ProgramChange) SetProgram

func (self *ProgramChange) SetProgram(program Program) bool

func (*ProgramChange) UnmarshalBinary

func (self *ProgramChange) UnmarshalBinary(data []byte) error

type ResetAllControllers

type ResetAllControllers [3]byte

func NewResetAllControllers

func NewResetAllControllers(
	channel Channel,
) (msg ResetAllControllers, err error)

func (*ResetAllControllers) Channel

func (self *ResetAllControllers) Channel() Channel

func (*ResetAllControllers) MarshalBinary

func (self *ResetAllControllers) MarshalBinary() ([]byte, error)

func (*ResetAllControllers) SetChannel

func (self *ResetAllControllers) SetChannel(channel Channel) bool

func (*ResetAllControllers) UnmarshalBinary

func (self *ResetAllControllers) UnmarshalBinary(data []byte) error

type SingleByteControlChange

type SingleByteControlChange [3]byte

func NewSingleByteControlChange

func NewSingleByteControlChange(
	channel Channel,
	controller SingleByteController,
	value SingleByteControllerValue,
) (msg SingleByteControlChange, err error)

func (*SingleByteControlChange) Channel

func (self *SingleByteControlChange) Channel() Channel

func (*SingleByteControlChange) Controller

func (self *SingleByteControlChange) Controller() SingleByteController

func (*SingleByteControlChange) MarshalBinary

func (self *SingleByteControlChange) MarshalBinary() ([]byte, error)

func (*SingleByteControlChange) SetChannel

func (self *SingleByteControlChange) SetChannel(channel Channel) bool

func (*SingleByteControlChange) SetController

func (self *SingleByteControlChange) SetController(controller SingleByteController) bool

func (*SingleByteControlChange) SetValue

func (*SingleByteControlChange) UnmarshalBinary

func (self *SingleByteControlChange) UnmarshalBinary(data []byte) error

func (*SingleByteControlChange) Value

type SingleByteController

type SingleByteController uint8

func (SingleByteController) GoString

func (self SingleByteController) GoString() string

func (SingleByteController) IsValid

func (self SingleByteController) IsValid() bool

type SingleByteControllerValue

type SingleByteControllerValue uint8

func (SingleByteControllerValue) GoString

func (self SingleByteControllerValue) GoString() string

func (SingleByteControllerValue) IsValid

func (self SingleByteControllerValue) IsValid() bool

func (SingleByteControllerValue) Truncated

type TwoByteControlChange

type TwoByteControlChange [6]byte

func NewTwoByteControlChange

func NewTwoByteControlChange(
	channel Channel,
	controller TwoByteController,
	value TwoByteControllerValue,
) (msg TwoByteControlChange, err error)

func (*TwoByteControlChange) Channel

func (self *TwoByteControlChange) Channel() Channel

func (*TwoByteControlChange) Controller

func (self *TwoByteControlChange) Controller() TwoByteController

func (*TwoByteControlChange) MarshalBinary

func (self *TwoByteControlChange) MarshalBinary() ([]byte, error)

func (*TwoByteControlChange) SetChannel

func (self *TwoByteControlChange) SetChannel(channel Channel) bool

func (*TwoByteControlChange) SetController

func (self *TwoByteControlChange) SetController(controller TwoByteController) bool

func (*TwoByteControlChange) SetValue

func (self *TwoByteControlChange) SetValue(value TwoByteControllerValue) bool

func (*TwoByteControlChange) UnmarshalBinary

func (self *TwoByteControlChange) UnmarshalBinary(data []byte) error

func (*TwoByteControlChange) Value

type TwoByteController

type TwoByteController uint8

func (TwoByteController) GoString

func (self TwoByteController) GoString() string

func (TwoByteController) IsValid

func (self TwoByteController) IsValid() bool

type TwoByteControllerValue

type TwoByteControllerValue uint16

func (TwoByteControllerValue) GoString

func (self TwoByteControllerValue) GoString() string

func (TwoByteControllerValue) IsValid

func (self TwoByteControllerValue) IsValid() bool

func (TwoByteControllerValue) Truncated

type Velocity

type Velocity uint8

func (Velocity) GoString

func (self Velocity) GoString() string

func (Velocity) IsValid

func (self Velocity) IsValid() bool

func (Velocity) Truncated

func (self Velocity) Truncated() Velocity

Jump to

Keyboard shortcuts

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