{"_id":"@audio/saturate-waveshaper","_rev":"6-d1fa4babf0c84d55bbc0da785222f101","name":"@audio/saturate-waveshaper","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@audio/saturate-waveshaper","version":"1.0.0","keywords":["audio","dsp","saturation","waveshaper"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/saturate-waveshaper@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":"ac3657b96fa5f71a5a90e60d79507cb77ed10077","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.0.0.tgz","fileCount":2,"integrity":"sha512-vmtbY6HsPmReUh1uv0DCyurz9q/SFb3SnewN4iMarRQikvBxmA1pgCBX2hFcnqMF0VTRVy2Dgy/Vg9Gpz3kaqg==","signatures":[{"sig":"MEUCICm92iU8T4ZZYcOgFpdl8qUbGBCZNcQ+Ye44u2zS+0wJAiEAzr2DRRL+EUSXH9WYsWR4KkksczVqgtAMRD6iPg3Dj3Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1011},"main":"waveshaper.js","type":"module","engines":{"node":">=18"},"exports":{".":"./waveshaper.js","./package.json":"./package.json"},"gitHead":"d66dbb92515c68d654294a7500febf8fdac9f627","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Waveshaper — normalized tanh or custom curve, oversampled","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/saturate-core":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/saturate-waveshaper_1.0.0_1783540325482_0.9063492219513545","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/saturate-waveshaper","version":"1.0.1","keywords":["audio","dsp","saturation","waveshaper"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/saturate-waveshaper@1.0.1","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"dist":{"shasum":"e77585c0f1eba26c0bdef562cb5cdfeee952c31e","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.0.1.tgz","fileCount":3,"integrity":"sha512-pOoWLcyCPv1EQYTHd7gxaUWYMdvtiFmDXMlx5IWiiwkF0ZhMQ+R/IZ9ErBN1xW5c9kP4NWACfALCTZi+kw91ZQ==","signatures":[{"sig":"MEUCIQD6XSKgnAJh9izSWEE0dkv4kO5VVSC60FLoG8yjyNGH/AIgTj8XPh2YjFKqBO14IXjhPXSTpDcjdTFfM0B7YSx1BzQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2054},"main":"waveshaper.js","type":"module","engines":{"node":">=18"},"exports":{".":"./waveshaper.js","./package.json":"./package.json"},"gitHead":"18a6fb1ccc06c55f4297e6a4f60c5eff28ab0a8d","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Waveshaper — normalized tanh or custom curve, oversampled","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/resample-sinc":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/saturate-waveshaper_1.0.1_1783623903831_0.6832775680349283","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@audio/saturate-waveshaper","version":"1.1.0","keywords":["audio","dsp","saturation","waveshaper"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/saturate-waveshaper@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":"6e9a20b63982760b4750a363e60444aa9ec81822","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.1.0.tgz","fileCount":4,"integrity":"sha512-zPOImo2l+jFQULqnlZx2/XSjBaumO2ZnkAylFGyuJT2wf5XO4YACBLIbAsxgX6gD+S1l0lENBdicEE+qq4fN3A==","signatures":[{"sig":"MEUCIQDhGbggOhnICK4mvopConnc9Lj9YfHArdfriXb+SKpItQIgN0pFA20ZHuo1mx7X7Pv/zPX+QnpnoEXMXj2mUu2v4hE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2943},"main":"waveshaper.js","type":"module","engines":{"node":">=18"},"exports":{".":"./waveshaper.js","./atom":"./atom.js","./package.json":"./package.json"},"gitHead":"4eb16d6abc147239b76587018719aed8ea9bbdb0","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Waveshaper — normalized tanh or custom curve, oversampled","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/resample-sinc":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/saturate-waveshaper_1.1.0_1783635173635_0.7277129395386279","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@audio/saturate-waveshaper","version":"1.1.1","keywords":["audio","dsp","saturation","waveshaper"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/saturate-waveshaper@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":"de9fccf019064c4225d5a2a6e1429472a35afbcc","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.1.1.tgz","fileCount":4,"integrity":"sha512-PkH+9TeZ2elN07qJxIPKRB7FRodCekUy+RZc/+DWK7AK6FWXDrmIwcC+/oHtSkaTJNvvKLxu4v5o5KKlxGk4fg==","signatures":[{"sig":"MEQCIFaeuL/I8yFPW+2+I1O6koh2vQTXRA13Fr2r1acmzKmrAiBs9mtiiLZmYCcXwTHd+pC/l+gcOVy4Bb7c1yqsLJQf9A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2949},"main":"waveshaper.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./waveshaper.js","./audio":"./audio.js","./package.json":"./package.json"},"gitHead":"dcd47d2bf50c850b504a9e771ff4f9ed7472530e","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Waveshaper — normalized tanh or custom curve, oversampled","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/resample-sinc":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/saturate-waveshaper_1.1.1_1783645034219_0.30228842950468326","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@audio/saturate-waveshaper","version":"1.1.2","keywords":["audio","dsp","saturation","waveshaper"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/saturate-waveshaper@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":"f0a18ad6086eb301f559d1f9f051aaa616fae430","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.1.2.tgz","fileCount":5,"integrity":"sha512-SnpnVz/f4MZIII+4p65cbX9Ly4fl0OAkJR0pVP8eqgk+rggXd9cThd7ZkXR+fkxt8qKs6UeVG5HogrvFCCdOOw==","signatures":[{"sig":"MEQCIAwPpjrm47A7VCYpR0USpZrhZmERCWaUk4Qr/bZn8yU2AiBTr3kYZa3wmcTLD3Ehse9YtGDIcJB+luKXgXUmGIrXoQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4277},"main":"waveshaper.js","type":"module","audio":"./audio.js","engines":{"node":">=18"},"exports":{".":"./waveshaper.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"gitHead":"b5ad7689b2358b09a03cc5eeb458308711a01cce","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"_npmVersion":"11.12.1","description":"Waveshaper — normalized tanh or custom curve, oversampled","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/resample-sinc":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/saturate-waveshaper_1.1.2_1783701797563_0.07726640177282107","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@audio/saturate-waveshaper","version":"1.1.3","description":"Waveshaper — normalized tanh or custom curve, oversampled","type":"module","sideEffects":false,"main":"waveshaper.js","exports":{".":"./waveshaper.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"dependencies":{"@audio/resample-sinc":"^1.0.0"},"keywords":["audio","dsp","saturation","waveshaper"],"license":"MIT","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"audio":"./audio.js","repository":{"type":"git","url":"git+https://github.com/audiojs/saturate.git","directory":"packages/saturate-waveshaper"},"funding":"https://github.com/sponsors/audiojs","types":"waveshaper.d.ts","gitHead":"8e5a2f210f134ccb055e9ca88a40c255bcf4985d","_id":"@audio/saturate-waveshaper@1.1.3","bugs":{"url":"https://github.com/audiojs/saturate/issues"},"homepage":"https://github.com/audiojs/saturate#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-1dvq45gvy5qr44yG6V4M3k4FYtxXt3QbO6JeNxS7F2NMkXKYYcFSBbHrmXQxEzb33pgtGleIG/eEGp3yPqgSnA==","shasum":"b36e17450f1471d2d655c2b517b59a39aaf5dd46","tarball":"https://registry.npmjs.org/@audio/saturate-waveshaper/-/saturate-waveshaper-1.1.3.tgz","fileCount":7,"unpackedSize":7131,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDUz72BREtwmLBnjLq7jzzGwSVNh9aGdChqZ+nSMIsABAiEAlxVHyT2KSFJRDcjnOx7rXVdk2MDulL5QdYvd68HeLr0="}]},"_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/saturate-waveshaper_1.1.3_1783731762694_0.3825647792306919"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T19:52:05.339Z","modified":"2026-07-11T01:02:42.962Z","1.0.0":"2026-07-08T19:52:05.613Z","1.0.1":"2026-07-09T19:05:04.017Z","1.1.0":"2026-07-09T22:12:53.766Z","1.1.1":"2026-07-10T00:57:14.354Z","1.1.2":"2026-07-10T16:43:17.700Z","1.1.3":"2026-07-11T01:02:42.844Z"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","keywords":["audio","dsp","saturation","waveshaper"],"description":"Waveshaper — normalized tanh or custom curve, oversampled","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/saturate-waveshaper [![npm](https://img.shields.io/npm/v/@audio/saturate-waveshaper)](https://www.npmjs.com/package/@audio/saturate-waveshaper) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nWaveshaper — normalized tanh or custom curve, oversampled\n\n```\nnpm install @audio/saturate-waveshaper\n```\n\n```js\nimport waveshaper from '@audio/saturate-waveshaper'\n```\n\nApplies a memoryless transfer function to every sample — normalized `tanh(drive·x)` by default, or your own `curve` function. Oversampled (windowed-sinc up → shape → windowed-sinc down) so harmonics pushed above Nyquist by the nonlinearity fold back as inaudible energy instead of audible aliasing, not a naive per-sample waveshaper.\n\n```js\nwaveshaper(data, { drive: 4, fs: 44100 })\nwaveshaper(data, { curve: x => x - x ** 3 / 3, fs: 44100 })  // custom transfer\n```\n\n| Param | Default | |\n|---|---|---|\n| `drive` | `2` | pre-gain into the tanh curve (ignored when `curve` is set) |\n| `curve` | `x => tanh(drive·x)/tanh(drive)` | custom `(x: number) => number` transfer function, applied at the oversampled rate |\n| `fs` | `44100` | sample rate |\n| `oversample` | `4` | oversample factor; `1` disables oversampling (naive, aliased) |\n| `mix` | `1` | 0..1 — wet/dry blend |\n\n**Mutates `data` in place** and returns it (same array reference, not a copy). `mix: 0` is an exact passthrough — verified bit-close (`<1e-6`) in the family test suite.\n\n**Use when:** you need a specific custom transfer curve, or a clean tanh baseline without a particular harmonic-symmetry signature.<br>\n**Not for:** a specific circuit-modeled color — use `tube` (even harmonics), `transistor` (odd harmonics), or `tape` (HF-rolled tanh) for those.\n\n---\n\nPart of the [@audio/saturate](https://github.com/audiojs/saturate) family.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md","homepage":"https://github.com/audiojs/saturate#readme","repository":{"type":"git","url":"git+https://github.com/audiojs/saturate.git","directory":"packages/saturate-waveshaper"},"bugs":{"url":"https://github.com/audiojs/saturate/issues"}}