397 lines
15 KiB
Python
397 lines
15 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Generador de Proyecto de Rock de los 70s
|
|
Crea un proyecto de Ableton Live con el sonido clásico del rock setentero
|
|
Inspirado en Led Zeppelin, Deep Purple, Black Sabbath, Queen
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
sys.path.append('/home/ren/musia/src/backend')
|
|
|
|
from als.als_generator import ALSGenerator
|
|
|
|
def generate_70s_rock_project():
|
|
"""Genera un proyecto completo de rock de los 70s"""
|
|
|
|
# Configuración básica del proyecto
|
|
config = {
|
|
'name': '70s_Rock_Project',
|
|
'bpm': 120, # Tempo típico de rock clásico
|
|
'key': 'E', # Mi mayor - tonalidad clásica del rock (piensa en Smoke on the Water, Back in Black)
|
|
'tracks': []
|
|
}
|
|
|
|
# ====================================================================
|
|
# TRACK 1: KICK DRUM - Bombo potente y contundente
|
|
# ====================================================================
|
|
kick_samples = [
|
|
'Kicks/01_Kick.wav',
|
|
'Kicks/02_Kick.wav',
|
|
'Kicks/03_Kick.wav',
|
|
'Kicks/04_Kick.wav',
|
|
'Kicks/05_Kick.wav',
|
|
'Kicks/06_Kick.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Kick Drum',
|
|
'samples': kick_samples,
|
|
'color': 10 # Color azul oscuro
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 2: SNARE DRUM - Caja con cuerpo y reverb natural
|
|
# ====================================================================
|
|
snare_samples = [
|
|
'Snares/04_Snare.wav',
|
|
'Snares/05_Snare.wav',
|
|
'Snares/07_Snare.wav',
|
|
'Snares/08_Snare.wav',
|
|
'Snares/09_Snare.wav',
|
|
'Snares/10_Snare.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Snare Drum',
|
|
'samples': snare_samples,
|
|
'color': 15 # Color azul
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 3: HI-HAT - Ritmo constante de rock
|
|
# ====================================================================
|
|
hihat_samples = [
|
|
'Hi Hats/07_Closed_Hat.wav',
|
|
'Hi Hats/08_Closed_Hat.wav',
|
|
'Hi Hats/09_Closed_Hat.wav',
|
|
'Hi Hats/06_Open_Hat.wav',
|
|
'Hi Hats/10_Hat.wav',
|
|
'Hi Hats/11_Hat.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Hi-Hat',
|
|
'samples': hihat_samples,
|
|
'color': 20 # Color rosa
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 4: TOMS - Para fills épicos de batería
|
|
# ====================================================================
|
|
tom_samples = [
|
|
'Toms/06_Tom.wav',
|
|
'Toms/06_Tom_2.wav',
|
|
'Toms/32_Low_Drum.wav',
|
|
'Toms/84_Low_Tom.wav',
|
|
'Toms/89_Tom.wav',
|
|
'Toms/96_Tom.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Toms',
|
|
'samples': tom_samples,
|
|
'color': 25 # Color rojo claro
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 5: CRASH & RIDE - Platillos para acentos
|
|
# ====================================================================
|
|
cymbal_samples = [
|
|
'Percussions/71_Tin.wav',
|
|
'Percussions/75_Tin.wav',
|
|
'Percussions/34_High_Hit.wav',
|
|
'Percussions/98_Perc_High.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Cymbals',
|
|
'samples': cymbal_samples,
|
|
'color': 50 # Color amarillo
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 6: ELECTRIC BASS - Bajo eléctrico con groove rock (MIDI)
|
|
# Patrón estilo rock de los 70s en E (Mi)
|
|
# ====================================================================
|
|
bass_pattern = [
|
|
# Compás 1 - Riff en E
|
|
{'note': 40, 'time': 0, 'duration': 0.5, 'velocity': 120}, # E2
|
|
{'note': 40, 'time': 0.5, 'duration': 0.25, 'velocity': 100}, # E2
|
|
{'note': 43, 'time': 0.75, 'duration': 0.25, 'velocity': 110}, # G2
|
|
{'note': 45, 'time': 1.0, 'duration': 0.5, 'velocity': 115}, # A2
|
|
{'note': 43, 'time': 1.5, 'duration': 0.25, 'velocity': 105}, # G2
|
|
{'note': 40, 'time': 1.75, 'duration': 0.25, 'velocity': 110}, # E2
|
|
# Compás 2 - Variación
|
|
{'note': 40, 'time': 2.0, 'duration': 0.5, 'velocity': 120}, # E2
|
|
{'note': 45, 'time': 2.5, 'duration': 0.25, 'velocity': 100}, # A2
|
|
{'note': 47, 'time': 2.75, 'duration': 0.25, 'velocity': 110}, # B2
|
|
{'note': 45, 'time': 3.0, 'duration': 0.5, 'velocity': 115}, # A2
|
|
{'note': 43, 'time': 3.5, 'duration': 0.25, 'velocity': 105}, # G2
|
|
{'note': 40, 'time': 3.75, 'duration': 0.25, 'velocity': 100}, # E2
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'MidiTrack',
|
|
'name': 'Electric Bass',
|
|
'midi': {
|
|
'notes': bass_pattern,
|
|
'velocity': 115,
|
|
'duration': 0.5,
|
|
'spacing': 0.25,
|
|
'numerator': 4,
|
|
'denominator': 4,
|
|
'groove_id': 0
|
|
},
|
|
'color': 35 # Color morado
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 7: RHYTHM GUITAR - Riff de guitarra rítmica (MIDI)
|
|
# Power chords estilo rock de los 70s
|
|
# ====================================================================
|
|
rhythm_guitar_pattern = [
|
|
# Power chord E5 (E-B)
|
|
{'note': 52, 'time': 0, 'duration': 0.5, 'velocity': 110}, # E3
|
|
{'note': 59, 'time': 0, 'duration': 0.5, 'velocity': 105}, # B3
|
|
{'note': 52, 'time': 0.5, 'duration': 0.25, 'velocity': 100}, # E3
|
|
{'note': 59, 'time': 0.5, 'duration': 0.25, 'velocity': 95}, # B3
|
|
# Power chord G5
|
|
{'note': 55, 'time': 0.75, 'duration': 0.25, 'velocity': 105}, # G3
|
|
{'note': 62, 'time': 0.75, 'duration': 0.25, 'velocity': 100}, # D4
|
|
# Power chord A5
|
|
{'note': 57, 'time': 1.0, 'duration': 0.5, 'velocity': 110}, # A3
|
|
{'note': 64, 'time': 1.0, 'duration': 0.5, 'velocity': 105}, # E4
|
|
# Vuelta a E5
|
|
{'note': 52, 'time': 1.5, 'duration': 0.5, 'velocity': 108}, # E3
|
|
{'note': 59, 'time': 1.5, 'duration': 0.5, 'velocity': 103}, # B3
|
|
# Compás 2
|
|
{'note': 52, 'time': 2.0, 'duration': 0.5, 'velocity': 110}, # E3
|
|
{'note': 59, 'time': 2.0, 'duration': 0.5, 'velocity': 105}, # B3
|
|
{'note': 55, 'time': 2.5, 'duration': 0.25, 'velocity': 100}, # G3
|
|
{'note': 62, 'time': 2.5, 'duration': 0.25, 'velocity': 95}, # D4
|
|
{'note': 57, 'time': 2.75, 'duration': 0.25, 'velocity': 105}, # A3
|
|
{'note': 64, 'time': 2.75, 'duration': 0.25, 'velocity': 100}, # E4
|
|
{'note': 55, 'time': 3.0, 'duration': 0.5, 'velocity': 110}, # G3
|
|
{'note': 62, 'time': 3.0, 'duration': 0.5, 'velocity': 105}, # D4
|
|
{'note': 52, 'time': 3.5, 'duration': 0.5, 'velocity': 115}, # E3 (acento final)
|
|
{'note': 59, 'time': 3.5, 'duration': 0.5, 'velocity': 110}, # B3
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'MidiTrack',
|
|
'name': 'Rhythm Guitar',
|
|
'midi': {
|
|
'notes': rhythm_guitar_pattern,
|
|
'velocity': 105,
|
|
'duration': 0.5,
|
|
'spacing': 0.25,
|
|
'numerator': 4,
|
|
'denominator': 4,
|
|
'groove_id': 0
|
|
},
|
|
'color': 30 # Color rojo
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 8: LEAD GUITAR - Melodía de guitarra solista (MIDI)
|
|
# Pentatónica de E menor típica del rock
|
|
# ====================================================================
|
|
lead_guitar_pattern = [
|
|
# Frase melódica pentatónica de E minor
|
|
{'note': 64, 'time': 0, 'duration': 0.5, 'velocity': 100}, # E4
|
|
{'note': 67, 'time': 0.5, 'duration': 0.25, 'velocity': 105}, # G4
|
|
{'note': 69, 'time': 0.75, 'duration': 0.25, 'velocity': 100}, # A4
|
|
{'note': 71, 'time': 1.0, 'duration': 0.5, 'velocity': 110}, # B4
|
|
{'note': 69, 'time': 1.5, 'duration': 0.25, 'velocity': 100}, # A4
|
|
{'note': 67, 'time': 1.75, 'duration': 0.25, 'velocity': 95}, # G4
|
|
# Bend simulado y resolución
|
|
{'note': 64, 'time': 2.0, 'duration': 0.75, 'velocity': 115}, # E4 (nota larga)
|
|
{'note': 67, 'time': 2.75, 'duration': 0.25, 'velocity': 100}, # G4
|
|
{'note': 64, 'time': 3.0, 'duration': 0.5, 'velocity': 105}, # E4
|
|
{'note': 62, 'time': 3.5, 'duration': 0.25, 'velocity': 100}, # D4
|
|
{'note': 64, 'time': 3.75, 'duration': 0.25, 'velocity': 110}, # E4 (resolución)
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'MidiTrack',
|
|
'name': 'Lead Guitar',
|
|
'midi': {
|
|
'notes': lead_guitar_pattern,
|
|
'velocity': 100,
|
|
'duration': 0.5,
|
|
'spacing': 0.25,
|
|
'numerator': 4,
|
|
'denominator': 4,
|
|
'groove_id': 0
|
|
},
|
|
'color': 45 # Color naranja
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 9: HAMMOND ORGAN - Órgano típico de rock setentero (MIDI)
|
|
# Acordes sostenidos con carácter vintage
|
|
# ====================================================================
|
|
organ_pattern = [
|
|
# Acorde E mayor
|
|
{'note': 52, 'time': 0, 'duration': 2.0, 'velocity': 85}, # E3
|
|
{'note': 56, 'time': 0, 'duration': 2.0, 'velocity': 80}, # G#3
|
|
{'note': 59, 'time': 0, 'duration': 2.0, 'velocity': 80}, # B3
|
|
# Acorde A mayor
|
|
{'note': 57, 'time': 2.0, 'duration': 1.0, 'velocity': 85}, # A3
|
|
{'note': 61, 'time': 2.0, 'duration': 1.0, 'velocity': 80}, # C#4
|
|
{'note': 64, 'time': 2.0, 'duration': 1.0, 'velocity': 80}, # E4
|
|
# Acorde B mayor
|
|
{'note': 59, 'time': 3.0, 'duration': 1.0, 'velocity': 85}, # B3
|
|
{'note': 63, 'time': 3.0, 'duration': 1.0, 'velocity': 80}, # D#4
|
|
{'note': 66, 'time': 3.0, 'duration': 1.0, 'velocity': 80}, # F#4
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'MidiTrack',
|
|
'name': 'Hammond Organ',
|
|
'midi': {
|
|
'notes': organ_pattern,
|
|
'velocity': 80,
|
|
'duration': 2.0,
|
|
'spacing': 1.0,
|
|
'numerator': 4,
|
|
'denominator': 4,
|
|
'groove_id': 0
|
|
},
|
|
'color': 60 # Color verde claro
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 10: PIANO ROCK - Piano acústico para armonía (MIDI)
|
|
# Estilo boogie-woogie / rock and roll
|
|
# ====================================================================
|
|
piano_pattern = [
|
|
# Patrón boogie en E
|
|
{'note': 40, 'time': 0, 'duration': 0.25, 'velocity': 95}, # E2
|
|
{'note': 52, 'time': 0, 'duration': 0.25, 'velocity': 90}, # E3
|
|
{'note': 44, 'time': 0.25, 'duration': 0.25, 'velocity': 85}, # G#2
|
|
{'note': 56, 'time': 0.25, 'duration': 0.25, 'velocity': 80}, # G#3
|
|
{'note': 47, 'time': 0.5, 'duration': 0.25, 'velocity': 90}, # B2
|
|
{'note': 59, 'time': 0.5, 'duration': 0.25, 'velocity': 85}, # B3
|
|
{'note': 44, 'time': 0.75, 'duration': 0.25, 'velocity': 85}, # G#2
|
|
{'note': 56, 'time': 0.75, 'duration': 0.25, 'velocity': 80}, # G#3
|
|
# Repetición
|
|
{'note': 40, 'time': 1.0, 'duration': 0.25, 'velocity': 95}, # E2
|
|
{'note': 52, 'time': 1.0, 'duration': 0.25, 'velocity': 90}, # E3
|
|
{'note': 44, 'time': 1.25, 'duration': 0.25, 'velocity': 85}, # G#2
|
|
{'note': 56, 'time': 1.25, 'duration': 0.25, 'velocity': 80}, # G#3
|
|
{'note': 47, 'time': 1.5, 'duration': 0.25, 'velocity': 90}, # B2
|
|
{'note': 59, 'time': 1.5, 'duration': 0.25, 'velocity': 85}, # B3
|
|
{'note': 48, 'time': 1.75, 'duration': 0.25, 'velocity': 85}, # C3 (blue note)
|
|
{'note': 60, 'time': 1.75, 'duration': 0.25, 'velocity': 80}, # C4
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'MidiTrack',
|
|
'name': 'Rock Piano',
|
|
'midi': {
|
|
'notes': piano_pattern,
|
|
'velocity': 90,
|
|
'duration': 0.25,
|
|
'spacing': 0.25,
|
|
'numerator': 4,
|
|
'denominator': 4,
|
|
'groove_id': 0
|
|
},
|
|
'color': 70 # Color verde
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 11: CLAPS - Para acentos y secciones climáticas
|
|
# ====================================================================
|
|
clap_samples = [
|
|
'Claps/01_Clap.wav',
|
|
'Claps/04_Clap.wav',
|
|
'Claps/08_Clap.wav',
|
|
'Claps/12_Clap.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Claps',
|
|
'samples': clap_samples,
|
|
'color': 55 # Color turquesa
|
|
})
|
|
|
|
# ====================================================================
|
|
# TRACK 12: TAMBOURINE - Pandereta para groove adicional
|
|
# ====================================================================
|
|
tambourine_samples = [
|
|
'Hi Hats/01_Tamb.wav',
|
|
'Percussions/03_Shaker.wav',
|
|
'Percussions/04_Shaker.wav'
|
|
]
|
|
|
|
config['tracks'].append({
|
|
'type': 'AudioTrack',
|
|
'name': 'Tambourine',
|
|
'samples': tambourine_samples,
|
|
'color': 65 # Color verde oscuro
|
|
})
|
|
|
|
# ====================================================================
|
|
# Generar el proyecto
|
|
# ====================================================================
|
|
print("🎸 Generando proyecto de Rock de los 70s...")
|
|
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(" - Kick Drum (bombo potente)")
|
|
print(" - Snare Drum (caja con cuerpo)")
|
|
print(" - Hi-Hat (ritmo constante)")
|
|
print(" - Toms (para fills épicos)")
|
|
print(" - Cymbals (platillos para acentos)")
|
|
print(" - Electric Bass (bajo con groove - MIDI)")
|
|
print(" - Rhythm Guitar (power chords - MIDI)")
|
|
print(" - Lead Guitar (solos pentatónicos - MIDI)")
|
|
print(" - Hammond Organ (órgano vintage - MIDI)")
|
|
print(" - Rock Piano (estilo boogie - MIDI)")
|
|
print(" - Claps (acentos)")
|
|
print(" - Tambourine (groove adicional)")
|
|
|
|
print(f"\n🌟 Características del Rock de los 70s:")
|
|
print(" - Tempo medio (120 BPM)")
|
|
print(" - Tonalidad de E (Mi) - clásica del rock")
|
|
print(" - Power chords en guitarra rítmica")
|
|
print(" - Solos con escala pentatónica menor")
|
|
print(" - Órgano Hammond para ambiente vintage")
|
|
print(" - Bajo con líneas melódicas")
|
|
print(" - Batería potente y orgánica")
|
|
print(" - Piano estilo boogie-woogie")
|
|
|
|
print(f"\n🎵 Inspirado en:")
|
|
print(" - Led Zeppelin")
|
|
print(" - Deep Purple")
|
|
print(" - Black Sabbath")
|
|
print(" - Queen")
|
|
print(" - The Who")
|
|
|
|
return als_file
|
|
|
|
if __name__ == "__main__":
|
|
generate_70s_rock_project()
|