Files
musica-ia/generate_salsa_project.py
renato97 85db177636 feat: Complete music project templates and generation system
🎵 Major Additions:

📁 2000s Pop Project Templates:
- Chords & melody patterns
- Drum patterns and rhythms
- Synth bass configurations
- Effects and mixing guides
- Complete project structure documentation

🧬 ALS Generation System:
- Fixed ALS generator with enhanced capabilities
- Setup scripts for easy deployment
- Comprehensive README and documentation
- Quick start guide for users
- Utility commands reference

🎼 Musical Projects:
- Salsa project (Hector Lavoe inspired) with full documentation
- 2000s Pop project with complete production guide

🔧 Utility Scripts:
- generate_salsa_project.py: Salsa-specific generator
- generate_versioned_als.py: Versioned project generation
- register_project.py: Project registration system

This significantly expands MusiaIA's capabilities with pre-built project templates and production-ready examples for multiple genres!

Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 01:14:03 +00:00

296 lines
11 KiB
Python

#!/usr/bin/env python3
"""
Generador de Pista de Salsa Estilo Héctor Lavoe
Utiliza el ALSGenerator para crear un proyecto completo de salsa
"""
import sys
import random
from pathlib import Path
sys.path.append('/home/ren/musia/src/backend')
from als.als_generator import ALSGenerator
def generate_salsa_project():
"""Genera una pista de salsa completa estilo Héctor Lavoe"""
# Configuración básica del proyecto
config = {
'name': 'Salsa_Hector_Lavoe_Style',
'bpm': 175, # Tempo típico de salsa dura
'key': 'Am', # La menor - tonalidad típica para salsa melancólica
'tracks': []
}
# ====================================================================
# TRACK 1: TIMBALES - Percusión principal de salsa
# ====================================================================
timbales_samples = [
'Percussions/30_Timbal.wav',
'Percussions/70_Timbal.wav',
'Percussions/72_Timbal.wav',
'Percussions/76_Timbal.wav',
'Percussions/78_Timbal.wav',
'Percussions/73_Timbal.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Timbales',
'samples': timbales_samples,
'color': 45 # Color rojo/naranja
})
# ====================================================================
# TRACK 2: CONGAS - Tumbao base de salsa
# ====================================================================
congas_samples = [
'Percussions/02_Conga.wav',
'Percussions/33_Conga_2.wav',
'Percussions/79_Conga.wav',
'Percussions/33_Conga_Hit_1.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Congas',
'samples': congas_samples,
'color': 30 # Color rojo
})
# ====================================================================
# TRACK 3: BONGOS - Pulso y contratiempos
# ====================================================================
bongos_samples = [
'Percussions/02_Bongo_High.wav',
'Percussions/98_Perc_High.wav',
'Percussions/98_Perc_High_2.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Bongos',
'samples': bongos_samples,
'color': 20 # Color rosa/rojo claro
})
# ====================================================================
# TRACK 4: COWBELL & CENCERRO - Ritmo metal de salsa
# ====================================================================
metal_samples = [
'Percussions/64_Cowbell.wav',
'Percussions/91_Cowbell.wav',
'Percussions/91_Wood.wav',
'Percussions/91_Perc.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Cowbell & Cencerro',
'samples': metal_samples,
'color': 50 # Color amarillo
})
# ====================================================================
# TRACK 5: SHAKERS & GÜIRA - Textura y ambiente
# ====================================================================
texture_samples = [
'Percussions/03_Shaker.wav',
'Percussions/04_Shaker.wav',
'Percussions/05_Shaker_1.wav',
'Percussions/05_Shaker_2.wav',
'Percussions/23_Shaker.wav',
'Percussions/73_Shaker.wav',
'Percussions/95_Shaker.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Shakers & Güira',
'samples': texture_samples,
'color': 60 # Color verde claro
})
# ====================================================================
# TRACK 6: PIANO - Montuno de salsa (MIDI)
# ====================================================================
# Patrón de montuno típico en Am: notas basadas en A minor pentatonic
piano_pattern = [
{'note': 57, 'time': 0, 'duration': 0.25, 'velocity': 110}, # A3
{'note': 60, 'time': 0.25, 'duration': 0.25, 'velocity': 100}, # C4
{'note': 64, 'time': 0.5, 'duration': 0.25, 'velocity': 105}, # E4
{'note': 62, 'time': 0.75, 'duration': 0.25, 'velocity': 100}, # D4
{'note': 60, 'time': 1.0, 'duration': 0.25, 'velocity': 110}, # C4
{'note': 64, 'time': 1.25, 'duration': 0.25, 'velocity': 100}, # E4
{'note': 69, 'time': 1.5, 'duration': 0.25, 'velocity': 115}, # A4
{'note': 67, 'time': 1.75, 'duration': 0.25, 'velocity': 100}, # G4
]
config['tracks'].append({
'type': 'MidiTrack',
'name': 'Piano Montuno',
'midi': {
'notes': piano_pattern,
'velocity': 100,
'duration': 0.25,
'spacing': 0.25,
'numerator': 4,
'denominator': 4,
'groove_id': 0
},
'color': 15 # Color azul
})
# ====================================================================
# TRACK 7: BAJO - Tumbao de salsa (MIDI)
# ====================================================================
# Patrón de bajo típico para salsa en Am
bass_pattern = [
{'note': 45, 'time': 0, 'duration': 0.5, 'velocity': 120}, # A2 (fundamental)
{'note': 45, 'time': 0.5, 'duration': 0.25, 'velocity': 100}, # A2
{'note': 43, 'time': 0.75, 'duration': 0.25, 'velocity': 110}, # G2
{'note': 45, 'time': 1.0, 'duration': 0.5, 'velocity': 115}, # A2
{'note': 48, 'time': 1.5, 'duration': 0.25, 'velocity': 110}, # C3
{'note': 47, 'time': 1.75, 'duration': 0.25, 'velocity': 105}, # B2
{'note': 45, 'time': 2.0, 'duration': 0.5, 'velocity': 120}, # A2
{'note': 45, 'time': 2.5, 'duration': 0.25, 'velocity': 100}, # A2
{'note': 43, 'time': 2.75, 'duration': 0.25, 'velocity': 110}, # G2
{'note': 40, 'time': 3.0, 'duration': 0.5, 'velocity': 115}, # E2
{'note': 43, 'time': 3.5, 'duration': 0.25, 'velocity': 110}, # G2
{'note': 45, 'time': 3.75, 'duration': 0.25, 'velocity': 105}, # A2
]
config['tracks'].append({
'type': 'MidiTrack',
'name': 'Bajo Tumbao',
'midi': {
'notes': bass_pattern,
'velocity': 115,
'duration': 0.5,
'spacing': 0.25,
'numerator': 4,
'denominator': 4,
'groove_id': 0
},
'color': 35 # Color morado
})
# ====================================================================
# TRACK 8: SECCIÓN DE VIENTOS - Trompetas y trombones (MIDI)
# ====================================================================
# Acordes y melodías típicas de salsa
brass_pattern = [
{'note': 69, 'time': 0, 'duration': 1.0, 'velocity': 105}, # A4 (melody)
{'note': 72, 'time': 1.0, 'duration': 1.0, 'velocity': 105}, # C5
{'note': 74, 'time': 2.0, 'duration': 1.0, 'velocity': 105}, # D5
{'note': 76, 'time': 3.0, 'duration': 1.0, 'velocity': 105}, # E5
# Contrapunto
{'note': 64, 'time': 0.5, 'duration': 0.5, 'velocity': 90}, # E4
{'note': 67, 'time': 1.5, 'duration': 0.5, 'velocity': 90}, # G4
{'note': 69, 'time': 2.5, 'duration': 0.5, 'velocity': 90}, # A4
{'note': 71, 'time': 3.5, 'duration': 0.5, 'velocity': 90}, # B4
]
config['tracks'].append({
'type': 'MidiTrack',
'name': 'Sección Vientos',
'midi': {
'notes': brass_pattern,
'velocity': 100,
'duration': 1.0,
'spacing': 0.5,
'numerator': 4,
'denominator': 4,
'groove_id': 0
},
'color': 70 # Color verde
})
# ====================================================================
# TRACK 9: KICKS - Bombo para acentuación
# ====================================================================
kicks_samples = [
'Kicks/01_Kick.wav',
'Kicks/02_Kick.wav',
'Kicks/03_Kick.wav',
'Kicks/04_Kick.wav',
'Kicks/05_Kick.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Kick',
'samples': kicks_samples,
'color': 10 # Color azul oscuro
})
# ====================================================================
# TRACK 10: PERCUSIÓN ADICIONAL - Para fills y variaciones
# ====================================================================
extra_perc = [
'Percussions/04_Percussion_1.wav',
'Percussions/04_Percussion_2.wav',
'Percussions/04_Percussion_3.wav',
'Percussions/05_Percussion_1.wav',
'Percussions/05_Percussion_2.wav',
'Percussions/05_Percussion_3.wav',
'Percussions/05_Percussion_4.wav',
'Percussions/07_Percussion_Drum.wav',
'Percussions/07_Percussion_Drum_2.wav',
'Percussions/15_Percussion.wav',
'Percussions/22_Percusion.wav',
'Percussions/22_Percussion_2.wav',
'Percussions/22_Percussion_3.wav'
]
config['tracks'].append({
'type': 'AudioTrack',
'name': 'Percusión Adicional',
'samples': extra_perc,
'color': 55 # Color turquesa
})
# ====================================================================
# Generar el proyecto
# ====================================================================
print("🎵 Generando proyecto de salsa estilo Héctor Lavoe...")
print(f"📊 Configuración:")
print(f" - Nombre: {config['name']}")
print(f" - BPM: {config['bpm']}")
print(f" - Tonalidad: {config['key']}")
print(f" - Tracks: {len(config['tracks'])}")
generator = ALSGenerator(output_dir="/home/ren/musia/output/als")
als_file = generator.generate_project(config)
print(f"\n✅ ¡Proyecto generado exitosamente!")
print(f"📁 Archivo ALS: {als_file}")
print(f"\n🎶 Estructura del proyecto:")
for i, track in enumerate(config['tracks'], 1):
print(f" {i}. {track['name']} ({track['type']})")
print(f"\n🎹 Instrumentación incluida:")
print(" - Timbales (percusión principal)")
print(" - Congas (tumbao base)")
print(" - Bongos (pulso y contratiempos)")
print(" - Cowbell & Cencerro (ritmo metálico)")
print(" - Shakers & Güira (textura)")
print(" - Piano Montuno (MIDI)")
print(" - Bajo Tumbao (MIDI)")
print(" - Sección de Vientos (MIDI)")
print(" - Kick (acentos)")
print(" - Percusión Adicional (fills y variaciones)")
print(f"\n🌟 Características estilo Héctor Lavoe:")
print(" - Tempo rápido (175 BPM)")
print(" - Tonalidad menor melancólica (Am)")
print(" - Patrones auténticos de salsa")
print(" - Montunos de piano característicos")
print(" - Tumbao de bajo latino")
print(" - Percusión latina tradicional")
return als_file
if __name__ == "__main__":
generate_salsa_project()