quantize pitch
Problem it solves
You are generating dynamic pitches for player movement or combos and want the notes to lock onto clean, stepped musical intervals.
What this block does
Rounds a pitch frequency to the nearest step value so tones sound coherent and chiptune-like.
The block
Block ID: retro_quantize_pitch
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| pitch | number | 440 | The raw pitch frequency in Hertz. |
| step | number | 50 | The rounding step interval. |
Returns
number — The quantized pitch rounded to the closest step.
Example
let roundedPitch = Retro.quantizePitch(432, 50) console.log(roundedPitch)
Add the extension
Add github:CrzLe0723/RetroFx to your project, or open: Import RetroFx.