diff --git a/AbletonMCP_AI/MCP_Server/server.py b/AbletonMCP_AI/MCP_Server/server.py index 27389b7..3cdd4e9 100644 --- a/AbletonMCP_AI/MCP_Server/server.py +++ b/AbletonMCP_AI/MCP_Server/server.py @@ -5998,12 +5998,13 @@ def analyze_spectral_fit(ctx: Context, spectral_centroid: float, # FASE 6: MASTERING & QA TOOLS (T078-T090) @mcp.tool() -def calibrate_gain_staging(ctx: Context, target_lufs: float = None) -> str: +def calibrate_gain_staging(ctx: Context, target_lufs: float = None, genre: str = "") -> str: """ T079: Calibra gain staging del set midiendo y ajustando niveles. Args: target_lufs: LUFS objetivo para el master (-8 para club, -14 para streaming) + genre: Genero para aplicar perfil especifico (reggaeton, techno, house) Mide LUFS de cada bus y ajusta faders para targets: - Drums (kick): -8 LUFS @@ -6013,14 +6014,27 @@ def calibrate_gain_staging(ctx: Context, target_lufs: float = None) -> str: try: conn = get_ableton_connection() - # Targets por bus - bus_targets = { - "drums": -8.0, - "bass": -10.0, - "music": -12.0, - "vocals": -14.0, - "fx": -16.0 - } + # Targets por bus - perfiles por genero + if genre.lower() == "reggaeton": + # Reggaeton: mas comprimido, target LUFS -9 a -8 + bus_targets = { + "drums": -7.0, # Mas punchy + "bass": -9.0, # Bajo pesado caracteristico + "music": -11.0, # Brillante + "vocals": -12.0, # Vocales al frente + "fx": -15.0 + } + target_profile = "reggaeton_club" + else: + # Perfil estandar (techno/house) + bus_targets = { + "drums": -8.0, + "bass": -10.0, + "music": -12.0, + "vocals": -14.0, + "fx": -16.0 + } + target_profile = "club" if target_lufs == -8.0 else "streaming" if target_lufs == -14.0 else "auto" # Obtener todos los tracks tracks_response = conn.send_command("get_all_tracks") @@ -6082,7 +6096,7 @@ def calibrate_gain_staging(ctx: Context, target_lufs: float = None) -> str: "action": "calibrate_gain_staging", "tracks_adjusted": len(adjustments), "adjustments": adjustments, - "target_profile": "club" if target_lufs == -8.0 else "streaming" if target_lufs == -14.0 else "auto", + "target_profile": target_profile, "timestamp": time.strftime("%Y-%m-%d %H:%M:%S") }, indent=2) except Exception as e: diff --git a/AbletonMCP_AI/MCP_Server/song_generator.py b/AbletonMCP_AI/MCP_Server/song_generator.py index 8428cf2..07a5c7d 100644 --- a/AbletonMCP_AI/MCP_Server/song_generator.py +++ b/AbletonMCP_AI/MCP_Server/song_generator.py @@ -50,6 +50,12 @@ CHORD_PROGRESSIONS = { [6, 4, 1, 5], # vi - IV - I - V [1, 4, 6, 5], # I - IV - vi - V ], + 'reggaeton': [ + [6, 4, 1, 5], # vi-IV-I-V (la mas usada en reggaeton) + [1, 5, 6, 4], # I-V-vi-IV (pop reggaeton) + [6, 3, 4, 1], # vi-III-IV-I (mas oscura, trap) + [1, 1, 4, 5], # I-I-IV-V (reggaeton romantico) + ], } # Configuraciones por género @@ -6013,6 +6019,25 @@ class SongGenerator: notes.append({'pitch': 40, 'start': bar * 4.0 + 2.0, 'duration': 0.25, 'velocity': 110}) notes.append({'pitch': 42, 'start': bar * 4.0 + 2.5, 'duration': 0.1, 'velocity': 80}) + elif pattern_type == 'dembow': + # Patron dembow caracteristico del reggaeton + # K . . . S . K . | K . . . S . . . + # 1 e & a 2 e & a | 3 e & a 4 e & a + for bar in range(bars): + # Kick en 1, 1.75 (el "y" del 2), 3 + notes.append({'pitch': 36, 'start': bar * 4.0 + 0.0, 'duration': 0.25, 'velocity': 127}) # Beat 1 + notes.append({'pitch': 36, 'start': bar * 4.0 + 1.75, 'duration': 0.25, 'velocity': 115}) # "Ghost" kick + notes.append({'pitch': 36, 'start': bar * 4.0 + 3.0, 'duration': 0.25, 'velocity': 127}) # Beat 3 + # Snare/Clap en 2 y 4 + notes.append({'pitch': 40, 'start': bar * 4.0 + 1.0, 'duration': 0.25, 'velocity': 110}) # Beat 2 + notes.append({'pitch': 40, 'start': bar * 4.0 + 3.75, 'duration': 0.25, 'velocity': 100}) # Anticipo beat 4 + # Hi-hats cada 1/8 con swing + for eighth in range(8): + time = bar * 4.0 + eighth * 0.5 + # Acentos en 1, 2, 3, 4 + vel = 100 if eighth % 2 == 0 else 80 + notes.append({'pitch': 42, 'start': time, 'duration': 0.1, 'velocity': vel}) + else: # full notes.extend(self._create_kick_pattern(style, 'standard')) notes.extend(self._create_clap_pattern(style, 'standard')) diff --git a/AbletonMCP_AI/todo.md b/AbletonMCP_AI/todo.md new file mode 100644 index 0000000..89aa9d9 --- /dev/null +++ b/AbletonMCP_AI/todo.md @@ -0,0 +1,273 @@ +# ✅ TODO — AbletonMCP AI | Restaurar y Reggaetón + +> Generado: 29-Mar-2026 | Estado del servidor: RUNNING en `start_server.bat` + +--- + +## 🔍 Diagnóstico Actual (qué está OK y qué no) + +### ✅ Lo que FUNCIONA correctamente + +| Componente | Estado | +|---|---| +| `server.py` | Arrancando (8713 líneas, imports OK) | +| `song_generator.py` | OK — **reggaeton ya está implementado** (líneas 87-92, 521-531) | +| `sample_selector.py` | OK — Palette Lock, Coverage Wheel, fatiga disponibles | +| `audio_analyzer.py` | OK — análisis espectral con librosa | +| `MCP Server` | Corriendo como proceso en background | +| Imports de Python | ✅ `IMPORTS OK` verificado | +| `GENRE_CONFIGS['reggaeton']` | BPM 90-100, keys Am/Dm/Gm/Cm/Fm/Em | +| `SECTION_BLUEPRINTS['reggaeton']` | INTRO→PRECORO→CORO A→VERSEO→PRECORO B→CORO B→PUENTE→CORO FINAL→OUTRO | +| Estilos reggaeton | `dembow`, `perreo`, `moombahton`, `latin-trap`, `romantico` | + +### ⚠️ Posibles causas de los problemas + +| Problema | Causa probable | Fix | +|---|---|---| +| MCP no visible en OpenCode | OpenCode no detecta el servidor | Reiniciar OpenCode con workspace `AbletonMCP_AI` abierto | +| "Lo rompí" | Probable edición accidental del server.py | Ver diff con git o verificar sintaxis | +| Start_server.bat no arranca | PYTHONPATH mal seteado | Ver sección "Cómo arrancar" abajo | + +--- + +## 🚀 Cómo arrancar el servidor (pasos exactos) + +```powershell +# 1. Abrir PowerShell en C:\Users\ren\AbletonMCP_AI +# 2. Correr: +cmd /c "C:\Users\ren\AbletonMCP_AI\start_server.bat" + +# Si falla, correr manualmente: +cd C:\Users\ren\AbletonMCP_AI +$env:PYTHONPATH = "C:\Users\ren\AbletonMCP_AI;C:\Users\ren\AbletonMCP_AI\MCP_Server" +python MCP_Server\server.py +``` + +Si hay error de import, verificar: +```powershell +python -c "import sys; sys.path.insert(0,'MCP_Server'); from song_generator import SongGenerator; print('OK')" +``` + +--- + +## 🎵 Reggaetón — Lo que ya existe y lo que falta + +### ✅ Ya implementado en `song_generator.py` + +```python +# GENRE_CONFIGS (línea 87): +'reggaeton': { + 'bpm_range': (90, 100), + 'default_bpm': 95, + 'keys': ['Am', 'Dm', 'Gm', 'Cm', 'Fm', 'Em'], + 'styles': ['dembow', 'perreo', 'moombahton', 'latin-trap', 'romantico'], +} + +# SECTION_BLUEPRINTS (línea 521): +'reggaeton': [ + ('INTRO', 8, 12, 'intro', 1), + ('PRECORO', 8, 16, 'build', 2), + ('CORO A', 16, 28, 'drop', 4), + ('VERSEO', 16, 20, 'break', 2), + ('PRECORO B', 8, 18, 'build', 3), + ('CORO B', 16, 30, 'drop', 5), + ('PUENTE', 8, 15, 'break', 1), + ('CORO FINAL', 16, 32, 'drop', 5), + ('OUTRO', 8, 10, 'outro', 1), +] +``` + +### Para generar reggaetón ahora mismo, usar: +``` +generate_track(genre="reggaeton", style="dembow", bpm=95, key="Am") +generate_song(genre="reggaeton", style="perreo", bpm=92, key="Dm") +``` + +--- + +## 📋 TODOs por prioridad + +### 🔴 INMEDIATO — Para que todo funcione hoy + +- [ ] **TODO-001** — Verificar que `server.py` no tiene errores de sintaxis + ```powershell + python -m py_compile MCP_Server/server.py && echo "OK" + ``` + +- [ ] **TODO-002** — Reiniciar OpenCode con el folder `C:\Users\ren\AbletonMCP_AI` como workspace + - El archivo `.opencode.json` en la raíz ya tiene el MCP configurado + +- [ ] **TODO-003** — Verificar que Ableton Live tiene `AbletonMCP_AI` activado como MIDI Remote Script + - `Ableton → Preferencias → Link/Tempo/MIDI → Remote Scripts → AbletonMCP_AI` + +- [ ] **TODO-004** — Probar la conexión con un comando simple: + ``` + get_session_info() + ``` + +- [ ] **TODO-005** — Generar el primer track reggaetón de prueba: + ``` + generate_track(genre="reggaeton", style="dembow", bpm=95, key="Am") + ``` + +--- + +### 🟠 PRIORIDAD ALTA — Esta semana + +#### Reggaetón: Patrón Dembow +- [ ] **TODO-006** — Agregar patrón MIDI dembow nativo en `song_generator.py` + - El dembow es el patrón rítmico base: kick en 1 y 3, snare sincopado en el "y" del 2 + - BPM típico: 92-96. Cuantización: 1/16 + - El patrón que define al reggaetón: `K . . . S . K . K . . . S . . .` (16 steps) + +- [ ] **TODO-007** — Samples de dembow en la librería + - Buscar en la librería muestras de: *dembow kick* (caja electrónica tipo TR-808), *dembow clap*, *dembow hi-hat* (loop rítmico característico) + - Si no existen: crear subcarpeta `librerias/all_tracks/Reggaeton/` con packs básicos + +- [ ] **TODO-008** — Definir `ROLE_SECTION_VARIANTS` para reggaetón + ```python + # En song_generator.py, agregar: + REGGAETON_SECTION_VARIANTS = { + 'bass': { + 'intro': 'smooth deep', + 'verseo': 'minimal rolling', + 'coro': 'full punchy dembow', + 'puente': 'atmospheric filtered', + }, + 'perc': { + 'intro': 'minimal', + 'coro': 'full dembow Latin percusion', + 'verseo': 'sparse congas bongos', + } + } + ``` + +- [ ] **TODO-009** — Configurar `MASTER_CALIBRATION` para reggaetón + - El reggaetón necesita un master más brillante y comprimido que el techno + - Target LUFS: -9 a -8 (similar a club music mainstream) + - Más saturación de alta frecuencia para el "sound wall" del género + +- [ ] **TODO-010** — Agregar progresiones de acordes reggaetón a `CHORD_PROGRESSIONS` + ```python + 'reggaeton': [ + [6, 4, 1, 5], # vi-IV-I-V (la más usada en reggaetón) + [1, 5, 6, 4], # I-V-vi-IV + [6, 3, 4, 1], # vi-III-IV-I (más oscura, trap) + [1, 1, 4, 5], # I-I-IV-V (reggaetón romántico) + ], + ``` + +--- + +### 🟡 PRIORIDAD MEDIA — Próximas 2 semanas + +#### Reggaetón: Elementos musicales +- [ ] **TODO-011** — Línea de bajo dembow característica + - Bass que hace "bump" en los tiempos fuertes, con slide/portamento entre notas + - Pattern: corchea en el 1, silencio, nota de apoyo en el "3", silencio + +- [ ] **TODO-012** — Percusión latina en los samples + - El reggaetón necesita: congas, bongos, güira, maracas como top loop + - Buscar en la librería filtros con: `perc_loop`, `latin_perc`, `congas`, `bongos` + +- [ ] **TODO-013** — Vocal chop estilo reggaetón + - Vocal en el coro cada beat (no cada 2 como en techno) + - Autotune sueño/trap evidente en el vocal_peak + +- [ ] **TODO-014** — Definir `ARRANGEMENT_PROFILES` para reggaetón + ```python + { + 'name': 'dembow', + 'genres': {'reggaeton'}, + 'drum_tightness': 0.92, + 'bass_motion': 'bouncy', + 'melodic_motion': 'hooky', + 'pan_width': 0.16, + 'fx_bias': 0.95, + } + ``` + +- [ ] **TODO-015** — Agregar estilo `moombahton` con features específicos + - Moombahton = house a 108 BPM con dembow + - BPM range: 105-112 + - Más heavy bass, influencia dancehall + +#### Calidad general del sistema + +- [ ] **TODO-016** — Fix de repetición de samples (T011 del PRO_DJ_ROADMAP) + - `_find_library_file()`: limit 10 → 50 + +- [ ] **TODO-017** — Shuffled candidate pool (T012 del PRO_DJ_ROADMAP) + +- [ ] **TODO-018** — Palette Lock activado por defecto + +- [ ] **TODO-019** — Coverage Wheel para explorar la librería completa + +- [ ] **TODO-020** — Human feel: fades y sidechain básicos + +--- + +### 🔵 BACKLOG — Cuando el sistema esté estable + +- [ ] **TODO-021** — Géneros adicionales: Afrobeats, Cumbia, Trap Latino, Bachata +- [ ] **TODO-022** — Sistema de rating y feedback loop +- [ ] **TODO-023** — Export stems reggaetón con metadata correcta +- [ ] **TODO-024** — Análisis de referencia de tracks reggaetón (ej: arquivos Bad Bunny) +- [ ] **TODO-025** — Herramienta `generate_dj_set(genre='reggaeton', duration=60)` + +--- + +## 🎛️ Comandos rápidos para probar reggaetón HOY + +``` +# Básico dembow +generate_track(genre="reggaeton", bpm=95, key="Am") + +# Perreo agresivo +generate_track(genre="reggaeton", style="perreo", bpm=92, key="Dm") + +# Latin trap +generate_track(genre="reggaeton", style="latin-trap", bpm=88, key="Gm") + +# Moombahton +generate_track(genre="reggaeton", style="moombahton", bpm=108, key="Cm") + +# Romántico +generate_track(genre="reggaeton", style="romantico", bpm=92, key="Am") + +# Canción completa +generate_song(genre="reggaeton", style="dembow", bpm=95, key="Am", structure="reggaeton") +``` + +--- + +## 📂 Archivos clave del proyecto + +| Archivo | Tamaño | Para qué sirve | +|---|---|---| +| `MCP_Server/server.py` | 411 KB | Servidor MCP principal — herramientas y comunicación con Ableton | +| `MCP_Server/song_generator.py` | 279 KB | Generación musical: géneros, patrones, estructura | +| `MCP_Server/sample_selector.py` | 113 KB | Selección inteligente de samples | +| `MCP_Server/audio_analyzer.py` | 23 KB | Análisis espectral y detección de key | +| `MCP_Server/reference_listener.py` | 225 KB | Análisis de tracks de referencia | +| `MCP_Server/roadmap.md` | 34 KB | Roadmap técnico detallado (10 fases) | +| `PRO_DJ_ROADMAP.md` | 18 KB | Roadmap a calidad DJ profesional (110 tasks) | +| `start_server.bat` | 100 B | Punto de entrada del servidor | + +--- + +## 🔗 Referencia de configuración del MCP + +Archivos de config (todos apuntan al mismo servidor): + +| Archivo | Ubicación | +|---|---| +| Global OpenCode | `C:\Users\ren\.config\opencode\opencode.json` | +| User profile | `C:\Users\ren\.opencode.json` | +| Workspace local | `C:\Users\ren\AbletonMCP_AI\.opencode.json` | + +Todos usan: `cmd /c C:\Users\ren\AbletonMCP_AI\start_server.bat` + +--- + +*Actualizado: 29-Mar-2026 | Próxima revisión: después de completar TODO-001 a TODO-005*