Skip to content

[P1] Export WAV, samples, coefficients, and executable signal functions #13

Closed

Description

@nosam1998

Parent plan: #1
Priority / gate: P1 / M2
Requirement: F09 in the PRD
Design: Technical design
Depends on: #5, #6, #7, #8, #11, #9

Outcome

Let users take the audible result and its mathematical definition into other tools with enough metadata to reproduce them.

Scope

  • Expose a shared finite pre-monitor render for soundboard caching. Per-sound WAV/project downloads use the saved snapshot and existing adapters; apply the chosen master monitor gain once at WAV output, without baking it into the cached clip.
  • Encode mono 16-bit PCM WAV at 44.1/48 kHz; periodic export uses a finite duration, default 2 seconds and maximum 10 seconds.
  • Add Source/Rendered CSV selection, complete coefficient JSON, and JavaScript/Python evaluators with data and usage examples.
  • Share the rendering contract with preview; rendered WAV includes selected source, conditioning, monitor gain, and finite start/end envelopes.
  • Identify source, sine fit, Fourier approximation, and rendered-output function exports explicitly.
  • Preserve computational precision and attach schema/algorithm versions, units, rates, durations, and processing settings.
  • Export mixed or selected-oscillator audio; include all voices' identity, carrier/model, phase, pitch/gain curves, interpolation, inclusion/mute/solo state, and global attenuation metadata. Generated functions include per-voice phase integrals and the complete sum.
  • Expose export adapters for manifest/companion sample assets and resettable stateful evaluators. [P1] Import audio and preserve reusable clip assets in portable projects #19 owns complete asset bundle integration; [P1] Modulate sounds with imported audio or saved clips #20 owns modulation formula/function/audio export integration and its numerical tests.

Acceptance criteria

  • A saved-sound pre-monitor buffer and its monitored WAV reproduce the reference render at matched settings; a non-unity monitor-gain fixture detects accidental double attenuation.
  • Decoded WAV headers, sample count, rate, channels, and samples agree with the expected rendered buffer within one PCM quantization step.
  • Source JS/Python evaluators match fixtures within 10^-6, including boundaries and periodic wrap; rendered evaluators reproduce their exported numerical waveform.
  • Changing export rate recomputes bandwidth/rendering at that rate and is visible before download.
  • Complex signals include the full required table/coefficients; the UI never exports a truncated pretty-printed formula as a complete definition.
  • CSV labels seconds and amplitude and identifies Source or Rendered; JSON exports contain finite values and sufficient reproduction settings.
  • Exporting does not mutate the editor, and failures/cancellation preserve the active project.
  • Constant envelopes reproduce the equivalent oscillator output; JS/Python phase-integrated sweeps and mixed evaluators match reference fixtures, and intentional gain dynamics are retained.

Validation

Independent WAV decode checks, positive/negative PCM extrema, CSV/JSON schema checks, execution of generated JS/Python fixtures, and preview/offline DSP comparisons at matched settings.

Boundaries

Compressed audio encoding and bit-identical device output are deferred. Local WAV/MP3 imports are included in #19; no server upload is required.

Implementation evidence

WAV, CSV representations, complete coefficients and executable source/modulated/rendered JS/Python functions are implemented with rate/scope selection and snapshot/cancel behavior. Independent language execution and browser downloads pass.

Merged work: #25, #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