dmxthing

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

dmxthing

Tool for controlling DMX video lighting using a Loupedeck as a UI controller.

My desktop video conferencing setup include several video lights which are all controlled via DMX, so I can control brightness and color temperature. I have lights above my monitor on the left side, centered above the camera, and on the right side, plus an overhead light and a background light.

Originally, I was using a cheap hardware DMX controller for this with a bunch of sliders, but I ended up writing this instead. I have a Raspberry Pi with a cheap USB DMX controller, and I'm using a Loupedeck (I've used both a Loupedeck Live and a Loupedeck CT) for the UI.

This repository contains the code that makes the whole thing work. It knows about my lights and gives me a simple interface for changing brightness and color, plus turning the lights all off or on to a specific default.

This is (currently) very specific to my needs, but could be used as an example for how to use my Loupedeck library, and it'd be easy enough to adapt if anyone wants to build anything similar for themselves.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorTempButton

func ColorTempButton(l *loupedeck.Loupedeck, w *loupedeck.WatchedInt, min, max int, button loupedeck.TouchButton) *loupedeck.MultiButton

ColorTempButton creates a Loupedeck button for managing color temperatures for a specified light, ranging between 'min' and 'max' degrees K.

Types

type AeosLight

type AeosLight struct {
	// contains filtered or unexported fields
}

AeosLight controls a Rotolight Aeos light

func NewAeosLight

func NewAeosLight(dmx *udmx.UDMXDevice, dmxid uint16) *AeosLight

NewAeosLight creates a new AeosLight object.

func (*AeosLight) MaxColorTemp

func (a *AeosLight) MaxColorTemp() int

MaxColorTemp returns the maximum color temperature of this light

func (*AeosLight) MinColorTemp

func (a *AeosLight) MinColorTemp() int

MinColorTemp returns the minimum color temperature of this light

func (*AeosLight) SetBrightness

func (a *AeosLight) SetBrightness(b int)

SetBrightness sets the brightness of the light on a range from 0 to 100%.

func (*AeosLight) SetColorTemp

func (a *AeosLight) SetColorTemp(c int)

SetColorTemp sets the color temperature of the light, in degrees K

type Light

type Light interface {
	SetBrightness(int)
	SetColorTemp(int)
	MinColorTemp() int
	MaxColorTemp() int
}

Light is an interface for lights that are compatible with this controller.

type LightController

type LightController struct {
	Loupedeck    *loupedeck.Loupedeck
	Position     LoupedeckArea
	DialButtonID int
	X, Y         int
	Brightness   *loupedeck.WatchedInt
	ColorTemp    *loupedeck.WatchedInt
	Lights       []Light
	// contains filtered or unexported fields
}

LightController is a controller for one or more lights. It implements brightness and color control using buttons and dials on the Loupedeck.

func NewLightController

func NewLightController(l *loupedeck.Loupedeck, position LoupedeckArea, lights []Light) *LightController

NewLightController creates a new LightController for a set of lights.

func (*LightController) Draw

func (a *LightController) Draw()

Draw updates the Loupedeck display.

func (*LightController) Reset

func (a *LightController) Reset()

Reset sets the brightness to 0 and color to the minimum supported by the light.

type LoupedeckArea

type LoupedeckArea int

LoupedeckArea represents an area of the Loupedeck touch display.

const (
	LeftTop LoupedeckArea = iota
	LeftMiddle
	LeftBottom
	RightTop
	RightMiddle
	RightBottom
)

type RainbowLightP12

type RainbowLightP12 struct {
	// contains filtered or unexported fields
}

RainbowLightP12 controls a Quasar Science Rainbow light bar (the original model, not Rainbow 2 or Double Rainbow), in DMX profile 12. In this mode, the light listens to a block of 12 DMX addresses:

dmxid+0: intensity (high 8 bits)

+1:  intensity (low 8 bits)
+2:  color temp (2000k to 6000k mapped onto 0..255)
+3:  plus/minus green
+4:  crossfade fraction color/rgb high
+5:  crossfade fraction color/rgb low
+6:  red
+7:  green
+8:  blue
+9:  FX
+10: FX rate
+11: FX size

Right now, only intensity and color temp are used, but various special effect settings will be exposed in the future.

func NewRainbowLightP12

func NewRainbowLightP12(dmx *udmx.UDMXDevice, dmxid uint16) *RainbowLightP12

NewRainbowLightP12 creates a new RainbowLightP12 using a specific DMX controller and at a specific DMX address.

func (*RainbowLightP12) MaxColorTemp

func (a *RainbowLightP12) MaxColorTemp() int

func (*RainbowLightP12) MinColorTemp

func (a *RainbowLightP12) MinColorTemp() int

func (*RainbowLightP12) SetBrightness

func (a *RainbowLightP12) SetBrightness(b int)

SetBrightness sets the brightness of the DMX light.

func (*RainbowLightP12) SetColorTemp

func (a *RainbowLightP12) SetColorTemp(c int)

SetColorTemp sets the color temperature of the DMX light. The temperature should be specified in degrees K.

func (*RainbowLightP12) SetFX

func (a *RainbowLightP12) SetFX(x int)

SetFX sets the light's FX setting.

func (*RainbowLightP12) SetFXRate

func (a *RainbowLightP12) SetFXRate(x int)

SetFXRate sets the light's FX rate.

func (*RainbowLightP12) SetFXSize

func (a *RainbowLightP12) SetFXSize(x int)

SetFXSize sets the light's FX size.

type RainbowLightP5

type RainbowLightP5 struct {
	// contains filtered or unexported fields
}

RainbowLightP5 controls a Quasar Science Rainbow light bar (the original model, not Rainbow 2 or Double Rainbow), in DMX profile 5. In this mode, the light listens on two DMX addresses; the lower one is an 8-bit brightness and the upper one is an 8-bit color temperature.

func NewRainbowLightP5

func NewRainbowLightP5(dmx *udmx.UDMXDevice, dmxid uint16) *RainbowLightP5

NewRainbowLightP5 creates a new RainbowLightP5 using a specific DMX controller and at a specific DMX address.

func (*RainbowLightP5) MaxColorTemp

func (a *RainbowLightP5) MaxColorTemp() int

func (*RainbowLightP5) MinColorTemp

func (a *RainbowLightP5) MinColorTemp() int

func (*RainbowLightP5) SetBrightness

func (a *RainbowLightP5) SetBrightness(b int)

SetBrightness sets the brightness of the DMX light.

func (*RainbowLightP5) SetColorTemp

func (a *RainbowLightP5) SetColorTemp(c int)

SetColorTemp sets the color temperature of the DMX light. The temperature should be specified in degrees K.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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