A chorus that widens a pad
Updated
An Audio Chorus Filter on an ambient pad: a UI Switch fades its wet mix in and out with a tween, and two sliders set how fast and how far the copies waver.
With your sound on (headphones help), flip Chorus on and off and listen to the pad widen and shimmer. Raise Speed and Depth for a stronger wobble. Drag outside the panel to orbit the camera, scroll to zoom.
A chorus that widens a pad
#pragma lifecycle(startup)
let chorus;let state;let mix = 0;let fade;
function show() { const { frequency, depth } = chorus.props; state.setProps({ text: mix > 0.01 ? `Chorus on · ${frequency.toFixed(1)} Hz · depth ${Math.round(depth * 100)}%` : 'Chorus off: the dry pad', color: mix > 0.01 ? '#34d399' : '#9ca3af', });}
function setWet(target) { if (fade) fade.stop(); fade = Tween.value(mix, target, (value) => { mix = value; chorus.setProps({ wet: value }); }, { duration: 0.8 }); fade.then(show);}
function startup() { chorus = findEntity('Pad').getComponent(AudioChorusFilterComponent); state = findEntity('Chorus State').getComponent(UILabelComponent); const speed = findEntity('Chorus Speed'); const depth = findEntity('Chorus Depth');
on('chorus/ui', (event) => { if (event.eventType === EventType.UISwitch.Change) setWet(event.data.checked ? 0.7 : 0); if (event.eventType === EventType.UISlider.Change) { if (event.entityId === speed.entityId) chorus.setProps({ frequency: event.data.value }); if (event.entityId === depth.entityId) chorus.setProps({ depth: event.data.value / 100 }); show(); } }); show();}Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
ChorusPad.xrproj