// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Four-zone inventory drum pad // Not compiled or tested in-world // Setup: Set FACE and add kick, snare, hat, clap. Owner-touch corresponding quadrants; hold at least two seconds to silence. // Stop / restore: Hold for at least two seconds to silence, then remove. // Notes: Use licensed sounds in this prim. Audio is nearby, not private. Timer timing and asset loading are approximate; no sample synchronization is promised. Uses valid surface coordinates only. One attached sound at a time; this is not a polyphonic sampler. // 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())return; if(llGetTime()-pressed>=2.0) { llStopSound(); return; } if(llDetectedTouchFace(0)!=FACE)return; vector st=llDetectedTouchST(0); if(st.x<0.0||st.y<0.0||st.x>1.0||st.y>1.0)return; integer slot=0; if(st.x>=0.5)slot+=1; if(st.y>=0.5)slot+=2; string sound=llList2String(["kick","snare","hat","clap"],slot); if(llGetInventoryType(sound)==INVENTORY_SOUND)llPlaySound(sound,0.25); } }