From 65c3cc8c208aa6d92f331dc5ed0b69c6988257bb Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 17 Jul 2026 18:36:33 -0500 Subject: [PATCH] =?UTF-8?q?feat(toma-progresiva):=20alarma=20m=C3=A1s=20fu?= =?UTF-8?q?erte=203=20ciclos=20con=20sawtooth+compressor=20y=20vibraci?= =?UTF-8?q?=C3=B3n=205x900ms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- ver_formulario_enviado.php | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 153f28d..a47e8fb 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -2086,16 +2086,28 @@ function _guardarFirmaMP(widget, svg, msgEl, entry, campoId) { function _mpPlayBeep() { try { - var ctx = new (window.AudioContext || window.webkitAudioContext)(); - [880, 1100, 880, 1100].forEach(function(freq, i) { - var osc = ctx.createOscillator(), gain = ctx.createGain(); - osc.connect(gain); gain.connect(ctx.destination); - osc.frequency.value = freq; - var t0 = ctx.currentTime + i * 0.22; - gain.gain.setValueAtTime(0.7, t0); - gain.gain.exponentialRampToValueAtTime(0.001, t0 + 0.18); - osc.start(t0); osc.stop(t0 + 0.18); - }); + var ctx = new (window.AudioContext || window.webkitAudioContext)(); + var comp = ctx.createDynamicsCompressor(); + comp.threshold.value = -6; comp.ratio.value = 12; comp.attack.value = 0; + comp.connect(ctx.destination); + // 3 ciclos de alarma, cada ciclo 3 notas; 2 osciladores por nota para más volumen + var notes = [1200, 880, 1200]; + for (var cycle = 0; cycle < 3; cycle++) { + notes.forEach(function(freq, i) { + var t0 = ctx.currentTime + cycle * 1.0 + i * 0.28; + [0, 6].forEach(function(detune) { // dos osciladores ligeramente desafinados + var osc = ctx.createOscillator(); + var g = ctx.createGain(); + osc.type = 'sawtooth'; + osc.frequency.value = freq; + osc.detune.value = detune; + osc.connect(g); g.connect(comp); + g.gain.setValueAtTime(1.0, t0); + g.gain.exponentialRampToValueAtTime(0.001, t0 + 0.24); + osc.start(t0); osc.stop(t0 + 0.24); + }); + }); + } } catch(e) {} } @@ -2128,7 +2140,7 @@ function _mpIniciarCountdown(targetMsOrMins, nextLabel, nextFirmaId) { box.style.animation = 'mp-pulse 1s ease-in-out infinite'; box.innerHTML = '
¡Hora de la siguiente muestra!
' + (nextLabel ? '
' + nextLabel + '
' : ''); - if (navigator.vibrate) navigator.vibrate([500,150,500,150,500]); + if (navigator.vibrate) navigator.vibrate([900,150,900,150,900,150,900,150,900]); _mpPlayBeep(); // Desbloquear y mostrar siguiente canvas var nw = nextFirmaId ? document.getElementById('fpw-' + nextFirmaId) : null;