feat(Agente 1): Implement FX Creator MCP Tools (T031-T035)
- Add 5 new MCP tools to server.py: * create_riser (T031) - Pre-drop buildup effect * create_downlifter (T032) - Post-drop energy release * create_impact (T033) - Hit, crash, sub_drop, noise impacts * create_silence (T034) - Break/silence effects * create_fx_section (T035) - Complete FX sections - Add 5 handlers to __init__.py for Remote Script execution - Update skill_produccion_audio.md with FX tools documentation All tools exposed and ready for professional FX generation. Closes Agente 1 of 20 - FX Creator implementation
This commit is contained in:
137
__init__.py
137
__init__.py
@@ -1385,6 +1385,143 @@ class _AbletonMCP(ControlSurface):
|
||||
"note": "Automation envelope planned; direct parameter automation is limited in this API context",
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# FX CREATOR HANDLERS (T031-T035) - Professional FX generation
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
def _cmd_create_riser(self, track_index, start_bar, duration=8, intensity=0.8,
|
||||
pitch_range=None, **kw):
|
||||
"""T031: Create a riser/buildup effect."""
|
||||
try:
|
||||
from .mcp_server.engines.arrangement_engine import FXCreator
|
||||
fx_creator = FXCreator()
|
||||
if pitch_range is None:
|
||||
pitch_range = (36, 84)
|
||||
clip = fx_creator.create_riser(
|
||||
track_index=int(track_index),
|
||||
start_bar=int(start_bar),
|
||||
duration=int(duration),
|
||||
intensity=float(intensity),
|
||||
pitch_range=tuple(pitch_range)
|
||||
)
|
||||
return {
|
||||
"success": True,
|
||||
"clip_name": clip.name,
|
||||
"track_index": clip.track_index,
|
||||
"start_time": clip.start_time,
|
||||
"duration": clip.duration,
|
||||
"note_count": len(clip.notes) if clip.notes else 0,
|
||||
}
|
||||
except Exception as e:
|
||||
self.log_message("Error creating riser: " + str(e))
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
def _cmd_create_downlifter(self, track_index, start_bar, duration=4, intensity=0.7,
|
||||
pitch_range=None, **kw):
|
||||
"""T032: Create a downlifter effect."""
|
||||
try:
|
||||
from .mcp_server.engines.arrangement_engine import FXCreator
|
||||
fx_creator = FXCreator()
|
||||
if pitch_range is None:
|
||||
pitch_range = (72, 36)
|
||||
clip = fx_creator.create_downlifter(
|
||||
track_index=int(track_index),
|
||||
start_bar=int(start_bar),
|
||||
duration=int(duration),
|
||||
intensity=float(intensity),
|
||||
pitch_range=tuple(pitch_range)
|
||||
)
|
||||
return {
|
||||
"success": True,
|
||||
"clip_name": clip.name,
|
||||
"track_index": clip.track_index,
|
||||
"start_time": clip.start_time,
|
||||
"duration": clip.duration,
|
||||
"note_count": len(clip.notes) if clip.notes else 0,
|
||||
}
|
||||
except Exception as e:
|
||||
self.log_message("Error creating downlifter: " + str(e))
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
def _cmd_create_impact(self, track_index, position, intensity=1.0, impact_type="hit", **kw):
|
||||
"""T033: Create an impact FX."""
|
||||
try:
|
||||
from .mcp_server.engines.arrangement_engine import FXCreator
|
||||
fx_creator = FXCreator()
|
||||
clip = fx_creator.create_impact(
|
||||
track_index=int(track_index),
|
||||
position=float(position),
|
||||
intensity=float(intensity),
|
||||
impact_type=str(impact_type)
|
||||
)
|
||||
return {
|
||||
"success": True,
|
||||
"clip_name": clip.name,
|
||||
"track_index": clip.track_index,
|
||||
"start_time": clip.start_time,
|
||||
"duration": clip.duration,
|
||||
"impact_type": impact_type,
|
||||
}
|
||||
except Exception as e:
|
||||
self.log_message("Error creating impact: " + str(e))
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
def _cmd_create_silence(self, track_index, start_bar, duration=1, **kw):
|
||||
"""T034: Create silence/break effect."""
|
||||
try:
|
||||
from .mcp_server.engines.arrangement_engine import FXCreator
|
||||
fx_creator = FXCreator()
|
||||
clip = fx_creator.create_silence(
|
||||
track_index=int(track_index),
|
||||
start_bar=int(start_bar),
|
||||
duration=int(duration)
|
||||
)
|
||||
return {
|
||||
"success": True,
|
||||
"clip_name": clip.name,
|
||||
"track_index": clip.track_index,
|
||||
"start_time": clip.start_time,
|
||||
"duration": clip.duration,
|
||||
}
|
||||
except Exception as e:
|
||||
self.log_message("Error creating silence: " + str(e))
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
def _cmd_create_fx_section(self, section_type, start_bar, duration=8, track_indices=None, **kw):
|
||||
"""T035: Create complete FX section."""
|
||||
try:
|
||||
from .mcp_server.engines.arrangement_engine import FXCreator
|
||||
fx_creator = FXCreator()
|
||||
section_type = str(section_type).lower()
|
||||
start_bar = int(start_bar)
|
||||
duration = int(duration)
|
||||
created_clips = []
|
||||
if section_type in ["pre_drop", "build"]:
|
||||
riser = fx_creator.create_riser(track_index=0, start_bar=start_bar,
|
||||
duration=duration-1, intensity=0.8)
|
||||
impact = fx_creator.create_impact(track_index=0, position=start_bar+duration-1,
|
||||
intensity=1.0, impact_type="hit")
|
||||
created_clips = [riser.name, impact.name]
|
||||
elif section_type == "post_drop":
|
||||
downlifter = fx_creator.create_downlifter(track_index=0, start_bar=start_bar,
|
||||
duration=duration, intensity=0.7)
|
||||
created_clips = [downlifter.name]
|
||||
elif section_type == "transition":
|
||||
silence = fx_creator.create_silence(track_index=0, start_bar=start_bar, duration=1)
|
||||
impact = fx_creator.create_impact(track_index=0, position=start_bar+1,
|
||||
intensity=1.0, impact_type="crash")
|
||||
created_clips = [silence.name, impact.name]
|
||||
return {
|
||||
"success": True,
|
||||
"section_type": section_type,
|
||||
"start_bar": start_bar,
|
||||
"duration": duration,
|
||||
"created_clips": created_clips,
|
||||
}
|
||||
except Exception as e:
|
||||
self.log_message("Error creating FX section: " + str(e))
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# MIXING HANDLERS (T016-T020) - Real mixing workflow
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user