PageSourceSearch

https://bzic-tools.com/_app/immutable/nodes/51.B7xqUAx-.js

js bzic-tools.com collected 2026-10-02 01:26:41 UTC 9,081 bytes, 1 lines download raw bytes

1import"../chunks/DsnmJJEf.js";import{p as Ce,aH as Fe,q as a,b1 as Ve,f as ze,t as U,a as Ue,s as t,c as i,ai as h,ay as T,ax as je,r as s,n as Je}from"../chunks/C9WW4p9v.js";import{d as Qe,a as ge,s as I}from"../chunks/CqLORhp9.js";import{e as xe,i as Ge}from"../chunks/Yg0_rKYu.js";import{a as j,f as K}from"../chunks/DSjAqqt1.js";import{r as J,s as Ye}from"../chunks/DfDQh9Hr.js";import{s as we}from"../chunks/CGdiqQSI.js";import{b as Q}from"../chunks/CHW6xvaU.js";import{b as Te}from"../chunks/CDGlVj2D.js";import{B as Ke}from"../chunks/BmE8asv_.js";import{F as Xe}from"../chunks/B5B_57dx.js";import{S as Ze,J as G}from"../chunks/BtzpSwom.js";import{P as et}from"../chunks/BiNCS_W0.js";import{R as tt}from"../chunks/C_irmb9I.js";import{B as Y}from"../chunks/C23eAgs2.js";const at=!0,Ot=Object.freeze(Object.defineProperty({__proto__:null,prerender:at},Symbol.toStringTag,{value:"Module"})),st=30,it=300,nt=25,rt=60,ot={quarter:1,eighth:2,triplet:3,sixteenth:4};function lt(n,u,o,r,b,m){const c=n.createGain();c.connect(n.destination);const f=r?b*.3:b;c.gain.setValueAtTime(0,u),c.gain.linearRampToValueAtTime(f,u+.002),c.gain.exponentialRampToValueAtTime(.001,u+.04);const d=n.createOscillator();d.connect(c),d.frequency.value=o?1500:r?700:1e3,d.type="sine",d.start(u),d.stop(u+.05),m.push(d),d.onended=()=>{d.disconnect(),c.disconnect();const p=m.indexOf(d);p!==-1&&m.splice(p,1)}}function ct(n){return n||(n=new AudioContext),n.state==="suspended"&&n.resume(),n}function ut(n,u){for(const o of n){o.onended=null;try{o.stop()}catch{}o.disconnect()}n.length=0;for(const o of u)clearTimeout(o);u.length=0}function dt(n,u){const o=n.filter(r=>u-r<3e3);if(o.push(u),o.length>=2){const r=o.slice(1).map((m,c)=>m-o[c]),b=r.reduce((m,c)=>m+c,0)/r.length;return Math.round(Math.min(it,Math.max(st,6e4/b)))}return null}const Be="/music/metronome",pt={"@context":"https://schema.org","@type":"WebApplication",name:"Metronome",url:`${Y}${Be}`,description:"Free online metronome with adjustable BPM, time signatures, accent beats, and subdivisions. Accurate Web Audio timing, no drift.",applicationCategory:"MusicApplication",operatingSystem:"Any",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}},vt={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:`${Y}/`},{"@type":"ListItem",position:2,name:"Metronome",item:`${Y}${Be}`}]},Ae=[{q:"Why does this metronome not drift?",a:"It uses a Web Audio API lookahead scheduler. Instead of relying on setInterval alone (which can be delayed by browser tab throttling), it schedules audio events slightly in advance using the high-precision AudioContext clock. This keeps timing rock-solid regardless of what else the browser is doing."},{q:"What are subdivisions?",a:"Subdivisions split each beat into smaller, evenly spaced clicks. Quarter means one click per beat. Eighth adds a click in between each beat. Triplet divides each beat into three equal parts. Sixteenth adds three extra clicks between beats. Subdivision clicks are quieter so the main beats stay prominent."},{q:"How do accent beats work?",a:"The first beat of each bar plays at a higher pitch (1500 Hz) so you can easily hear the top of the bar. All other beats play at a standard pitch (1000 Hz). This helps you internalize the time signature while practicing."},{q:"Does it work offline?",a:"Yes. The metronome is entirely client-side — it uses the Web Audio API built into your browser and requires no internet connection once the page is loaded. No audio files are downloaded and nothing is sent to a server."},{q:"What BPM range is supported?",a:"The metronome supports 30 to 300 BPM. You can type a value directly into the number input, drag the slider, or use the Tap button to tap in a tempo manually."}];var mt=K('<div aria-hidden="true"></div>'),ft=K("<option> </option>"),bt=K('<!> <!> <!> <!> <!> <!> <section class="container svelte-wlxryf"><div class="card svelte-wlxryf"><div class="beat-row svelte-wlxryf" role="status" aria-live="polite" aria-label="Beat indicator"></div> <div class="bpm-display svelte-wlxryf"><span class="bpm-number svelte-wlxryf"> </span> <span class="bpm-label svelte-wlxryf">BPM</span></div> <div class="control-row svelte-wlxryf"><label class="control-label svelte-wlxryf" for="bpm-slider">Tempo</label> <div class="slider-group svelte-wlxryf"><span class="range-hint svelte-wlxryf">30</span> <input id="bpm-slider" type="range" min="30" max="300" step="1" class="slider svelte-wlxryf"/> <span class="range-hint svelte-wlxryf">300</span> <input type="number" min="30" max="300" step="1" class="number-input svelte-wlxryf" aria-label="BPM value"/></div></div> <div class="controls-grid svelte-wlxryf"><div class="field svelte-wlxryf"><label class="field-label svelte-wlxryf" for="beats-select">Beats per bar</label> <select id="beats-select" class="select svelte-wlxryf"></select></div> <div class="field svelte-wlxryf"><label class="field-label svelte-wlxryf" for="subdiv-select">Subdivisions</label> <select id="subdiv-select" class="select svelte-wlxryf"><option>Quarter notes</option><option>Eighth notes</option><option>Triplets</option><option>Sixteenth notes</option></select></div> <div class="field svelte-wlxryf"><label class="field-label svelte-wlxryf" for="volume-slider">Volume</label> <input id="volume-slider" type="range" min="0" max="1" step="0.01" class="slider svelte-wlxryf"/></div></div> <div class="action-row svelte-wlxryf"><button>
1<span class="material-symbols-rounded svelte-wlxryf" aria-hidden="true"> </span> </button> <button class="btn-tap svelte-wlxryf" aria-label="Tap tempo"><span class="material-symbols-rounded svelte-wlxryf" aria-hidden="true">touch_app</span> Tap</button></div></div></section> <section class="bottom-section svelte-wlxryf"><div class="container svelte-wlxryf"><!> <!></div></section>',1);function Dt(n,u){Ce(u,!0);const o="/music/metronome";let r=T(120),b=T(4),m=T("quarter"),c=T(.7),f=T(!1),d=T(-1),p=null,M=null,_=null,g=0,A=0,k=[],B=[],S=[];function Me(){const e=performance.now();S=S.filter(v=>e-v<3e3);const l=dt(S,e);S.push(e),l!==null&&h(r,l,!0)}function Se(){if(!p)return;const e=p,l=ot[a(m)],v=a(b)*l,w=60/(a(r)*l);for(;g<e.currentTime+.1;){const y=Math.floor(A%v/l),P=A%v%l;lt(e,g,y===0&&P===0,P!==0,a(c),k);const Re=g,We=y,$e=(Re-e.currentTime)*1e3,_e=setTimeout(()=>{h(d,We,!0),B=B.filter(Ne=>Ne!==_e)},Math.max(0,$e));B.push(_e),g+=w,A+=1}}function X(){p&&(ut(k,B),g=p.currentTime+.05,A=0)}function Pe(){const e=ct(p);p=e,k=[],B=[],A=0,g=e.currentTime+.05,h(f,!0),M=setInterval(Se,nt)}function Z(){h(f,!1),M!==null&&(clearInterval(M),M=null),_!==null&&(clearTimeout(_),_=null),X(),h(d,-1)}function Ie(){a(f)?Z():Pe()}Fe(()=>{a(r),a(m),a(b),!(!a(f)||!p)&&(_!==null&&clearTimeout(_),_=setTimeout(()=>{_=null,a(f)&&X()},rt))}),Ve(()=>{Z(),p&&(p.close(),p=null)});function ke(e){return a(f)&&e===a(d)}function qe(e){return e===0}var ee=bt(),te=ze(ee);Ze(te,{title:"Metronome — Free Online Metronome with Subdivisions | bzic-tools",description:"Free online metronome with adjustable BPM, time signatures, accent beats, and subdivisions. Accurate Web Audio timing, no drift.",url:o});var ae=t(te,2);G(ae,{get data(){return pt}});var se=t(ae,2);G(se,{get data(){return vt}});var ie=t(se,2);{let e=je(()=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:Ae.map(l=>({"@type":"Question",name:l.q,acceptedAnswer:{"@type":"Answer",text:l.a}}))}));G(ie,{get data(){return a(e)}})}var ne=t(ie,2);Ke(ne,{currentLabel:"Metronome"});var re=t(ne,2);et(re,{icon:"avg_pace",title:"Metronome",description:"Keep perfect time with an accurate Web-Audio metronome. Set BPM, time signature, accents, and subdivisions."});var q=t(re,2),oe=i(q),L=i(oe);xe(L,21,()=>Array(a(b)),Ge,(e,l,v)=>{var w=mt();let y;U(P=>y=we(w,1,"beat-dot svelte-wlxryf",null,y,P),[()=>({"beat-dot--accent":qe(v),"beat-dot--active":ke(v)})]),j(e,w)}),s(L);var E=t(L,2),le=i(E),Le=i(le,!0);s(le),Je(2),s(E);var O=t(E,2),ce=t(i(O),2),D=t(i(ce),2);J(D);var ue=t(D,4);J(ue),s(ce),s(O);var H=t(O,2),R=i(H),W=t(i(R),2);xe(W,20,()=>[2,3,4,5,6,7],e=>e,(e,l)=>{var v=ft(),w=i(v);s(v);var y={};U(()=>{I(w,`${l??""}/4`),y!==(y=l)&&(v.value=(v.__value=l)??"")}),j(e,v)}),s(W),s(R);var $=t(R,2),N=t(i($),2),C=i(N);C.value=C.__value="quarter";var F=t(C);F.value=F.__value="eighth";var V=t(F);V.value=V.__value="triplet";var de=t(V);de.value=de.__value="sixteenth",s(N),s($);var pe=t($,2),ve=t(i(pe),2);J(ve),s(pe),s(H);var me=t(H,2),x=i(me);let fe;var z=i(x),Ee=i(z,!0);s(z);var Oe=t(z);s(x);var De=t(x,2);s(me),s(oe),s(q);var be=t(q,2),he=i(be),ye=i(he);tt(ye,{currentPath:o});var He=t(ye,2);Xe(He,{get faqs(){return Ae}}),s(he),s(be),U(()=>{I(Le,a(r)),fe=we(x,1,"btn-start svelte-wlxryf",null,fe,{"btn-start--stop":a(f)}),Ye(x,"aria-pressed",a(f)),I(Ee,a(f)?"stop":"play_arrow"),I(Oe,` ${a(f)?"Stop":"Start"}`)}),Q(D,()=>a(r),e=>h(r,e)),Q(ue,()=>a(r),e=>h(r,e)),Te(W,()=>a(b),e=>h(b,e)),Te(N,()=>a(m),e=>h(m,e)),Q(ve,()=>a(c),e=>h(c,e)),ge("click",x,Ie),ge("click",De,Me),j(n,ee),Ue()}Qe(["click"]);export{Dt as component,Ot as universal};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.