Skip to content

Instantly share code, notes, and snippets.

@kmorrill
Created February 2, 2025 16:44
Show Gist options
  • Save kmorrill/5d8067a6ef35421e2255110025d469f4 to your computer and use it in GitHub Desktop.
Save kmorrill/5d8067a6ef35421e2255110025d469f4 to your computer and use it in GitHub Desktop.
Mozaic knob labels
@OnLoad
ShowLayout 0
// Set the default label for knob 0 when the script loads.
LabelKnob 0, {Knob1}
@End
@OnKnobChange
// Only process changes for knob 0.
if LastKnob = 0
// Continue processing knob 0 changes.
else
Exit
endif
// Retrieve the current value of knob 0.
knobValue = GetKnobValue 0
// Change the label based on the current knob value.
// If the value is less than 64, display "Setting A"; otherwise, display "Setting B".
if knobValue < 64
LabelKnob 0, {Setting A}
else
LabelKnob 0, {Setting B}
endif
// Reset and start a timer with a 3000ms (3-second) interval.
// After 3 seconds of inactivity, the label will revert to the default.
ResetTimer
SetTimerInterval 3000 // Timer set for 3000ms (3 seconds)
StartTimer
@End
@OnTimer
// When the timer fires, revert knob 0's label back to its default.
LabelKnob 0, {Knob1}
StopTimer
@End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment