gomcu

package module
v0.0.0-...-05cafab Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Channels = map[int]Channel{
		1: 0x10,
		2: 0x11,
		3: 0x12,
		4: 0x13,
		5: 0x14,
		6: 0x15,
		7: 0x16,
		8: 0x17,
		9: 0x18,
	}
)
View Source
var (
	IDs = map[string]Switch{}/* 117 elements not displayed */

)
View Source
var (
	Letters = map[rune]Char{
		'@':  0x00,
		'A':  0x01,
		'B':  0x02,
		'C':  0x03,
		'D':  0x04,
		'E':  0x05,
		'F':  0x06,
		'G':  0x07,
		'H':  0x08,
		'I':  0x09,
		'J':  0x0A,
		'K':  0x0B,
		'L':  0x0C,
		'M':  0x0D,
		'N':  0x0E,
		'O':  0x0F,
		'P':  0x10,
		'Q':  0x11,
		'R':  0x12,
		'S':  0x13,
		'T':  0x14,
		'U':  0x15,
		'V':  0x16,
		'W':  0x17,
		'X':  0x18,
		'Y':  0x19,
		'Z':  0x1A,
		'[':  0x1B,
		'\\': 0x1C,
		']':  0x1D,
		'^':  0x1E,
		'_':  0x1F,
		' ':  0x20,
		'!':  0x21,
		'"':  0x22,
		'#':  0x23,
		'$':  0x24,
		'%':  0x25,
		'&':  0x26,
		'\'': 0x27,
		'(':  0x28,
		')':  0x29,
		'*':  0x2A,
		'+':  0x2B,
		',':  0x2C,
		'-':  0x2D,
		'.':  0x2E,
		'/':  0x2F,
		'0':  0x30,
		'1':  0x31,
		'2':  0x32,
		'3':  0x33,
		'4':  0x34,
		'5':  0x35,
		'6':  0x36,
		'7':  0x37,
		'8':  0x38,
		'9':  0x39,
		':':  0x3A,
		';':  0x3B,
		'<':  0x3C,
		'=':  0x3D,
		'>':  0x3E,
		'?':  0x3F,
	}
)
View Source
var (
	SysExMessages = map[string][]byte{
		"Query":       []byte{0x00},
		"GoOffline":   []byte{0x0F, 0x7F},
		"Version":     []byte{0x13, 0x00},
		"ResetFaders": []byte{0x61},
		"ResetLEDs":   []byte{0x62},
		"Reset":       []byte{0x63},
	}
)

Functions

func Reset

func Reset(wd *writer.Writer)

Reset resets and quickly triggers all the available features on the control surface. I recommend running this both to avoid some errors and as a sanity check to make sure that your entire control surface is working.

func SetDigit

func SetDigit(digit Digit, char Char) midi.Message

SetDigit sets an individual digit on the timecode or Assignment section. Refer to Char for more information on valid characters.

func SetFaderPos

func SetFaderPos(fader Channel, pos uint16) midi.Message

SetFaderPos sets the position of the chosen fader to a number between 0 (bottom) and 16382 (top).

func SetLCD

func SetLCD(offset uint8, text string) midi.Message

SetLCD sets the text (an ASCII string) found on the LCD starting from the specified offset.

func SetLED

func SetLED(led Switch, state State) midi.Message

SetLED sets the chosen button's LED to the chosen State.

func SetMeter

func SetMeter(ch Channel, value MeterLevel) midi.Message

SetMeter sets the level meter for the selected Channel to the desired value.

func SetTimeDisplay

func SetTimeDisplay(letters string) (m []midi.Message)

SetTimeDisplay sets multiple characters on the timecode display. Note: letters is limited to ten characters and is right aligned. Refer to timecode.Digit for valid characters.

func SetVPot

func SetVPot(ch Channel, mode VPotMode, led VPotLED) midi.Message

SetVPot sets the LEDs around the knobs (VPots). Refer to VPotMode for an explanation of the various VPot modes.

Types

type Channel

type Channel byte

A Channel is used to define which Fader, Meter or VPot should be modified.

const (
	Channel1 Channel = iota
	Channel2
	Channel3
	Channel4
	Channel5
	Channel6
	Channel7
	Channel8
	// Master is only a fader and will do nothing if used to set a VPot or a Meter.
	Master

	LenChannels = 9

	FaderMax = 16382
	FaderMin = 0
)

type Char

type Char byte

Char is an ASCII character between 0x21 (33) and 0x60 (96). Note: if the character is above 0x40 (64) subtract 0x40 from it, otherwise the wrong character will be displayed.

const (
	SymbolAt Char = iota
	CharA
	CharB
	CharC
	CharD
	CharE
	CharF
	CharG
	CharH
	CharI
	CharJ
	CharK
	CharL
	CharM
	CharN
	CharO
	CharP
	CharQ
	CharR
	CharS
	CharT
	CharU
	CharV
	CharW
	CharX
	CharY
	CharZ
	SymbolOpenBracket
	SymbolBackSlash
	SymbolCloseBracket
	SymbolAccent
	SymbolUnderscore
	SymbolSpace
	SymbolExclamation
	SymbolDoubleQuote
	SymbolNumberSign
	SymbolDollar
	SymbolPercentSign
	SymbolAmpersand
	SymbolSingleQuote
	SymbolOpenParen
	SymbolCloseParen
	SymbolAsterisk
	SymbolPlus
	SymbolComma
	SymbolHyphen
	SymbolPeriod
	SymbolForwardSlash
	Char0
	Char1
	Char2
	Char3
	Char4
	Char5
	Char6
	Char7
	Char8
	Char9
	SymbolColon
	SymbolSemiColon
	SymbolLessThan
	SymbolEqual
	SymbolGreaterThan
	SymbolQuestion
	// Add DigitDot to the character you want to display to show the dot found on each 7-segment display.
	DigitDot
)

type Digit

type Digit byte

A Digit is a single 7-segment display on the Control Surface

const (
	Thousandth Digit = iota + 0x40
	Hundredth
	Tenth
	Second
	TenSecond
	Minute
	TenMinute
	Hour
	TenHour
	HundredHour

	AssignRight
	AssignLeft

	LenDigits = 12
)

type Line

type Line byte
const (
	Line1    Line = 0
	Line2    Line = 56
	LenLines      = 112
)

type MeterLevel

type MeterLevel byte

MeterLevel is the height (in decibels) that the meter should be set to.

const (
	LessThan60 MeterLevel = iota
	MoreThan60
	MoreThan50
	MoreThan40
	MoreThan30
	MoreThan20
	MoreThan14
	MoreThan10
	MoreThan8
	MoreThan6
	MoreThan4
	MoreThan2
	MoreThan0

	// Clipping enables the clipping warning LED on the meter.
	Clipping
	// ClipOff disables the clipping warning LED on the meter.
	ClipOff

	LenMeterLevel = 15
)

type State

type State byte
const (
	StateOff      State = 0x00
	StateBlinking State = 0x01
	StateOn       State = 0x7F
)

type Switch

type Switch byte

A Switch is a button and/or LED that can be pressed and or lit.

const (
	Rec1 Switch = iota
	Rec2
	Rec3
	Rec4
	Rec5
	Rec6
	Rec7
	Rec8
	Solo1
	Solo2
	Solo3
	Solo4
	Solo5
	Solo6
	Solo7
	Solo8
	Mute1
	Mute2
	Mute3
	Mute4
	Mute5
	Mute6
	Mute7
	Mute8
	Select1
	Select2
	Select3
	Select4
	Select5
	Select6
	Select7
	Select8
	V1
	V2
	V3
	V4
	V5
	V6
	V7
	V8
	AssignTrack
	AssignSend
	AssignPan
	AssignPlugin
	AssignEQ
	AssignInstrument
	BankL
	BankR
	ChannelL
	ChannelR
	Flip
	GlobalView
	NameValue
	SMPTEBeats
	F1
	F2
	F3
	F4
	F5
	F6
	F7
	F8
	MIDITracks
	Inputs
	AudioTracks
	AudioInstrument
	Aux
	Busses
	Outputs
	User
	Shift
	Option
	Control
	CMDAlt
	Read
	Write
	Trim
	Touch
	Latch
	Group
	Save
	Undo
	Cancel
	Enter
	Marker
	Nudge
	Cycle
	Drop
	Replace
	Click
	Solo
	Rewind
	FastFwd
	Stop
	Play
	Record
	Up
	Down
	Left
	Right
	Zoom
	Scrub
	UserA
	UserB
	Fader1
	Fader2
	Fader3
	Fader4
	Fader5
	Fader6
	Fader7
	Fader8
	FaderMaster
	STMPELED
	BeatsLED
	RudeSoloLED
	RelayClickLED

	LenIDs = 120
)

type VPotLED

type VPotLED byte
const (
	VPot0 VPotLED = iota
	VPot1
	VPot2
	VPot3
	VPot4
	VPot5
	VPot6
	VPot7
	VPot8
	VPot9
	VPot10
	VPot11

	LenVPots = 12

	// VPotDot is the bottom LED separate from the other 11.
	VPotDot VPotLED = 0x40
)

type VPotMode

type VPotMode byte

VPot Mode is the display mode that should be used when setting the amount of VPot LEDs to display.

const (
	VPotMode0 VPotMode = 0x00
	VPotMode1 VPotMode = 0x10
	VPotMode2 VPotMode = 0x20
	VPotMode3 VPotMode = 0x30
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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