Documentation
¶
Index ¶
- Variables
- func ClearBitU8(n uint8, pos uint8) uint8
- func IsChannelMessage(b uint8) bool
- func IsStatusByte(b uint8) bool
- func KeyFromSharpsOrFlats(sharpsOrFlats int8, mode uint8) uint8
- func MsbLsbSigned(n int16) uint16
- func MsbLsbUnsigned(n uint16) uint16
- func ParsePitchWheelVals(b1 byte, b2 byte) (relative int16, absolute uint16)
- func ParseStatus(b byte) (messageType uint8, messageChannel uint8)
- func ParseTwoUint7(b1, b2 byte) (uint8, uint8)
- func ParseUint16(b1, b2 byte) uint16
- func ParseUint7(b byte) uint8
- func ReadByte(rd io.Reader) (byte, error)
- func ReadNBytes(n int, rd io.Reader) ([]byte, error)
- func ReadText(rd io.Reader) (string, error)
- func ReadUint16(rd io.Reader) (uint16, error)
- func ReadUint24(rd io.Reader) (uint32, error)
- func ReadUint32(rd io.Reader) (uint32, error)
- func ReadVarLength(reader io.Reader) (uint32, error)
- func ReadVarLengthData(reader io.Reader) ([]byte, error)
- func VlqDecode(source []byte) (num uint32)
- func VlqEncode(n uint32) (out []byte)
Constants ¶
This section is empty.
Variables ¶
var ErrUnexpectedEOF = fmt.Errorf("Unexpected End of File found.")
ErrUnexpectedEOF is returned, when an unexspected end of file is reached.
Functions ¶
func ClearBitU8 ¶
ClearBitU8 clears the bit at position pos within n
func IsChannelMessage ¶
IsChannelMessage returns if the given byte is a channel message
func IsStatusByte ¶
IsStatusByte returns if the given byte is a status byte
func KeyFromSharpsOrFlats ¶
KeyFromSharpsOrFlats Taking a signed number of sharps or flats (positive for sharps, negative for flats) and a mode (0 for major, 1 for minor) decide the key signature.
This is a slightly modified variant of the keySignatureFromSharpsOrFlats function from Joe Wass. See the file music.go for the original.
func MsbLsbSigned ¶
MsbLsbSigned returns the uint16 for a signed MSB LSB message combination
func MsbLsbUnsigned ¶
takes a 14bit uint and pads it to 16 bit like in the specs for e.g. pitchbend
func ParsePitchWheelVals ¶
func ParseStatus ¶
ParseStatus parses the status byte and returns type and channel
This is a slightly modified variant of the readStatusByte function from Joe Wass. See the file midi_functions.go for the original.
func ParseTwoUint7 ¶
func ParseUint16 ¶
ParseUint16 converts 2 bytes to a 16 bit integer This is a slightly modified variant of the parseUint16 function from Joe Wass. See the file midi_functions.go for the original.
func ParseUint7 ¶
func ReadNBytes ¶
ReadNBytes reads n bytes from the reader
func ReadUint16 ¶
ReadUint16 reads a 2-byte 16 bit integer from a Reader. It returns the 16-bit value and an error. This is a slightly modified variant of the parseUint16 function from Joe Wass. See the file midi_functions.go for the original.
func ReadUint24 ¶
ReadUint24 parse a 3-byte 24 bit integer from a Reader. It returns the 32-bit value and an error. This is a slightly modified variant of the parseUint24 function from Joe Wass. See the file midi_functions.go for the original.
func ReadUint32 ¶
ReadUint32 parse a 4-byte 32 bit integer from a Reader. It returns the 32-bit value and an error. This is a slightly modified variant of the parseUint32 function from Joe Wass. See the file midi_functions.go for the original.
func ReadVarLength ¶
ReadVarLength reads a variable length value from a Reader. It returns the [up to] 32-bit value and an error. This is a slightly modified variant of the parseVarLength function from Joe Wass. See the file midi_functions.go for the original.
func ReadVarLengthData ¶
ReadVarLengthData reads data that is prefixed by a varLength that tells the length of the data
This is a slightly modified variant of the parseText function from Joe Wass. See the file midi_functions.go for the original.
Types ¶
This section is empty.