From dbc26a4150a7904495586d6cad90d77c8d8acc84 Mon Sep 17 00:00:00 2001 From: jwkim Date: Tue, 25 Aug 2026 10:23:51 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=A1=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=84=EA=B3=A1=20=EA=B3=A0=EC=A0=95=20+=20=ED=8C=80?= =?UTF-8?q?=EB=8B=B9=201=EA=B3=A1=EB=A7=8C=20=EB=85=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 스타일은 레퍼런스 확정본(brass fanfare·drum corps·128bpm·live stadium) 으로 고정, LLM 은 제목·가사만 작성 - Suno 생성 2트랙 중 첫 트랙만 API 노출 Co-Authored-By: Claude Fable 5 --- backend/app/routers/songs.py | 3 ++- backend/app/services/songs.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/routers/songs.py b/backend/app/routers/songs.py index aacee58..36e0f2c 100644 --- a/backend/app/routers/songs.py +++ b/backend/app/routers/songs.py @@ -25,7 +25,8 @@ def _song_out(s: Song) -> dict: "teamName": s.team_name, "title": s.title, "lyrics": s.lyrics, - "tracks": s.tracks or [], + # Suno 는 생성당 2트랙을 주지만 노출은 팀당 1곡만 (첫 트랙) + "tracks": (s.tracks or [])[:1], } diff --git a/backend/app/services/songs.py b/backend/app/services/songs.py index 1a04f46..6529248 100644 --- a/backend/app/services/songs.py +++ b/backend/app/services/songs.py @@ -30,11 +30,12 @@ KST = timezone(timedelta(hours=9)) MAX_ATTEMPTS = 3 GENERATE_TIMEOUT_MIN = 30 # Suno 작업이 이 시간 넘게 미완이면 실패 처리 -# 스타일 폴백 — LLM 이 style 을 못 주면 이 기본값 사용 (야구장 웅장 앤섬 컨셉) +# 곡 스타일 — 전 곡 고정 (야구장 웅장 앤섬 컨셉, 레퍼런스 확정본). +# LLM 은 가사·제목만 쓰고 스타일은 변주하지 않는다. DEFAULT_STYLE = ( "Korean baseball stadium cheer anthem, powerful brass fanfare, thumping " - "drum corps, group chant call-and-response, gang vocals, energetic crowd " - "shouting, 128bpm, live stadium atmosphere" + "drum corps, group chant call-and-response, gang vocals, energetic male " + "crowd shouting, 128bpm, live stadium atmosphere" ) # LLM 에게 주는 형식 레퍼런스 (가사 구조·스타일 문구의 톤) @@ -355,8 +356,6 @@ def _lyrics_prompt(team_name: str, context: str, league: str = "kbo") -> str: f"[가사 형식 레퍼런스 — 구조와 톤만 참고, 내용은 오늘 경기에 맞게 새로 쓸 것]\n{_REFERENCE}\n\n" "다음 키를 가진 JSON 객체 하나만 출력하라:\n" ' "title": 곡 제목 (한국어, 25자 이내, 오늘 경기 느낌이 나게),\n' - ' "style": 음악 생성기용 영어 스타일 설명 한 줄 — 예: ' - f'"{DEFAULT_STYLE}" 처럼 웅장한 야구장 앤섬 계열로, 곡마다 악기·bpm 등을 변주,\n' ' "lyrics": 위 형식의 전체 가사\n' ) @@ -429,7 +428,7 @@ async def _start_one(db, m: Match, side: str, lineups: dict | None) -> bool: piece = await write_lyrics(name, context, m.league) title = str(piece.get("title") or f"{name} 오늘의 응원가").strip()[:40] - style = str(piece.get("style") or DEFAULT_STYLE).strip() + style = DEFAULT_STYLE # 전 곡 고정 스타일 — LLM 변주 없음 lyrics = str(piece.get("lyrics") or "").strip() if not lyrics: raise RuntimeError("LLM 가사 비어있음")