Versions in this module Expand all Collapse all v1 v1.0.0 Apr 17, 2019 Changes in this version + const Asyncronous + const Dur16th + const Dur16thT + const Dur8th + const Dur8thT + const MetricalTF + const SingleTrack + const Syncronous + const TimeCodeTF + var CCNames = map[uint8]string + var CCVals = map[string]int + var ErrFmtNotSupported = errors.New("format not supported") + var ErrUnexpectedData = errors.New("unexpected data content") + var EventByteMap = map[string]byte + var EventMap = map[byte]string + var MetaByteMap = map[string]byte + var MetaCmdMap = map[byte]string + var Notes = []string + var NotesToInt = map[string]int + func DecodeVarint(buf []byte) (x uint32, n int) + func EncodeVarint(x uint32) []byte + func FreqToNote(freq float64) int + func KeyFreq(n string, octave int) float64 + func KeyInt(n string, octave int) int + func NoteOctave(note int) int + func NoteToFreq(note int) float64 + func NoteToName(note int) string + func Uint24(n uint32) []byte + type AbsEv struct + Duration int + MIDINote int + Start int + Vel int + func (ev *AbsEv) End() int + type AbsEvents []*AbsEv + func (evs AbsEvents) Copy() AbsEvents + func (evs AbsEvents) ToMIDITrack(e *Encoder) *Track + type ControlChangeEvent struct + Channel int + ID int + Name string + Value int + type Decoder struct + Ch chan *Track + Debug bool + Format uint16 + NumTracks uint16 + TicksPerQuarterNote uint16 + TimeFormat timeFormat + Tracks []*Track + func NewDecoder(r io.Reader) *Decoder + func NewParser(r io.Reader, ch chan *Track) *Decoder + func (d *Decoder) CurrentTrack() *Track + func (d *Decoder) Decode() error + func (d *Decoder) IDnSize() ([4]byte, uint32, error) + func (d *Decoder) Parse() error + func (d *Decoder) Read(dst interface{}) error + func (d *Decoder) ReadByte() (byte, error) + func (d *Decoder) Uint24() (uint32, error) + func (d *Decoder) Uint7() (uint8, error) + func (d *Decoder) VarLen() (val uint32, readBytes uint32, err error) + func (d *Decoder) VarLenTxt() (string, uint32, error) + type Encoder struct + Format uint16 + NumTracks uint16 + TicksPerQuarterNote uint16 + TimeFormat timeFormat + Tracks []*Track + func NewEncoder(w io.WriteSeeker, format uint16, ppqn uint16) *Encoder + func (e *Encoder) NewTrack() *Track + func (e *Encoder) Write() error + type Event struct + AbsPitchBend uint16 + AbsTicks uint64 + Bpm uint32 + Channel uint8 + Cmd uint8 + Controller uint8 + Copyright string + CuePoint string + InstrumentName string + Key int32 + Lyric string + Marker string + MsPerQuartNote uint32 + MsgChan uint8 + MsgType uint8 + NewProgram uint8 + NewValue uint8 + Note uint8 + Pressure uint8 + RelPitchBend int16 + Scale uint32 + SeqNum uint16 + SeqTrackName string + SmpteOffset *SmpteOffset + Text string + TimeDelta uint32 + TimeSignature *TimeSignature + Velocity uint8 + func Aftertouch(channel, key, vel int) *Event + func ChannelAfterTouch(channel, vel int) *Event + func ControlChange(channel, controller, newVal int) *Event + func CopyrightEvent(txt string) *Event + func EndOfTrack() *Event + func Meta(channel int) *Event + func NoteOff(channel, key int) *Event + func NoteOn(channel, key, vel int) *Event + func PitchWheelChange(channel, int, val int) *Event + func ProgramChange(channel, controller, newVal int) *Event + func TempoEvent(bpmF float64) *Event + func TrackName(name string) *Event + func (e *Event) Copy() *Event + func (e *Event) Encode() []byte + func (e *Event) Position(ppq uint16) Position + func (e *Event) Size() uint32 + func (e *Event) String() string + type Note struct + Channel int + Key int + Velocity int + type Position struct + Bar uint64 + Beat uint32 + Div uint32 + Ticks uint32 + func TickPosition(tick uint64, ppq uint16) Position + func (p Position) String() string + func (p Position) ToTicks(ppq uint16) uint64 + type SmpteOffset struct + Fr uint8 + Hour uint8 + Min uint8 + Sec uint8 + SubFr uint8 + type TimeSignature struct + ClocksPerTick uint8 + Denominator uint8 + Numerator uint8 + ThirtySecondNotesPerQuarter uint8 + func (ts *TimeSignature) Denum() int + func (ts *TimeSignature) String() string + type Track struct + Events []*Event + Size uint32 + func (t *Track) AbsoluteEvents() AbsEvents + func (t *Track) Add(beatDelta float64, e *Event) + func (t *Track) AddAfterDelta(ticks uint32, e *Event) + func (t *Track) ChunkData(endTrack bool) ([]byte, error) + func (t *Track) Name() string + func (t *Track) SetName(name string) *Track + func (t *Track) Tempo() int