Skip to content

Commit 1996ecc

Browse files
naomiaroclaude
andcommitted
Fix spectrogram color map not updating channel 2 in "both" mode (v6.0.1)
SpectrogramChannel.index served dual duty: CSS positioning and canvas ID construction. In "both" mode, index*2 was needed for layout but corrupted canvas IDs (ch2 instead of ch1), so the worker couldn't find the canvas when re-rendering after a color map change. Added separate channelIndex prop for canvas identity. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4f3ff38 commit 1996ecc

File tree

14 files changed

+23
-14
lines changed

14 files changed

+23
-14
lines changed

CLAUDE.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ interface AudioClip {
287287
- Switch between `defaultTheme` and `darkTheme` based on Docusaurus mode
288288
- Example: `minimal-app.tsx` detects and responds to theme toggle
289289

290+
### SpectrogramChannel Index vs ChannelIndex
291+
292+
**`SpectrogramChannel`** has two index concerns: `index` (CSS positioning via Wrapper `top` offset) and `channelIndex` (canvas ID construction for worker registration, e.g. `clipId-ch{channelIndex}-chunk0`). In "both" mode, `SmartChannel` passes `index={props.index * 2}` for layout interleaving but `channelIndex={props.index}` for correct canvas identity. When `channelIndex` is omitted it defaults to `index`. Never use the visual `index` for canvas IDs — the worker and SpectrogramProvider registry expect sequential audio channel indices (0, 1).
293+
290294
### Integration Context Pattern (Spectrogram, Annotations)
291295

292296
**Pattern:** Browser package defines an interface + context, optional packages provide implementation via a Provider component. Used by both `@waveform-playlist/spectrogram` (SpectrogramIntegrationContext) and `@waveform-playlist/annotations` (AnnotationIntegrationContext).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "waveform-playlist-monorepo",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"private": true,
55
"description": "Multiple track web audio editor and player with waveform preview",
66
"author": "Naomi Aro",

packages/annotations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/annotations",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Annotation support for waveform-playlist",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/browser",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Browser bundle for waveform-playlist with React",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/core",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Core types, interfaces and utilities for waveform-playlist",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/loaders/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/loaders",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Audio loaders for waveform-playlist",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/media-element-playout/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/media-element-playout",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "HTMLMediaElement-based playout engine for waveform-playlist with pitch-preserving playback rate",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/playout/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/playout",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Playout engine for waveform-playlist using Tone.js",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/recording/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/recording",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Audio recording support for waveform-playlist using AudioWorklet",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/spectrogram/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@waveform-playlist/spectrogram",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Spectrogram computation and UI for waveform-playlist",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)