open-index/open-npm huggingface dataset:
npm package: @playfulcorgi/node-transpile
Description: Packages Babel files into runnable Node.js code using [Webpack](https://webpack.js.org/).
Latest version: 1.2.1

# node-transpile

Packages Babel files into runnable Node.js code using [Webpack](https://webpack.js.org/).

The goal is to have an incredibly simple way of generating Node.js projects using the newest and sometimes experimental JavaScript syntax. Also, using Webpack and Babel for Node.js packages is a little different than for front-end packages. For example, there's no need to support older browsers. node-transpile already contains an appropriate configuration for this task.

## Quickstart

First, add `node-transpile` as a dev dependency to a Node.js project:
```terminal
npm install --save-dev node-transpile
```
or
```terminal
yarn add --dev node-transpile
```

Second, inside package.json, add scripts:
```json
"scripts": {
  "build": "node-transpile build",
  "watch": "node-transpile watch"
}
```

Third, inside package.json set `main`:
```json
"main": "dist/index.js"
```

With the above configuration, node-transpile will process src/index.js into dist/index.js.

## Custom Webpack Configuration

Create node-transpile.js, which will export a function. This function will be called by node-transpile to receive a complete Webpack configuration object. As the first parameter, it will receive whatever base configuration node-transpile created for itself.

For example, to add Webpack [aliases](https://webpack.js.org/configuration/resolve/#resolve-alias) for easier module resolution:
```js
const { resolve } = require('path')
const set = require('lodash/set')
const baseDirectoryPath = __dirname
const srcDirectoryPath = resolve(baseDirectoryPath, 'src')

module.exports = (options) => {
  set(options, 'resolve.alias.fu', resolve(srcDirectoryPath, 'functional-utils/'))
  set(options, 'resolve.alias.utils$', resolve(srcDirectoryPath, 'functional-utils/utils.js'))
}
```
npm package: @playfulplatypus/core
Description: Reserved namespace for the PlayfulPlatypus project. Official release coming soon.
Author: Playful Platypus LLC
Latest version: 0.0.1

# PlayfylPlatypus

Reserved namespace for the PlayfylPlatypus librariues.  
Official npm packages will be published here soon.

👉 Website: [https://playfulplatypus.com](https://playfulplatypus.com)  
👉 Maintained by Playful Platypus LLC
npm package: @playground-sessions/amdf-js
Description: Pure-JS Average Magnitude Difference Function, no WASM, no frills. Intentionally naive for learning. Adjustable frame sizes, downsampling toggles
Author: Playground Sessions
Latest version: 0.2.1

# @playground-sessions/amdf-js

A pure JavaScript implementation of the Average Magnitude Difference Function (AMDF) for pitch detection. This package provides a straightforward, educational implementation with adjustable frame sizes and downsampling options.

## Features

- Pure JavaScript implementation (no WebAssembly)
- Configurable frame sizes and downsampling factors
- Adjustable frequency range
- Clarity metric for pitch confidence
- TypeScript types included
- Zero dependencies

## Installation

```bash
npm install @playground-sessions/amdf-js
```

## Usage

```javascript
import { AmdfPitchDetector } from '@playground-sessions/amdf-js';

// Create a detector with custom options
const detector = new AmdfPitchDetector({
  frameSize: 2048,          // Must be a power of 2
  sampleRate: 44100,        // Audio sample rate
  minFrequency: 50,         // Lowest frequency to detect
  maxFrequency: 2000,       // Highest frequency to detect
  downsampleFactor: 1       // Optional downsampling (must be power of 2)
});

// Analyze a frame of audio
const frame = new Float32Array(2048); // Your audio data here
const result = detector.analyze(frame);
console.log(`Frequency: ${result.frequency} Hz`);
console.log(`Clarity: ${result.clarity}`);
```

## Demo

A live demo is included in the package. To run it:

1. Clone this repository
2. Run `npm install`
3. Run `npm run dev`
4. Open your browser and try the interactive pitch detector

## How it Works

The Average Magnitude Difference Function (AMDF) is a time-domain pitch detection algorithm that works by:

1. Comparing a signal with delayed versions of itself
2. Finding the delay (lag) that produces the minimum difference
3. Converting that lag into a frequency

The implementation is intentionally straightforward for learning purposes, making it a good starting point for understanding pitch detection algorithms.

## Options

- `frameSize`: Size of the analysis frame (default: 2048)
- `sampleRate`: Sample rate of the audio (default: 44100)
- `minFrequency`: Minimum frequency to detect (default: 50 Hz)
- `maxFrequency`: Maximum frequency to detect (default: 2000 Hz)
- `downsampleFactor`: Factor to downsample by (default: 1)

## Contributing

Contributions are welcome! This is an educational project built during the WebAudio Pitch Jam '25.
npm package: @playground-sessions/basic-pitch
Description: Experimental browser pitch detection sandbox (naive autocorrelation/AMDF/FFT). My first try at Web Audio pitch detection, rough
Author: Playground Sessions
Latest version: 0.1.0

# @playground-sessions/basic-pitch

A sandbox implementation of three different pitch detection algorithms for comparison:
1. Autocorrelation (time-domain)
2. Average Magnitude Difference Function (AMDF)
3. Fast Fourier Transform (FFT) with Harmonic Product Spectrum

This is kind of a failure. I didn't get it to work.

## Features

- Three different pitch detection methods in one package
- Compare algorithms side-by-side
- Interactive demo with real-time visualization
- TypeScript types included
- Zero dependencies

## Installation

```bash
npm install @playground-sessions/basic-pitch
```

## Usage

```javascript
import {
  AutocorrelationPitchDetector,
  AmdfPitchDetector,
  FftPitchDetector,
  CombinedPitchDetector
} from '@playground-sessions/basic-pitch';

// Use individual detectors
const detector = new AutocorrelationPitchDetector({
  frameSize: 2048,
  sampleRate: 44100,
  minFrequency: 50,
  maxFrequency: 2000
});

// Or use the combined detector that picks the best result
const combined = new CombinedPitchDetector({
  frameSize: 2048,
  sampleRate: 44100
});

// Analyze audio frames
const frame = new Float32Array(2048); // Your audio data here
const result = detector.analyze(frame);
console.log(`Frequency: ${result.frequency} Hz`);
console.log(`Confidence: ${result.confidence}`);
console.log(`Method: ${result.method}`);
```

## Demo

An interactive demo is included that lets you compare all three methods in real-time:

1. Clone this repository
2. Run `npm install`
3. Run `npm run dev`
4. Open your browser and try the pitch detector

## How it Works

### Autocorrelation Method
- Compares the signal with delayed versions of itself
- Finds periodic patterns in the time domain
- Good for clean, monophonic signals

### AMDF Method
- Similar to autocorrelation but uses differences instead of products
- Can be more robust to noise in some cases
- Computationally efficient

### FFT Method
- Transforms the signal to the frequency domain
- Uses Harmonic Product Spectrum for better accuracy
- Good for complex tones with strong harmonics

## Options

All detectors accept these options:
- `frameSize`: Size of the analysis frame (default: 2048)
- `sampleRate`: Sample rate of the audio (default: 44100)
- `minFrequency`: Minimum frequency to detect (default: 50 Hz)
- `maxFrequency`: Maximum frequency to detect (default: 2000 Hz)

## Contributing

This is an educational project built during the WebAudio Pitch Jam '25. Contributions are welcome!
npm package: @playground-sessions/chroma-chips
Description: Twelve-bin chroma features for stabilizing pitch estimates and note labeling. Demonstrates mixing spectral features with a time-domain pitch guess to reduce octave errors on guitar/voice.
Latest version: 0.1.1

# Chroma Chips

Twelve-bin chroma features for stabilizing pitch estimates and note labeling. This library demonstrates mixing spectral features with a time-domain pitch guess to reduce octave errors on guitar/voice.

## Features

- Compute 12-bin chroma features from FFT magnitude data
- Refine time-domain pitch estimates using spectral information
- Handle frequency ranges from A1 (55 Hz) to C7 (2093 Hz)
- Browser-compatible with TypeScript support

## Installation

```bash
npm install @playground-sessions/chroma-chips
```

## Usage

```typescript
import { ChromaFeature } from '@playground-sessions/chroma-chips';

// Initialize with audio context settings
const chromaFeature = new ChromaFeature({
    sampleRate: 44100,
    fftSize: 2048
});

// Compute chroma features from FFT magnitudes
const magnitudes = new Float32Array(1024); // Your FFT magnitude data
const chroma = chromaFeature.computeChroma(magnitudes, Date.now());

// Refine a pitch estimate using chroma features
const pitchGuess = {
    frequency: 440, // Hz
    confidence: 0.5 // 0-1
};

const refinedPitch = chromaFeature.refinePitch(chroma, pitchGuess);
console.log(`Refined pitch: ${refinedPitch.frequency} Hz (confidence: ${refinedPitch.confidence})`);
```

## Demo

Open `demo.html` in a web browser to try out the library with live microphone input. The demo shows:

- Real-time pitch detection with chroma refinement
- Visual representation of the chroma bins
- Frequency spectrum visualization
- Note name and confidence display

## How It Works

1. **Chroma Feature Extraction**
   - FFT magnitude spectrum is mapped to 12 pitch classes (C through B)
   - Each frequency bin contributes to its corresponding pitch class
   - Features are normalized to sum to 1.0

2. **Pitch Refinement**
   - Initial pitch guess is converted to a pitch class
   - Chroma features are used to validate or adjust the guess
   - Nearby pitch classes are checked for stronger evidence
   - Confidence is adjusted based on spectral evidence

This approach helps reduce common pitch detection errors, particularly octave errors in complex signals like guitar or voice.

## API Reference

### `ChromaFeature`

#### Constructor

```typescript
constructor(options: ChromaOptions)
```

Options:
- `sampleRate`: Audio sample rate in Hz
- `fftSize`: Size of the FFT (must match your magnitude data)
- `minFrequency`: Optional minimum frequency (default: 55 Hz)
- `maxFrequency`: Optional maximum frequency (default: 2093 Hz)

#### Methods

```typescript
computeChroma(magnitudes: Float32Array, timestamp: number): ChromaVector
```
Computes chroma features from FFT magnitude data.

```typescript
refinePitch(chroma: ChromaVector, pitchGuess: PitchGuess): PitchGuess
```
Refines a pitch estimate using chroma features.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT
npm package: @playground-sessions/detune-calibrator
Description: Measures and stores device-specific detune/sample-rate quirks using a short reference tone, then applies a correction to your pitch readouts. Especially helpful on mobile browsers and Bluetooth paths. (Another Pitch Jam '25 toy project.)
Latest version: 0.0.3

Measures and stores device-specific detune/sample-rate quirks using a short reference tone, then applies a correction to your pitch readouts. Especially helpful on mobile browsers and Bluetooth paths. (Another Pitch Jam '25 toy project.)
npm package: @playground-sessions/hps-detector
Description: Harmonic Product Spectrum via FFT for pitch detection. Includes side-by-side graphs to compare peak picking strategies and shows that HPS can be more robust on rich tones.
Latest version: 0.1.1

Harmonic Product Spectrum via FFT for pitch detection. Includes side-by-side graphs to compare peak picking strategies and shows that HPS can be more robust on rich tones.
npm package: @playground-sessions/mpm-pitch-worklet
Description: McLeod Pitch Method running inside an AudioWorkletNode with a ring buffer to the UI thread. Emits { frequency, confidence } events and a simple rolling contour for quick visual sanity checks.
Latest version: 0.2.9

McLeod Pitch Method running inside an AudioWorkletNode with a ring buffer to the UI thread. Emits { frequency, confidence } events and a simple rolling contour for quick visual sanity checks.
npm package: @playground-sessions/note-finder-ts
Description: Utility that turns raw audio into musical note names with configurable tuning (A4, temperaments) and returns { note, octave, cents }. Ships as ESM with TypeScript types and zero runtime deps.
Latest version: 0.1.1

Utility that turns raw audio into musical note names with configurable tuning (A4, temperaments) and returns { note, octave, cents }. Ships as ESM with TypeScript types and zero runtime deps.
npm package: @playground-sessions/pitch-simple
Description: A tiny, dependency-free tuner demo for the browser. Uses a straightforward autocorrelation window and exposes Hz, MIDI, and cents. Great as a first "hello, mic" for pitch work.
Latest version: 0.2.2

A tiny, dependency-free tuner demo for the browser. Uses a straightforward autocorrelation window and exposes Hz, MIDI, and cents. Great as a first "hello, mic" for pitch work.
npm package: @playground-sessions/yin-wasm
Description: YIN pitch detection compiled to WebAssembly with a minimal JS wrapper. Ships a playground page and typed APIs so you can swap thresholds and hop sizes and see the effect in real time. (Built during WebAudio Pitch Jam '25.)
Author: Playground Sessions
Latest version: 0.1.5

YIN pitch detection compiled to WebAssembly with a minimal JS wrapper. Ships a playground page and typed APIs so you can swap thresholds and hop sizes and see the effect in real time. (Built during WebAudio Pitch Jam '25.)
npm package: @playgroundai/trpc-server
Description: The tRPC server library
Author: KATT
Latest version: 11.1.2-playground.0

<p align="center">
  <a href="https://trpc.io/"><img src="https://assets.trpc.io/icons/svgs/blue-bg-rounded.svg" alt="tRPC" height="75"/></a>
</p>

<h3 align="center">tRPC</h3>

<p align="center">
  <strong>End-to-end typesafe APIs made easy</strong>
</p>

<p align="center">
  <img src="https://assets.trpc.io/www/v10/v10-dark-landscape.gif" alt="Demo" />
</p>

# `@trpc/server`

> Create tRPC routers and connect them to a server.

## Documentation

Full documentation for `@trpc/server` can be found [here](https://trpc.io/docs/router)

## Installation

```bash
# npm
npm install @trpc/server

# Yarn
yarn add @trpc/server

# pnpm
pnpm add @trpc/server

# Bun
bun add @trpc/server
```

We also recommend installing `zod` to validate procedure inputs.

## Basic Example

```ts
import { initTRPC } from '@trpc/server';
import {
  CreateHTTPContextOptions,
  createHTTPServer,
} from '@trpc/server/adapters/standalone';
import { z } from 'zod';

// Initialize a context for the server
function createContext(opts: CreateHTTPContextOptions) {
  return {};
}

// Get the context type
type Context = Awaited<ReturnType<typeof createContext>>;

// Initialize tRPC
const t = initTRPC.context<Context>().create();

// Create main router
const appRouter = t.router({
  // Greeting procedure
  greeting: t.procedure
    .input(
      z.object({
        name: z.string(),
      }),
    )
    .query(({ input }) => `Hello, ${input.name}!`),
});

// Export the app router type to be imported on the client side
export type AppRouter = typeof appRouter;

// Create HTTP server
const { listen } = createHTTPServer({
  router: appRouter,
  createContext,
});

// Listen on port 2022
listen(2022);
```