From 42e8d7650beea69637c0a8ab5256a6c99f966342 Mon Sep 17 00:00:00 2001 From: EJClaw Date: Wed, 14 Oct 2026 11:38:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B1=84=ED=8C=85=20"=EB=BD=81"=20=EC=84=B8?= =?UTF-8?q?=EA=B8=B0=20=EC=A4=84=EC=9E=84:=20=EA=B7=80=EB=A5=BC=20?= =?UTF-8?q?=EB=95=8C=EB=A6=B0=EB=8B=A4=EB=8A=94=20=EC=9D=98=EA=B2=AC?= =?UTF-8?q?=EC=97=90=20=ED=81=AC=EA=B8=B0=EB=A5=BC=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=86=8C=EB=A6=AC=EC=9D=98=2090%=E2=86=9260%=EB=A1=9C=20?= =?UTF-8?q?=EB=82=AE=EC=B6=94=EA=B3=A0,=20=EC=8B=9C=EC=9E=91(attack)?= =?UTF-8?q?=EC=9D=84=202ms=E2=86=9212ms=EB=A1=9C=20=EB=B6=80=EB=93=9C?= =?UTF-8?q?=EB=9F=BD=EA=B2=8C=20=ED=95=B4=EC=84=9C=20"=ED=83=81"=20?= =?UTF-8?q?=ED=8A=80=EB=8A=94=20=EB=8A=90=EB=82=8C=EC=9D=84=20=EC=97=86?= =?UTF-8?q?=EC=95=B0.=20=EC=9D=8C(380=E2=86=921150Hz,=200.08=EC=B4=88)?= =?UTF-8?q?=C2=B7=EC=86=8C=EB=A6=AC=20=ED=81=AC=EA=B8=B0=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=C2=B7=EB=AA=B0=EB=A6=BC=20=ED=95=9C=20=EB=B2=88=C2=B7?= =?UTF-8?q?=EC=A7=80=EB=82=9C=20=EC=B1=84=ED=8C=85=20=EC=A1=B0=EC=9A=A9?= =?UTF-8?q?=ED=9E=88=EB=8A=94=20=EA=B7=B8=EB=8C=80=EB=A1=9C.=20feedback.te?= =?UTF-8?q?st.ts=20=EB=A7=9E=EC=B6=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/web/src/lib/feedback.test.ts | 8 ++++---- apps/web/src/lib/feedback.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web/src/lib/feedback.test.ts b/apps/web/src/lib/feedback.test.ts index 80bdd4b..bbae23b 100644 --- a/apps/web/src/lib/feedback.test.ts +++ b/apps/web/src/lib/feedback.test.ts @@ -67,19 +67,19 @@ beforeEach(() => { notes = []; }); -test('chat sound is 10% under the game sounds', () => { +test('chat sound is 60% of the game sounds', () => { expect(GAME_LEVEL).toBe(0.15); - expect(CHAT_LEVEL).toBeCloseTo(GAME_LEVEL * 0.9, 10); + expect(CHAT_LEVEL).toBeCloseTo(GAME_LEVEL * 0.6, 10); setVolume(100); sounds.myTurn(); // a typical game sound at the usual level const game = Math.max(...notes.map((n) => n.peak)); notes = []; chatSound(); - // Notes playing at the same moment add up; the loudest moment of the chat sound is 90% of a game sound. + // Notes playing at the same moment add up; the loudest moment of the chat sound is 60% of a game sound. const byStart = new Map(); for (const n of notes) byStart.set(n.start, (byStart.get(n.start) ?? 0) + n.peak); const loudest = Math.max(...byStart.values()); - expect(loudest).toBeCloseTo(game * 0.9, 6); + expect(loudest).toBeCloseTo(game * 0.6, 6); // One bubble ("뽁") gliding up from a low start. expect(notes.map((n) => n.freq)).toEqual([380]); expect(notes.map((n) => n.to)).toEqual([1150]); diff --git a/apps/web/src/lib/feedback.ts b/apps/web/src/lib/feedback.ts index db90b7b..013fbe3 100644 --- a/apps/web/src/lib/feedback.ts +++ b/apps/web/src/lib/feedback.ts @@ -190,21 +190,21 @@ export const sounds = { /** The usual level of a game sound at volume 100 (`tone`'s default). */ export const GAME_LEVEL = 0.15; -/** Chat sound: 10% under the game sounds (it follows the same volume setting). */ -export const CHAT_LEVEL = GAME_LEVEL * 0.9; +/** Chat sound: 60% of the game sounds (it follows the same volume setting); 90% hit the ears too hard. */ +export const CHAT_LEVEL = GAME_LEVEL * 0.6; let lastChatAt = -Infinity; /** * Chat "뽁": one water-drop bubble like a messenger, a sine gliding up fast from low (about 0.08 s). * Kept apart from the UI/game sounds, which are steady notes (click, good, myTurn …), so it is not mistaken for one; * it also starts lower and is shorter and softer than the game "pop" (700→1400 Hz). - * It peaks at CHAT_LEVEL. Lines arriving in a burst share one sound. + * It peaks at CHAT_LEVEL and fades in over 12 ms so it does not snap. Lines arriving in a burst share one sound. */ export function chatSound(): void { const now = performance.now(); if (now - lastChatAt < 80) return; lastChatAt = now; - tone(380, 80, 'sine', CHAT_LEVEL, 0, { attack: 2, slideTo: 1150 }); + tone(380, 80, 'sine', CHAT_LEVEL, 0, { attack: 12, slideTo: 1150 }); } /** Plays the chat sound whenever `lastKey` (the newest live chat line) changes after the first render. */