// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Plan an on/off cycle with soft edges // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set positive PERIOD, ON_TIME within the period, and FADE no greater than half ON_TIME. Owner touch prints calculations only. // Stop / restore: Disable/remove. No prim motion or appearance is changed. // Notes: The pulse has linear fade edges. It reports intensity only and does not flicker a light. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Motion planning only. float PERIOD=5.0; float ON_TIME=2.0; float FADE=0.4; float ELAPSED=1.8; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(PERIOD<=0.0||ON_TIME<=0.0||ON_TIME>PERIOD||FADE<=0.0||2.0*FADE>ON_TIME) { llOwnerSay("Invalid envelope timing."); return; } float t=ELAPSED-PERIOD*llFloor(ELAPSED/PERIOD); float value=0.0; if(tON_TIME-FADE)value=(ON_TIME-t)/FADE; } llOwnerSay("Pulse intensity="+(string)value); } }