{"_id":"@audio/tune-snap","_rev":"5-f26f8cd58e5d6edcd0f88aa9cfe36ea9","name":"@audio/tune-snap","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@audio/tune-snap","version":"1.0.0","keywords":["audio","dsp","pitch-correction","autotune","tune"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/tune-snap@1.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"4295460e8244c8c61420e7f96e92c2407c23dabe","tarball":"https://registry.npmjs.org/@audio/tune-snap/-/tune-snap-1.0.0.tgz","fileCount":2,"integrity":"sha512-iZkaSZp/1bMMpMaBjGBR03WJp+ZEvCjFJ8kHfa0YpSir6P/U/rzsng2kGQV1auLcLSJgA9f/iDe9YjyQCnyXGQ==","signatures":[{"sig":"MEUCIGuMYtmF05vnqHEK5DFiJE/lL+zLDILHXXXWHNh4umi7AiEAihURgtVZq7eZV5maTKi4picAvBiShhhYTuC/Xac+ODM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3176},"main":"snap.js","type":"module","engines":{"node":">=18"},"exports":{".":"./snap.js","./package.json":"./package.json"},"gitHead":"1a24ac0658833e47ccb208623bf531046e666a98","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/note":"^1.0.0","@audio/pitch-yin":"^1.0.0","@audio/shift-psola":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tune-snap_1.0.0_1783540420284_0.9871074790583623","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@audio/tune-snap","version":"1.1.0","keywords":["audio","dsp","pitch-correction","autotune","tune"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/tune-snap@1.1.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"atom":"./atom.js","dist":{"shasum":"bc0b8f61eb4ed668f6db69dd6c9bbc42421a5abc","tarball":"https://registry.npmjs.org/@audio/tune-snap/-/tune-snap-1.1.0.tgz","fileCount":3,"integrity":"sha512-DCw0ZGgYYV57hNMlN37xAoSuvX1Ch/gCAyRX5XJWVF3pjJKQ2L7dv0RLcRMWcmMmLTF/xqCCnyH1BEnptPMhSA==","signatures":[{"sig":"MEUCIEmywYDSYKFiV2XofpuxkL184dF5fo2KWQMFNutbCex1AiEAw9gTc0vnV+GuxQL42tMVajEUt2G0RVlbWyp1MzWBBIo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4924},"main":"snap.js","type":"module","engines":{"node":">=18"},"exports":{".":"./snap.js","./atom":"./atom.js","./package.json":"./package.json"},"gitHead":"b8b2e30b6d99ae6b011468696a29916217610011","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/note":"^1.0.0","@audio/pitch-yin":"^1.0.0","@audio/shift-psola":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tune-snap_1.1.0_1783631342552_0.6707466050732336","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@audio/tune-snap","version":"1.1.1","keywords":["audio","dsp","pitch-correction","autotune","tune"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/tune-snap@1.1.1","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"62e2dd228804683446748b1665a83c24a5450cda","tarball":"https://registry.npmjs.org/@audio/tune-snap/-/tune-snap-1.1.1.tgz","fileCount":3,"integrity":"sha512-DtDbWV+EhQjmZjR6/9y+yi+dAye0US0Fbv2EN78vPA4o6GAPMGavIeEFWVsaq1ak8lfmcAN2vO+7xKwVkOsZSQ==","signatures":[{"sig":"MEUCIQDLFq4iNZnee6Mh3IY3KdTbkZhmJsA48pTFxvjlvKOniwIgWtHhJymdNHOBUEZ2k2aUojBIfOtRl3kVH+DlgL8AzcQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4932},"main":"snap.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./snap.js","./audio":"./audio.js","./package.json":"./package.json"},"gitHead":"fb01f6490379acbaf3b32b9c1d76edcecf720321","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/note":"^1.0.0","@audio/pitch-yin":"^1.0.0","@audio/shift-psola":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tune-snap_1.1.1_1783645127866_0.01802268667932294","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@audio/tune-snap","version":"1.1.2","keywords":["audio","dsp","pitch-correction","autotune","tune"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/tune-snap@1.1.2","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"0e3f5cb57b434328dc0c438038f257676aadcbd7","tarball":"https://registry.npmjs.org/@audio/tune-snap/-/tune-snap-1.1.2.tgz","fileCount":4,"integrity":"sha512-pVlKKtkxH3pos3X2gUDoTOzIED0gYuk9zRZZEIC98IBGLylFWOZz0mrayiBRGL51f+zhQPTKn1f/12rYa4oSzw==","signatures":[{"sig":"MEQCID0H1nodvpjAinaOpH7vyM8QIkE0oDpODHqxMsr/r9teAiBcTnuvtt/hVL9+5Jxaz89aqzgFSI+8e6ZpIdhuEZ237g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6951},"main":"snap.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./snap.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"gitHead":"ebb182a1ba63baee7397c10c93e889fc9f57cfd2","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/note":"^1.0.0","@audio/pitch-yin":"^1.0.0","@audio/shift-psola":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tune-snap_1.1.2_1783701870827_0.6658691937477677","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@audio/tune-snap","version":"1.1.3","description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","type":"module","sideEffects":false,"main":"snap.js","exports":{".":"./snap.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"dependencies":{"@audio/pitch-yin":"^1.0.0","@audio/note":"^1.0.0","@audio/shift-psola":"^1.0.0"},"keywords":["audio","dsp","pitch-correction","autotune","tune"],"license":"MIT","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"types":"./snap.d.ts","audio":"./audio.js","repository":{"type":"git","url":"git+https://github.com/audiojs/tune.git","directory":"packages/tune-snap"},"funding":"https://github.com/sponsors/audiojs","gitHead":"6523156fb0284e40f8d6456e9d98021bb9fd26dd","_id":"@audio/tune-snap@1.1.3","bugs":{"url":"https://github.com/audiojs/tune/issues"},"homepage":"https://github.com/audiojs/tune#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-o3FB4j5P57EPA6V0akdDDD6Hs1ekB1to7/udkQbe2zQAaCuE8RieIr9ZHyH+pACyZ5bSicUe6hP3gbtpzSqwkQ==","shasum":"fd98e60a099be89978a6e51ce86c58304d1d77f5","tarball":"https://registry.npmjs.org/@audio/tune-snap/-/tune-snap-1.1.3.tgz","fileCount":6,"unpackedSize":10645,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDGOK0bALnyCpEXy8DZbLO73KBwlxA3zCL/+VCM0Oj9yQIhAIfuX4jcPJCS05RfmKbLuvsSZKqFyMqm02wFjtJc9pLv"}]},"_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/tune-snap_1.1.3_1783731971722_0.45653138607002997"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T19:53:40.154Z","modified":"2026-07-11T01:06:12.087Z","1.0.0":"2026-07-08T19:53:40.405Z","1.1.0":"2026-07-09T21:09:02.666Z","1.1.1":"2026-07-10T00:58:48.007Z","1.1.2":"2026-07-10T16:44:30.947Z","1.1.3":"2026-07-11T01:06:11.918Z"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","keywords":["audio","dsp","pitch-correction","autotune","tune"],"description":"Pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class, per-note v1)","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/tune-snap [![npm](https://img.shields.io/npm/v/@audio/tune-snap)](https://www.npmjs.com/package/@audio/tune-snap) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nScale/key pitch correction — YIN track → note segments → scale snap → PSOLA retune (Auto-Tune class)\n\n```\nnpm install @audio/tune-snap\n```\n\n```js\nimport snap from '@audio/tune-snap'\n```\n\nYIN F0 tracking per frame, segmented into note runs (a run splits wherever pitch jumps more than 80¢ from its running median), each segment's median pitch snapped to the nearest note in `scale`/`root`, then shifted there with PSOLA and crossfaded back over the dry signal. v1 corrects per note segment — no intra-note glide/portamento; unvoiced audio passes through untouched.\n\n```js\nsnap(data, { scale: 'major', root: 0 })              // classic Auto-Tune-style scale correction\nsnap(data, { scale: 'chromatic', strength: 0.5 })    // half-strength chromatic snap (\"natural\" mode)\n```\n\n| Param | Default | |\n|---|---|---|\n| `fs` | `44100` | Hz |\n| `scale` | `'chromatic'` | `'chromatic'`, `'major'`, `'minor'`, `'harmonic-minor'`, `'melodic-minor'`, `'pentatonic-major'`, `'pentatonic-minor'`, `'blues'`, `'dorian'`, `'mixolydian'`, `'whole'` |\n| `root` | `0` | 0–11, root note (0 = C) |\n| `a4` | `440` | Hz, tuning reference |\n| `tolerance` | `8` | cents; segments already this close to a scale note are left alone |\n| `strength` | `1` | 0–1, correction amount (0 = no shift, 1 = full snap) |\n| `frameSize` | `2048` | YIN analysis frame |\n| `hop` | `512` | frame hop |\n| `fade` | `0.01` | s, crossfade at each segment boundary |\n\nBuilt on [`@audio/pitch-yin`](https://github.com/audiojs/pitch-yin) (F0 tracking) and [`@audio/shift-psola`](https://github.com/audiojs/shift-psola) (pitch shifting). The melody-following complement is [`@audio/tune-midi`](https://github.com/audiojs/tune-midi), which retunes to a reference note guide instead of a scale.\n\n**Use when:** vocal/instrument scale correction, Auto-Tune-style effects.<br>\n**Not for:** retuning to a specific melody/guide track — use `tune-midi`.\n\n---\n\nPart of [@audio/tune](https://github.com/audiojs/tune) — the tune family umbrella.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md","homepage":"https://github.com/audiojs/tune#readme","repository":{"type":"git","url":"git+https://github.com/audiojs/tune.git","directory":"packages/tune-snap"},"bugs":{"url":"https://github.com/audiojs/tune/issues"}}