{"_id":"@audio/pitch-yin","_rev":"6-757e1cf8295766f83473a6f8df974f60","name":"@audio/pitch-yin","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@audio/pitch-yin","version":"1.0.0","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/pitch-yin@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/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"dist":{"shasum":"b02cf65ec5c30e4e123df086f2c1edbf44fbfe69","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.0.tgz","fileCount":3,"integrity":"sha512-32MYm2F64IcWIx27NxP+8ZzcAgxAwHCBr7K0mxJ3xJjMeJcxYJQa7A3jTV54lbLS+VgRZ5Us1q62WJyPfKL51Q==","signatures":[{"sig":"MEQCIHF4xweePasMxWvpB7KTyt2iXkHuDv0eXyFNdZAsAeZ2AiB9wOoK2BxOqQGta0s5fOfBejfNSZl8DjDok8dzytjeCg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3396},"main":"yin.js","type":"module","engines":{"node":">=18"},"exports":{".":"./yin.js","./audio-module":"./audio-module.js","./package.json":"./package.json"},"gitHead":"984da555a04fddf53e71299736a2dc76311b2a49","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/pitch.git","type":"git","directory":"packages/pitch-yin"},"_npmVersion":"11.12.1","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","audio-module":"./audio-module.js","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pitch-yin_1.0.0_1783539943197_0.6424724977130729","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/pitch-yin","version":"1.0.1","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/pitch-yin@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/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"atom":"./atom.js","dist":{"shasum":"b31db3a9d4e7f25175629024d352a6741ef1593e","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.1.tgz","fileCount":3,"integrity":"sha512-kdO5JbcI9TTEl8r5wm8H0KM4QucVx7OtwWWjSffF3VMRcbzsnBPagRG370FB1R0GBA07ysylckcmx4ztU+w9fw==","signatures":[{"sig":"MEYCIQDFO+QwHeBaFFf+KeIZgwckyLgqPMC3Js+Esaw9qQiTQQIhAK9pmJXbX4ZX6XuZI+9poDH0pwdM24f6pJuzjruAXJpR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3344},"main":"yin.js","type":"module","engines":{"node":">=18"},"exports":{".":"./yin.js","./atom":"./atom.js","./package.json":"./package.json"},"gitHead":"ec433d994b46b21f9e40801ee1383b1280977e83","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/pitch.git","type":"git","directory":"packages/pitch-yin"},"_npmVersion":"11.12.1","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pitch-yin_1.0.1_1783560302398_0.9763464067697012","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@audio/pitch-yin","version":"1.0.2","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/pitch-yin@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/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"dist":{"shasum":"0ca2b04f76f5006d82229ef71f2ca63b406736f7","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.2.tgz","fileCount":3,"integrity":"sha512-BFyapvi6RfRAofMTzMqlWsAA00yuIUvQdJXpLScRdz6pt8HOr5vBb8NjyoUJInMFfey+fmXKHeIYZCkyqG29mA==","signatures":[{"sig":"MEYCIQDlV5e+R1aCgMUUioUIRqEH3osuj3gwdnr97TNGodRHqwIhAL9PIblYWup6b11dA5/Uj+b6f+8OYdpup0tvOVOMFC97","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3349},"main":"yin.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./yin.js","./audio":"./audio.js","./package.json":"./package.json"},"gitHead":"8c28e4c546c0ed81ef59ad162dbb3f8213609cbe","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/pitch.git","type":"git","directory":"packages/pitch-yin"},"_npmVersion":"11.12.1","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pitch-yin_1.0.2_1783645124264_0.5532096637777195","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@audio/pitch-yin","version":"1.0.3","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/pitch-yin@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/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"dist":{"shasum":"73e7f0c1300f6244e8c8aa8e55e12e43bc603896","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.3.tgz","fileCount":4,"integrity":"sha512-UGI7a09XHe+OfHjRlM1zBtnVGPbtq/+OEbZHA9hDiw8YjuFe8GZu3KugU8B9BZgysUFc99EoCGlF6gQO7PjFRg==","signatures":[{"sig":"MEYCIQCUve0wX+XI4xcnXa+uqqSsbFlNPp7t9B2/PC/botINNQIhAPMSDjnS1KQ/Eagobs1yn34OAky1KedTjarZxXTC9KC0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4570},"main":"yin.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./yin.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"gitHead":"6c8b270f6cca0ec570bf9462fa22a5dac7170646","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/pitch.git","type":"git","directory":"packages/pitch-yin"},"_npmVersion":"11.12.1","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pitch-yin_1.0.3_1783701776231_0.2871826071221244","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@audio/pitch-yin","version":"1.0.4","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/pitch-yin@1.0.4","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/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"dist":{"shasum":"358b089810cda3fbc8c33a3702acaf90467479b8","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.4.tgz","fileCount":6,"integrity":"sha512-+sR9uZYVJyHjL9IAhYBNMbCDv0fnvO5ee71QmcOuOAMNwPA4xDAPm28Z19BreJHr0vkjSe/PwmIJ5Mf1K/f9wA==","signatures":[{"sig":"MEYCIQC4lGkr0MS0WuHciMveb/aU4AabL+bMBMARKwT8M7SU4AIhAKCGuxj/NzyfnCEbQ06pOKxyolyXc7AS4Qn5kt9VWEOT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6539},"main":"yin.js","type":"module","audio":"./audio.js","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./yin.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"c388499cb8107c4fdcc0e314410327655222b5b1","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/pitch.git","type":"git","directory":"packages/pitch-yin"},"_npmVersion":"11.12.1","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pitch-yin_1.0.4_1783731721771_0.6393977766247059","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@audio/pitch-yin","version":"1.0.5","description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","type":"module","sideEffects":false,"main":"yin.js","exports":{".":"./yin.js","./package.json":"./package.json","./audio":{"types":"./audio.d.ts","default":"./audio.js"}},"keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"license":"MIT","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/audiojs/pitch.git","directory":"packages/pitch-yin"},"homepage":"https://github.com/audiojs/pitch/tree/main/packages/pitch-yin","bugs":{"url":"https://github.com/audiojs/pitch/issues"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"types":"index.d.ts","audio":"./audio.js","funding":"https://github.com/sponsors/audiojs","gitHead":"6f1dd7c3ee6a4ec314f8a38102c45f42ea200848","_id":"@audio/pitch-yin@1.0.5","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-qYtpfznWJ0fEhBV1o/qC2YA0RCYS8AQFA/uNkhS6ul5irsFKYY+r65kPPm/kT82YD8mCZoHu+vuG6Yby6D/kfA==","shasum":"b1f712bf00032da9793d6d22f89ea24cdd4fbf2b","tarball":"https://registry.npmjs.org/@audio/pitch-yin/-/pitch-yin-1.0.5.tgz","fileCount":6,"unpackedSize":7758,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEvcLDPns+9tlInzUy+M9w1eQmOmvGFfLcx6Ctsz7hCcAiEA8yhCdfJrVOOCQFOBhbLAcvx4t0ssQHX08McGROH4QL4="}]},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pitch-yin_1.0.5_1787959384581_0.02108840868085493"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T19:45:43.062Z","modified":"2026-08-28T23:23:04.835Z","1.0.0":"2026-07-08T19:45:43.326Z","1.0.1":"2026-07-09T01:25:02.526Z","1.0.2":"2026-07-10T00:58:44.406Z","1.0.3":"2026-07-10T16:42:56.352Z","1.0.4":"2026-07-11T01:02:01.943Z","1.0.5":"2026-08-28T23:23:04.698Z"},"bugs":{"url":"https://github.com/audiojs/pitch/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/pitch/tree/main/packages/pitch-yin","keywords":["audio","dsp","pitch","pitch-detection","f0","yin"],"repository":{"type":"git","url":"git+https://github.com/audiojs/pitch.git","directory":"packages/pitch-yin"},"description":"YIN pitch detection (de Cheveigné & Kawahara, 2002)","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/pitch-yin [![npm](https://img.shields.io/npm/v/@audio/pitch-yin)](https://www.npmjs.com/package/@audio/pitch-yin) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nYIN pitch detection (de Cheveigné & Kawahara, 2002)\n\n```\nnpm install @audio/pitch-yin\n```\n\n```js\nimport yin from '@audio/pitch-yin'\n```\n\n**de Cheveigné & Kawahara, 2002.** The reference algorithm for monophonic pitch estimation. Most cited, most tested, most robust.\n\n```js\nlet result = yin(samples, { fs: 44100 })\n// → { freq: 440.1, clarity: 0.97 }  or  null\n```\n\n| Param | Default | |\n|---|---|---|\n| `fs` | `44100` | Sample rate (Hz) |\n| `threshold` | `0.15` | CMND threshold — lower = stricter, fewer detections |\n| `minFreq` | — | Minimum frequency (Hz); also uses more of the frame for low pitches |\n| `maxFreq` | — | Maximum frequency (Hz) |\n\nPass the expected range when known: `yin(samples, { fs, minFreq: 60, maxFreq: 520 })`. Besides rejecting out-of-range results, `minFreq` lets YIN use a longer comparison window and improves low-pitch detection near onsets.\n\n**Use when:** General-purpose monophonic pitch tracking — speech, singing, solo instruments. The most reliable choice when in doubt.<br>\n**Not for:** Polyphonic audio (returns dominant or null), real-time with hard latency budgets (needs full window).<br>\n**Ref:** de Cheveigné & Kawahara, [\"YIN, a fundamental frequency estimator for speech and music\"](https://doi.org/10.1121/1.1458024), JASA 2002.<br>\n**Complexity:** $O(N^2/4)$ — two nested passes over half the window.\n\n---\n\nPart of [@audio/pitch](https://github.com/audiojs/pitch) — the pitch family umbrella. This README is generated from the umbrella docs.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md"}