# poly-peach

> A targeted pitch-detection library for node in the browser

Latest version **0.5.1** (published 2023-10-10) · LGPL license · 0 weekly downloads

## Install

```sh
npm install poly-peach
pnpm add poly-peach
yarn add poly-peach
bun add poly-peach
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2023-10-10 |
| First published | 2023-10-10 |
| Weekly downloads | 0 |
| License | LGPL |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chris Spencer |
| Maintainers | chrisspen |
| Keywords | pitch, frequency, detector, detect, detection, find, polyphonic, music, audio |

## Links

- npm: https://www.npmjs.com/package/poly-peach
- Repository: https://gitlab.com/chrisspen/poly-peach
- Homepage: https://gitlab.com/chrisspen/poly-peach#readme
- Issues: https://gitlab.com/chrisspen/poly-peach/issues
- npm.io page: https://npm.io/package/poly-peach

## Recent versions

- 0.5.1 (latest) — 2023-10-10

## README

[![Pipeline Status](https://gitlab.com/chrisspen/poly-peach/badges/master/pipeline.svg)](https://gitlab.com/chrisspen/poly-peach/commits/master)

# Poly Peach

A targeted [polyphonic](https://en.wikipedia.org/wiki/Polyphony) pitch detection library for Javascript.

Given a set of specific [musical notes](https://en.wikipedia.org/wiki/Musical_note) to listen for, this algorithm
detects when they're present in an audio sample.

# Implementation

The algorithm works by calculating the FFT of an audio sample and aggregating
the signal strengths for frequency bandwidths of each musical note.

Then, for each note it's listening for, it calculates the notes corresponding to the first N harmonics,
and compares an expected signature for these notes to the sample.

If the error is below a given threshold, then the note is reported as found.

# Development

The package is structured in three parts:

1. The C++ code that quickly calculates the Fast Fourier Transformation
to construct musical note frequency spectrum.
2. The Emscripten wrapper to convert the C++ code to WASM.
3. The Node.js code to present a high-level interface.

Build:

To compile the C++ and WASM wrapper, run:

    ./build.sh

Run tests:

    npm run test

or:

    mocha

    mocha -g 'test name'

To publish:

    tsc
    npm login
    npm publish

---
_Source: https://npm.io/package/poly-peach · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
