An echo you tune with sliders
Updated
Two UI Sliders drive the delay time and feedback of an Audio Echo Filter on a looping beat; one listener tells the sliders apart by entity id.
With your sound on, click once to start the audio, then drag the sliders: longer times space the repeats out, more feedback makes them last. The beat is a short loop generated for this example. Drag outside the panel to orbit the camera.
An echo you tune with sliders
#pragma lifecycle(startup)
let echo;let timeSlider;let repeatSlider;
function startup() { echo = findEntity('Synth').getComponent(AudioEchoFilterComponent); timeSlider = findEntity('Echo Time'); repeatSlider = findEntity('Echo Repeats');
on('echo/ui', (event) => { if (event.eventType !== EventType.UISlider.Change) return; if (event.entityId === timeSlider.entityId) echo.setProps({ delayTime: event.data.value }); if (event.entityId === repeatSlider.entityId) echo.setProps({ feedback: event.data.value }); });}How it works
Section titled “How it works”The script is explained step by step in An echo you tune with sliders.
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.
EchoSliders.xrproj