feat(music-lab): 랜덤 풀에 7개 장르 추가 + GET /api/music/genres

This commit is contained in:
2026-05-10 23:53:35 +09:00
parent 77b8d05ad7
commit 8b5cb2c16a
2 changed files with 75 additions and 0 deletions

View File

@@ -38,6 +38,69 @@ POOLS = {
"scales": ["major"],
"prompt_modifiers": ["radio-ready", "summer vibe", "feel-good"],
},
"synthwave": {
"moods": ["retro", "nostalgic", "futuristic", "dreamy", "moody"],
"instruments_pool": ["synth lead", "synth bass", "drum machine", "arp synth", "pad synth", "vocoder"],
"instruments_count": (3, 4),
"bpm": (90, 120),
"keys": ["A", "D", "F", "G"],
"scales": ["minor", "major"],
"prompt_modifiers": ["80s neon city night", "retro arcade glow", "VHS aesthetic", "cyberpunk skyline"],
},
"chillhop": {
"moods": ["chill", "groovy", "warm", "nostalgic", "head-nodding"],
"instruments_pool": ["jazz piano", "bass guitar", "drum kit", "saxophone", "vinyl crackle", "rhodes", "muted trumpet"],
"instruments_count": (3, 5),
"bpm": (75, 95),
"keys": ["C", "D", "F", "G", "A"],
"scales": ["major", "minor"],
"prompt_modifiers": ["jazz bar lounge", "chill summer afternoon", "vintage warm tape"],
},
"jazz": {
"moods": ["smooth", "elegant", "moody", "warm", "sophisticated"],
"instruments_pool": ["piano", "double bass", "jazz drums", "saxophone", "trumpet", "jazz guitar"],
"instruments_count": (3, 5),
"bpm": (75, 130),
"keys": ["C", "D", "F", "G", "A"],
"scales": ["major", "minor"],
"prompt_modifiers": ["smoky jazz club", "fireplace evening", "elegant lounge", "rainy speakeasy"],
},
"hip-hop": {
"moods": ["confident", "groovy", "head-nodding", "dark", "energetic"],
"instruments_pool": ["808 bass", "trap drums", "synth lead", "vocal samples", "piano chords", "vinyl scratch", "boom bap drums"],
"instruments_count": (3, 4),
"bpm": (85, 100),
"keys": ["C", "D", "F", "G"],
"scales": ["minor"],
"prompt_modifiers": ["urban night", "boom bap classic", "street vibe", "underground"],
},
"electronic": {
"moods": ["energetic", "uplifting", "hypnotic", "futuristic", "driving"],
"instruments_pool": ["synth lead", "synth bass", "drum machine", "fx pad", "arp", "kick", "snare claps"],
"instruments_count": (3, 5),
"bpm": (110, 140),
"keys": ["A", "C", "D", "F", "G"],
"scales": ["minor", "major"],
"prompt_modifiers": ["club energy", "festival vibe", "neon dance floor"],
},
"classical": {
"moods": ["serene", "elegant", "melancholic", "majestic", "tender"],
"instruments_pool": ["piano", "strings", "cello", "violin", "harp", "flute", "oboe"],
"instruments_count": (1, 3),
"bpm": (60, 100),
"keys": ["C", "D", "E", "F", "G", "A"],
"scales": ["major", "minor"],
"prompt_modifiers": ["orchestra hall", "candlelight evening", "morning piano study", "stately concert"],
},
"funk": {
"moods": ["groovy", "funky", "energetic", "uplifting", "playful"],
"instruments_pool": ["bass guitar", "wah guitar", "horn section", "drums", "clavinet", "rhodes"],
"instruments_count": (3, 5),
"bpm": (95, 120),
"keys": ["C", "D", "E", "F", "G"],
"scales": ["major", "minor"],
"prompt_modifiers": ["70s groove", "disco funk", "soul party"],
},
"default": {
"moods": ["chill", "relaxing", "uplifting", "mellow"],
"instruments_pool": ["piano", "synth", "drums", "guitar", "bass", "strings"],
@@ -50,6 +113,11 @@ POOLS = {
}
def list_genres() -> list[str]:
"""프론트에 노출할 장르 목록 — POOLS의 키 (default 제외)."""
return [g for g in POOLS.keys() if g != "default"]
def randomize(genre: str, rng=None) -> dict:
"""장르 → 랜덤 음악 파라미터 1세트.