Documentation ¶
Index ¶
- 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 ParseUint7(b byte) uint8
- func ReadByte(rd io.Reader) (byte, error)
- func ReadNBytes(n int, rd io.Reader) ([]byte, 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ¶ added in v1.7.5
takes a 14bit uint and pads it to 16 bit like in the specs for e.g. pitchbend
func ParsePitchWheelVals ¶
ParsePitchWheelVals parses a 14-bit signed value, which becomes a signed int16.
This is a slightly modified variant of the parsePitchWheelValue function from Joe Wass. See the file midi_functions.go for the original.
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 ¶
ParseTwoUint7 parses two 7-bit bit integer stored in two bytes, ignoring the high bit in each.
This is a slightly modified variant of the parseTwoUint7 function from Joe Wass. See the file midi_functions.go for the original.
func ParseUint7 ¶
ParseUint7 parses a 7-bit bit integer from a byte, ignoring the high bit.
This is a slightly modified variant of the parseUint7 function from Joe Wass. See the file midi_functions.go for the original.
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.