// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Authored rhythm pattern player // Not compiled or tested in-world // Setup: Add a very short tick sound. Edit PATTERN as 1=beat and 0=rest; owner-touch starts/stops. // Stop / restore: Touch to stop and silence before removing. // Notes: Use licensed inventory sounds in the specified prim. Audio is nearby, not private. Simulator timers and viewer loading are approximate. A short step sequence can illustrate syncopation. STEP is clamped to at least 0.25 seconds; no precise audio synchronization is promised. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. list PATTERN=[1,0,1,1,0,1,0,0]; float STEP=0.5; integer active; integer index; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; active=!active; if(active) { if(STEP<0.25)STEP=0.25; index=0; llSetTimerEvent(STEP); } else { llSetTimerEvent(0.0); llStopSound(); } } timer() { integer count=llGetListLength(PATTERN); if(!count) { active=FALSE; llSetTimerEvent(0.0); return; } if(llList2Integer(PATTERN,index)&&llGetInventoryType("tick")==INVENTORY_SOUND)llPlaySound("tick",0.2); index=(index+1)%count; } }