// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Two-source crossfade controller // Not compiled or tested in-world // Setup: Name root audio_mixer and put this script there. Pair with Crossfade source receiver in two children named audio_a and audio_b; set FACE. // Stop / restore: Hold the root for at least two seconds to send Stop to both sources. Then remove if finished. // Notes: Use licensed inventory sounds in the specified prim. Audio is nearby, not private. Simulator timers and viewer loading are approximate. A short touch sets an A/B mix; a held touch sends Stop. Receiver sound assets belong in their own prims. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer FACE=0; float pressed; default { touch_start(integer n) { if(llDetectedKey(0)==llGetOwner())pressed=llGetTime(); } touch_end(integer n) { if(llDetectedKey(0)!=llGetOwner()||llGetLinkNumber()>1)return; if(llGetTime()-pressed>=2.0) { llMessageLinked(LINK_ALL_CHILDREN,7910,"stop",NULL_KEY); return; } if(llDetectedTouchFace(0)!=FACE)return; vector st=llDetectedTouchST(0); if(st.x<0.0||st.x>1.0)return; llMessageLinked(LINK_ALL_CHILDREN,7910,(string)st.x,NULL_KEY); } }