Skip to main content

Overview

The VRStageLighting_AudioLink_Static class provides AudioLink integration for stage lighting fixtures in VRSL. It allows fixtures to react to audio in real-time by responding to different frequency bands, with support for color chords, theme colors, and texture sampling. This script is designed for fixtures that react to music rather than DMX control, making it ideal for dynamic, music-driven lighting setups. Namespace: VRSL
Inherits from: UdonSharpBehaviour (in VRChat) or MonoBehaviour (in Unity)
Enable or disable Audio Link Reaction for this fixture.
band
AudioLinkBandState
default:"Bass"
The frequency band of the spectrum to react to. Options: Bass, Low_Mids, High_Mids, Treble
delay
int
default:"0"
The level of delay to add to the reaction. Higher values create a more delayed response to audio.
bandMultiplier
float
default:"1.0"
Multiplier for the sensitivity of the reaction. Higher values make the fixture more responsive to audio.
enableColorChord
bool
default:"false"
Enable Color Chord tinting of the light emission. This makes the light react to the dominant frequency color.

General Settings

globalIntensity
float
default:"1.0"
Sets the overall intensity of the shader. Good for animating or scripting effects related to intensity. Its max value is controlled by Final Intensity.
finalIntensity
float
default:"1.0"
Sets the maximum brightness value of Global Intensity. Good for personalized settings of the max brightness of the shader by other users via UI.
finalIntensityComponentMode
bool
default:"false"
Choose between setting the Final Intensity for all meshes, or individual meshes.
finalIntensityVolumetric
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for volumetric meshes only.
finalIntensityProjection
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for projection meshes only.
finalIntensityFixture
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for fixture meshes only.
lightColorTint
Color
default:"White * 2.0"
The main color of the light. Supports HDR colors.

Color Sampling

enableColorTextureSampling
bool
default:"false"
Check this box if you wish to sample a separate texture for the color. The color will be influenced by the intensity of the original emission color. The texture is set in the shader itself.
traditionalColorTextureSampling
bool
default:"false"
Check this box if you wish to use traditional color sampling instead of white to black conversion.
textureSamplingCoordinates
Vector2
default:"(0.5, 0.5)"
The UV coordinates to sample the color from on the texture.
enableThemeColorSampling
bool
default:"false"
Check this box if you wish to enable AudioLink Theme colors.
themeColorTarget
int
default:"1"
Theme Color to Sample from. AudioLink supports 4 theme colors.

Movement Settings

targetToFollow
Transform
default:"null"
The target for this mover to follow. When set, the fixture will automatically aim at this transform.

Fixture Settings

spinSpeed
float
default:"4.0"
Projection Spin Speed (Udon Override Only). Negative values spin in the opposite direction.
enableAutoSpin
bool
default:"false"
Enable projection spinning (Udon Override Only).
selectGOBO
int
default:"1"
Use this to change what projection is selected.

Mesh Settings

objRenderers
MeshRenderer[]
required
The meshes used to make up the light. You need at least 1 mesh in this group for the script to work properly. Supports up to 5 mesh renderers.
coneWidth
float
default:"2.5"
Controls the radius of a mover/spot light.
coneLength
float
default:"1.0"
Controls the length of the cone of a mover/spot light.
maxConeLength
float
default:"8.5"
Controls the mesh length of the cone of a mover/spot light.

Public Methods

_UpdateInstancedProperties()

Updates all material property blocks with current fixture settings including AudioLink parameters.
public void _UpdateInstancedProperties()
Updates material property blocks without AudioLink functionality enabled.
public void _UpdateInstancedPropertiesSansAudioLink()

_SetProps()

Initializes the MaterialPropertyBlock for this fixture.
public void _SetProps()

Properties (for Udon Scripting)

All public fields have corresponding properties for safe access from Udon scripts:
  • LightColorTint - Get/Set the light color
  • ConeWidth - Get/Set the cone width
  • ConeLength - Get/Set the cone length
  • MaxConeLength - Get/Set the maximum cone length
  • GlobalIntensity - Get/Set the global intensity
  • FinalIntensity - Get/Set the final intensity
  • FinalIntensityComponentMode - Get/Set component mode
  • FinalIntensityVolumetric - Get/Set volumetric intensity
  • FinalIntensityProjection - Get/Set projection intensity
  • FinalIntensityFixture - Get/Set fixture intensity
  • SelectGOBO - Get/Set the selected gobo
  • EnableAudioLink - Get/Set AudioLink enabled state
  • Band - Get/Set the frequency band
  • Delay - Get/Set the reaction delay
  • BandMultiplier - Get/Set the band multiplier
  • TextureSamplingCoordinates - Get/Set texture sampling coordinates
  • SpinSpeed - Get/Set projection spin speed
  • ProjectionSpin - Get/Set projection spin enabled
  • ColorChord - Get/Set color chord enabled
  • ColorTextureSampling - Get/Set texture sampling enabled
  • TraditionalColorTextureSampling - Get/Set traditional sampling mode
  • ThemeColorSampling - Get/Set theme color sampling enabled
  • ThemeColorTarget - Get/Set theme color target

Usage Example

// Example: Setting up an AudioLink reactive fixture
VRStageLighting_AudioLink_Static fixture = GetComponent<VRStageLighting_AudioLink_Static>();

// Enable AudioLink and configure it to react to bass
fixture.EnableAudioLink = true;
fixture.Band = AudioLinkBandState.Bass;
fixture.BandMultiplier = 2.5f;

// Enable color chord for dynamic colors
fixture.ColorChord = true;

// Set intensity
fixture.GlobalIntensity = 1.0f;
fixture.FinalIntensity = 0.9f;

// Apply changes
fixture._UpdateInstancedProperties();
Band StateDescription
BassReacts to low frequency bass (20-200 Hz)
Low_MidsReacts to low-mid frequencies (200-500 Hz)
High_MidsReacts to high-mid frequencies (500-2000 Hz)
TrebleReacts to high frequencies (2000-20000 Hz)

Build docs developers (and LLMs) love