{"_id":"@audio/beat-onset","_rev":"5-934faf43aaf22c3b4147eaa9f16bd284","name":"@audio/beat-onset","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@audio/beat-onset","version":"1.0.0","keywords":["audio","dsp","beat","onset","onset-detection"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/beat-onset@1.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","bugs":{"url":"https://github.com/audiojs/beat/issues"},"dist":{"shasum":"e4b27eb7b0015a71efa98cc92f69a38f6c0e5025","tarball":"https://registry.npmjs.org/@audio/beat-onset/-/beat-onset-1.0.0.tgz","fileCount":5,"integrity":"sha512-O9Nzr5mJYZx8UvwAP32cdShS5L9dgynKmB8kVTjUfz8ov4NW3GXztYKWpTV8svUlAGayon8mFQpejc5Hh05G4w==","signatures":[{"sig":"MEQCIDGI0zujCbujie2APJupb9egpxF6/8sz1U03Gpj2+I0xAiBXw7nBpaj8BHMsTSpNsNduGikwOMJXztnWtZmYYxqM3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8787},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./band":"./band.js","./phase":"./phase.js","./energy":"./energy.js","./package.json":"./package.json"},"gitHead":"653ce6989e55651302d69179a749054892d12f41","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"_npmVersion":"11.12.1","description":"Spectral flux onset detection","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"window-function":"^3.0.0","@audio/beat-core":"^1.0.0","fourier-transform":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/beat-onset_1.0.0_1783539952683_0.7303072630965914","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/beat-onset","version":"1.0.1","keywords":["audio","dsp","beat","onset","onset-detection"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/beat-onset@1.0.1","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","bugs":{"url":"https://github.com/audiojs/beat/issues"},"dist":{"shasum":"2131ff8e5ea9b168892f0988bb84d745a63d7cfe","tarball":"https://registry.npmjs.org/@audio/beat-onset/-/beat-onset-1.0.1.tgz","fileCount":5,"integrity":"sha512-Oja8L14bdq3ME28xvgekuJCvqO2ajBfA1oezvJPlS1uLNCP8E2z69mITQwsKmZJN4FgOGoCTgANalC78FnJuFA==","signatures":[{"sig":"MEUCIFqAMIj7GMXgEbrZOk7R7O0Q4wQzMcKzCRKsJLWbFczPAiEAnMnRgLJxMxUZNZ6f+jXj1BsreJ0/z4hUNUatvsyiXnE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8937},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./band":"./band.js","./phase":"./phase.js","./energy":"./energy.js","./package.json":"./package.json"},"gitHead":"e0a00eafdb367594f4ecc193e4ea5a1b836dd17f","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"_npmVersion":"11.12.1","description":"Spectral flux onset detection","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/onset":"^1.0.0","window-function":"^3.0.0","@audio/beat-core":"^1.0.0","fourier-transform":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/beat-onset_1.0.1_1783605005790_0.8522912163165937","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@audio/beat-onset","version":"1.0.2","keywords":["audio","dsp","beat","onset","onset-detection"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/beat-onset@1.0.2","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","bugs":{"url":"https://github.com/audiojs/beat/issues"},"dist":{"shasum":"1070c51c09dcfcc7f1fe5297982ae1fbfe1def64","tarball":"https://registry.npmjs.org/@audio/beat-onset/-/beat-onset-1.0.2.tgz","fileCount":6,"integrity":"sha512-V+umGrn1wZ28MO37JCH0zODv8z87hKimDvg9DOF4aLp1FupOEESpDWhAODrnCPFrh5febjoXbHuHgUsLveHYsQ==","signatures":[{"sig":"MEUCIQDV86GszDsYDrtSPUA6ISMASkWg86M4w9n846OcV4ZzzwIgHXsGLzfHtZn/95g5zP2g63qPdrWWKpK/+zAC7Nlj++Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9850},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./band":"./band.js","./phase":"./phase.js","./energy":"./energy.js","./package.json":"./package.json"},"gitHead":"af41a920f27b1358af8632420c8a54ad14a36b4f","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"_npmVersion":"11.12.1","description":"Spectral flux onset detection","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/onset":"^1.0.0","window-function":"^3.0.0","fourier-transform":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/beat-onset_1.0.2_1783623692371_0.6898580643948782","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@audio/beat-onset","version":"1.0.3","keywords":["audio","dsp","beat","onset","onset-detection"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/beat-onset@1.0.3","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","bugs":{"url":"https://github.com/audiojs/beat/issues"},"dist":{"shasum":"f1e067894f1b3d162a63ab40372ed8e169e3a94b","tarball":"https://registry.npmjs.org/@audio/beat-onset/-/beat-onset-1.0.3.tgz","fileCount":8,"integrity":"sha512-CU3QhLD/pwelkkFk9tTZT9BefQ7BQnjJFvdMKEGKZu31OE1QN/e6s95RZXtIWkRjr3TFSCowSzNP+mT3GslFWA==","signatures":[{"sig":"MEUCID7oqrEOlStTp3f00tetdNY9m/mmB4JwihAOISvBW0guAiEA3BzNctK8Pvdymbz/bEbrKgZ22anAcjiHALM2Sk5pMMQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12409},"main":"index.js","type":"module","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./index.js","./band":"./band.js","./phase":"./phase.js","./energy":"./energy.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"565db5d62562df8e6b7cb74617f6c921fbb3ada4","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"_npmVersion":"11.12.1","description":"Spectral flux onset detection","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/onset":"^1.0.0","window-function":"^3.0.0","fourier-transform":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/beat-onset_1.0.3_1783731319369_0.7997304170291168","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"_id":"@audio/beat-onset@1.0.4","bugs":{"url":"https://github.com/audiojs/beat/issues"},"dist":{"shasum":"4fb0ecb1f2a70ea19f4982668d432b4b929e121a","tarball":"https://registry.npmjs.org/@audio/beat-onset/-/beat-onset-1.0.4.tgz","fileCount":8,"integrity":"sha512-zZJoiGVXdqvmN7OIkchDKUdQOzFtR0WxuqSpAANei1TuZA/LdmDio4KA7E+QvH/3zNRU8o4IwihSkr9mYE2l5w==","signatures":[{"sig":"MEUCIDbKF4BJ3pzYJDSc3ipVaMJbW48kmSQ/e73FhTv7vJEsAiEA/o4yo21uJhVsdyDXoSB6LWGAJRgp+2SBU3kJGJJm2ao=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCLdN5LazXVUgD6cEC7i7FFnRM3fkb5grMlrBJqtyYfzwIgMnvaP3r6zwAbsOV5DAm6Hr0EHE03FbdjiKIzpB5szQI="}],"unpackedSize":12411},"main":"index.js","name":"@audio/beat-onset","type":"module","types":"index.d.ts","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"exports":{".":"./index.js","./band":"./band.js","./phase":"./phase.js","./energy":"./energy.js","./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"7e55703a88a58ef5c4ba872706a707a87db0be20","license":"MIT","version":"1.0.4","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","keywords":["audio","dsp","beat","onset","onset-detection"],"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"_npmVersion":"11.12.1","description":"Spectral flux onset detection","directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/onset":"^1.0.0","window-function":"^3.0.0","fourier-transform":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/beat-onset_1.0.4_1790491962519_0.30445808749919"}}},"time":{"created":"2026-07-08T19:45:52.457Z","modified":"2026-09-27T06:52:42.861Z","1.0.0":"2026-07-08T19:45:52.829Z","1.0.1":"2026-07-09T13:50:05.933Z","1.0.2":"2026-07-09T19:01:32.524Z","1.0.3":"2026-07-11T00:55:19.493Z","1.0.4":"2026-09-27T06:52:42.596Z"},"bugs":{"url":"https://github.com/audiojs/beat/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/beat/tree/main/packages/beat-onset","keywords":["audio","dsp","beat","onset","onset-detection"],"repository":{"url":"git+https://github.com/audiojs/beat.git","type":"git","directory":"packages/beat-onset"},"description":"Spectral flux onset detection","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/beat-onset [![npm](https://img.shields.io/npm/v/@audio/beat-onset)](https://www.npmjs.com/package/@audio/beat-onset) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nSpectral flux onset detection\n\n```\nnpm install @audio/beat-onset\n```\n\n```js\nimport onsets from '@audio/beat-onset'\n```\n\nSpectral flux. STFT → magnitude → sum positive frame-to-frame differences → adaptive threshold peak-pick. The general-purpose default.\n\n```js\nimport onsets from '@audio/beat-onset'\nlet ons = onsets(samples, { fs: 44100 })\n```\n\n| Param | Default | |\n|---|---|---|\n| `fs` | `44100` | Sample rate |\n| `frameSize` | `2048` | STFT window size |\n| `hopSize` | `512` | Hop between frames |\n| `delta` | `1.4` | Adaptive threshold multiplier |\n| `windowSize` | `8` | Peak-pick local mean window (frames) |\n\n**Use when:** General-purpose onset detection — music, speech, mixed material.<br>\n**Ref:** Dixon, \"Onset Detection Revisited\" (DAFx 2006).<br>\n**Complexity:** $O(N \\log F)$ where $N$ = samples, $F$ = frame size (FFT).\n\n**Also in this package** (subpath imports, each a standalone default export):\n\n| Import | Function | |\n|---|---|---|\n| `@audio/beat-onset/energy` | `energyOnsets(data, opts)` | Energy flux — no FFT, fastest, best for strong transients |\n| `@audio/beat-onset/phase` | `phaseOnsets(data, opts)` | Phase deviation — robust to sustained tones |\n| `@audio/beat-onset/band` | `bandOnsets(data, opts)` | Multi-band spectral flux — full-band music |\n\nSee the [@audio/beat](https://github.com/audiojs/beat#onset-detection) umbrella docs for their param tables and refs.\n\n---\n\nPart of [@audio/beat](https://github.com/audiojs/beat) — the beat family umbrella. This README is generated from the umbrella docs.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md"}