Skip to content

feat: add pitched instrument selection#22

Merged
britle20 merged 5 commits into
developfrom
feat/19-pitched-instruments
Jun 7, 2026
Merged

feat: add pitched instrument selection#22
britle20 merged 5 commits into
developfrom
feat/19-pitched-instruments

Conversation

@britle20

@britle20 britle20 commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #19

Adds clip-level pitched instrument lanes for Default Synth and Iowa Piano, with note events owned by serializable instrumentId values so both instruments can coexist and play together in one clip.

Changes

  • Replaces the piano-roll-local instrument toggle with sidebar clip child entries for Default Synth and Iowa Piano.
  • Adds instrumentId to serializable NoteEvent data and filters the visible piano roll notes by the selected sidebar instrument.
  • Schedules all note events in the selected clip, allowing Default Synth and Iowa Piano to sound simultaneously.
  • Defines serializable pitched instrument metadata and Iowa Piano C4-C5 sample zones.
  • Adds Iowa Piano sample playback with gain envelopes and a PCM WAV decode fallback when decodeAudioData cannot decode a bundled WAV.
  • Adds per-sample sampleStartSeconds offsets so Iowa Piano playback skips leading silence in the bundled one-second WAV files.
  • Disables Iowa Piano sustain looping for this PR to avoid long notes sounding like repeated strikes.
  • Updates docs and tests for instrument-owned notes, sample start offsets, and deferred advanced sampler sustain.

Testing

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present

Screenshots

Not included. Dev server was previously started and the app returned HTTP 200 at http://127.0.0.1:5174/ because port 5173 was already in use.

Notes / Limitations

  • The bundled Iowa Piano samples contain substantial leading silence before the audible attack. Short notes could be stopped before the attack, so this PR starts sample playback at explicit offsets.
  • Iowa Piano samples currently play once and do not use AudioBufferSourceNode.loop.
  • Long Iowa Piano notes may naturally decay or end instead of sustaining for the full note duration.
  • Advanced sampler sustain, loop point tuning, and crossfaded looping should be handled in a follow-up issue after this PR merges.
  • Manual audible confirmation still needs browser review.

Follow-up

  • After this PR merges, create a follow-up issue for sampler-based advanced sustain.
  • Then continue with the next Active Issue Order entry.

@britle20 britle20 merged commit 414dda4 into develop Jun 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant