midi

package module
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 1 Imported by: 0

README

midi

Moved to gitlab: see https://gitlab.com/gomidi/midi and all the other projects at https://gitlab.com/gomidi .

Development has moved to GitLab https://gitlab.com/gomidi. It is recommended to use the code there instead, as the repos at Gitlab contains newer fixes, and some import references contained in the github repo may be broken.

Documentation

Overview

Package midi provides interfaces for reading and writing of MIDI messages.

Since they are handled slightly different, this packages introduces the terminology of "live" MIDI reading/writing for dealing with MIDI messages as "over the wire" (in realtime) as opposed to smf MIDI reading/writing to Standard MIDI Files (SMF).

However both variants can be used with io.Writer and io.Reader and can thus be "streamed".

This package provides a Reader and Writer interface that is common to live and SMF MIDI handling. This should allow to easily develop transformations (e.g. quantization, filtering) that may be used in both cases.

If you want a comfortable common package providing everything at a high level, use the porcelain package

github.com/gomidi/mid

The underlying core implementations can be found here:

github.com/gomidi/midi/midireader (live reading)
github.com/gomidi/midi/midiwriter (live writing)
github.com/gomidi/midi/smf/smfreader   (SMF reading)
github.com/gomidi/midi/smf/smfwriter   (SMF writing)
github.com/gomidi/midi/smf/smftrack    (SMF modification)

The core of the MIDI messages that can be written or analyzed can be found here:

github.com/gomidi/midi/midimessage/channel    (Channel Messages)
github.com/gomidi/midi/midimessage/meta       (Meta Messages)
github.com/gomidi/midi/midimessage/realtime   (System Realtime Messages)
github.com/gomidi/midi/midimessage/syscommon  (System Common messages)
github.com/gomidi/midi/midimessage/sysex      (System Exclusive messages)

Please keep in mind that that not all kinds of MIDI messages can be used in both scenarios.

System Realtime and System Common Messages are restricted to "over the wire", while Meta Messages are restricted to SMF files. However System Realtime and System Common Messages can be saved inside a SMF file which the help of SysEx escaping (F7).

Index

Constants

This section is empty.

Variables

View Source
var ErrUnexpectedEOF = errors.New("Unexpected End of File found.")

ErrUnexpectedEOF is returned, when an unexspected end of file is reached.

Functions

This section is empty.

Types

type Message

type Message interface {
	// String inspects the MIDI message in an informative way
	String() string

	// Raw returns the raw bytes of the MIDI message
	Raw() []byte
}

Message is a MIDI message

type ReadCloser

type ReadCloser interface {
	Reader
	Close() error
}

ReadCloser is a Reader that must be closed at the end of reading.

type Reader

type Reader interface {
	// Read reads a MIDI message
	Read() (Message, error)
}

Reader reads MIDI messages

type WriteCloser

type WriteCloser interface {
	Writer
	Close() error
}

WriteCloser is a Writer that must be closed at the end of writing.

type Writer

type Writer interface {
	// Write writes the given MIDI message and returns any error
	Write(Message) error
}

Writer writes MIDI messages

Directories

Path Synopsis
internal
vlq
Package midiio provides helpers for connecting io.Readers and io.Writers to midi.Readers and midi.Writers.
Package midiio provides helpers for connecting io.Readers and io.Writers to midi.Readers and midi.Writers.
Package midimessage provides helper functions for MIDI messages.
Package midimessage provides helper functions for MIDI messages.
channel
Package channel provides MIDI Channel Messages
Package channel provides MIDI Channel Messages
meta
Package meta provides MIDI Meta Messages
Package meta provides MIDI Meta Messages
meta/key
Package key provides helper functions for key signature meta messages.
Package key provides helper functions for key signature meta messages.
meta/meter
Package meter provides helper functions for time signature meta messages.
Package meter provides helper functions for time signature meta messages.
realtime
Package realtime provides MIDI System Realtime Messages
Package realtime provides MIDI System Realtime Messages
syscommon
Package syscommon provides MIDI System Common Messages
Package syscommon provides MIDI System Common Messages
sysex
Package sysex provides MIDI System Exclusive Messages
Package sysex provides MIDI System Exclusive Messages
Package midireader provides a reader for live/streaming/"over the wire" MIDI data.
Package midireader provides a reader for live/streaming/"over the wire" MIDI data.
Package midiwriter provides a writer for live/streaming/"over the wire" MIDI data.
Package midiwriter provides a writer for live/streaming/"over the wire" MIDI data.
smf
Package smf provides constants and interfaces for reading and writing of Standard MIDI Files (SMF).
Package smf provides constants and interfaces for reading and writing of Standard MIDI Files (SMF).
smfreader
Package smfreader provides a reader of Standard MIDI Files (SMF).
Package smfreader provides a reader of Standard MIDI Files (SMF).
smfwriter
Package smfwriter provides a writer of Standard MIDI Files (SMF).
Package smfwriter provides a writer of Standard MIDI Files (SMF).

Jump to

Keyboard shortcuts

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