Skip to content

Pitch Staircase: Frequency multiplies beyond audible range ($10^{38}\text{ Hz}$), breaking stair layout and audio #8332

Description

@karankumar1106

Describe the Bug

In the Pitch Staircase widget (pitchstaircase.js), repeatedly clicking a stair with custom ratios (e.g. 7/4) causes frequencies to multiply exponentially up to $10^{38}\text{ Hz}$ (or drop below $10^{-38}\text{ Hz}$).

Observed Behavior

  1. The stair table cell width shrinks into a 20px sliver.
  2. Text overflows with scientific notation (1.044345e+38 C10).
  3. Tone.js audio synth fails to play frequencies beyond the Nyquist / audible limit.

Proposed Solution

Add audible range validation in _dissectStair() ($20\text{ Hz} \le f \le 20,000\text{ Hz}$) with user notification feedback when boundaries are reached, accompanied by Jest unit test coverage.

I would be happy to submit a PR to fix this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugFixes a bug or incorrect behavior

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions