Skip to content

[P0] Synthesize phase-continuous pitch and volume envelopes #11

Open

Description

@nosam1998

Parent plan: #1
Priority / gate: P0 / M2
Requirement: F14 in the PRD
Design: Technical design
Depends on: #7, #8, #10, #9

Outcome

Produce sound and reusable functions from the drawn carrier, pitch curve, and gain curve without pitch errors or lost dynamics.

Scope

  • Implement per-oscillator accumulated phase θ(t) = θ0 + integral of f(t) in cycles and source s(t) = g(t)·p(frac(θ(t))).
  • Use stable analytic integration of log-linear pitch segments, phase-prefix values at knots, and linear gain interpolation.
  • Compare the chosen native-node or custom renderer against the analytic reference, including fast modulation and sideband bandwidth behavior.
  • Remove carrier DC before modulation; apply headroom once over the completed mix and preserve intentional gain dynamics/silent intervals.
  • Integrate revision/cancellation, loop-seam policy, actual sample-rate handling, and shared preview/offline/code-export settings.
  • Expose phase/state and pre-final-output rendering interfaces that [P1] Modulate sounds with imported audio or saved clips #20 can extend with an effective-frequency stream or sampled carrier; retain the analytic log-linear reference for unmodified drawn lanes. Full clip-driven integration belongs to F18.

Acceptance criteria

  • Constant pitch/gain reproduce the equivalent unmodulated oscillator; sine-carrier sweeps match the declared integrated phase.
  • Phase is continuous across pitch knots and render chunks; near-equal frequency endpoints use a numerically stable constant-frequency limit.
  • The implementation never substitutes f(t)·t for integrated phase, and exported JS/Python evaluators use the same interpolation/integration contract.
  • All-zero gain renders exact silence; silent spans have only the explicitly documented finite filter/transition tails, without post-envelope mean subtraction or normalization refilling them.
  • Fast pitch/gain changes and near-Nyquist harmonics pass spectral tests against the oversampled reference under the recorded bandwidth policy.
  • Maximum four-voice compositions preserve relative gain envelopes, obey peak/resource limits, and meet the measured render budget or an explicitly revised requirement.
  • Loop boundaries and finite initial phase are explicit in preview and exported metadata; stale jobs cannot restart stopped audio.

Validation

Constant/octave/log-frequency sweep fixtures, near-zero slope and knot-boundary integrals, chunked-versus-whole evaluation, zero-gain and attack/decay tests, modulation spectrum comparisons, and preview/export parity.

Boundaries

Unbounded modulation bandwidth and bit-identical device output are not promised; any rendered changes must be visible and reproducible.

Implementation evidence

Phase-integrated pitch/gain rendering and complete source functions are implemented. Analytic sweeps, zero gain, octave and mixing fixtures pass. Maximum-workload performance qualification remains open in #16.

Merged work: #23, #28, #29.

Validated CI run · Validation report. The report arrives with the final documentation PR; numerical/browser logs already exist. Release-wide human acceptance and the recorded performance/memory gaps remain explicit in #15 and #16.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions