mcu

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbToLinear

func DbToLinear(db float64) float64

DbToLinear wandelt einen Dezibelwert in einen linearen Faktor um.

func FaderFloatToInt

func FaderFloatToInt(level float64) int16

func GetMidiInputs

func GetMidiInputs() []string

get a list of midi inputs

func GetMidiOutputs

func GetMidiOutputs() []string

get a list of midi outputs

func InitInterp

func InitInterp()

prepares the interpolation for the mackie fader to obs fader translation

func InitMcu

func InitMcu(fMcu chan interface{}, fObs chan interface{}, wg *sync.WaitGroup)

Initialize the MCU runloop

func IntToFaderFloat

func IntToFaderFloat(faderVal int16) float64

func LinearToDb

func LinearToDb(linear float64) float64

LinearToDb wandelt einen linearen Faktor in Dezibel um.

func MapToRange

func MapToRange(value, fromMin, fromMax, toMin, toMax float64) float64

func ShortenText

func ShortenText(input string) string

Types

type McuState

type McuState struct {
	// TODO: combine
	FaderLevels         []int16
	FaderLevelsBuffered []float64
	FaderTouch          []bool
	MeterLevels         []byte
	FaderTouchTimeout   []time.Time
	LedStates           map[byte]bool
	VPotLedStates       map[byte]byte
	Text                string
	Display             string
	Assign              []rune
	Debug               bool
}

McuState stores the current state of the MCU and syncs it with the hardware

func NewMcuState

func NewMcuState() *McuState

NewMcuState creates a new McuState

func (*McuState) SendLed added in v0.2.4

func (m *McuState) SendLed(num byte, state bool)

SendLed checks if the led state has changed and sends the message to the hardware if it has changed

func (*McuState) SetAssignMode added in v0.5.0

func (m *McuState) SetAssignMode(number byte)

SetAssignMode sets the assign mode and lights up the assign buttons accordingly

func (*McuState) SetAssignText

func (m *McuState) SetAssignText(text []rune)

SetAssignText sets the two letters above the assign buttons

func (*McuState) SetChannelText

func (m *McuState) SetChannelText(fader byte, text string, lower bool)

SetChannelText sets the text above the fader channel strip (LCD) the text is automatically shortened to 6 characters

func (*McuState) SetDisplayText added in v0.4.3

func (m *McuState) SetDisplayText(text string)

SetDisplayText sets the text on the display (LED)

func (*McuState) SetFaderLevel

func (m *McuState) SetFaderLevel(fader byte, level float64)

SetFaderLevel sets the fader level and sends the value to the hardware fader if it has changed

func (*McuState) SetFaderTouched

func (m *McuState) SetFaderTouched(fader byte, touched bool)

SetFaderTouched sets the fader touch state and sends the buffered value if the touch has ended

func (*McuState) SetMeter added in v0.4.2

func (m *McuState) SetMeter(fader byte, value float64)

SetMeter sets the meter level for a fader, it is sent directly

func (*McuState) SetMonitorState

func (m *McuState) SetMonitorState(fader byte, state string)

SetMonitorState sets the monitor state for a fader (rec+solo button)

func (*McuState) SetMuteState

func (m *McuState) SetMuteState(fader byte, state bool)

SetMuteState sets the mute state for a fader

func (*McuState) SetSelectState added in v0.2.9

func (m *McuState) SetSelectState(fader byte, state bool)

SetSelectState sets the selected fader and lights up the select buttons accordingly

func (*McuState) SetTrackEnabledState added in v0.3.0

func (m *McuState) SetTrackEnabledState(track byte, state bool)

SetTrackEnabledState sets the enabled state for a single track

func (*McuState) SetVPotLed

func (m *McuState) SetVPotLed(fader byte, value byte)

SetVPotLed sets the LED state for a VPot value 0 is off, values 1-12 are full left

func (*McuState) UpdateTouch added in v0.3.6

func (m *McuState) UpdateTouch()

UpdateTouch checks if a simulated fader touch has timed out and sends the buffered value

Jump to

Keyboard shortcuts

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