Skip to content

Commit e5e2dc4

Browse files
refactor: apply consistent code formatting and style improvements across the codebase
1 parent fb93b1f commit e5e2dc4

51 files changed

Lines changed: 889 additions & 559 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fl_controller/FLStudioMCP/device_FLStudioMCP.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ def OnInit():
121121
"responses cannot be sent back to the MCP server."
122122
)
123123
# Enable track metering
124-
try:
124+
with contextlib.suppress(Exception):
125125
device.setHasMeters()
126-
except Exception:
127-
pass
128126
# Send a heartbeat immediately so the server doesn't have to wait.
129127
_emit_heartbeat()
130128
return
@@ -617,7 +615,7 @@ def _vol_out(norm):
617615

618616
# Mixer-specific fader calibration data (empirically swept)
619617
MIXER_CALIBRATION = [
620-
(0.0000, float('-inf')),
618+
(0.0000, float("-inf")),
621619
(0.0100, -50.3347),
622620
(0.0200, -44.1829),
623621
(0.0300, -40.5293),
@@ -734,7 +732,7 @@ def _mixer_db_to_norm(db):
734732
return 1.0
735733
for i in range(1, len(MIXER_CALIBRATION) - 1):
736734
x0, y0 = MIXER_CALIBRATION[i]
737-
x1, y1 = MIXER_CALIBRATION[i+1]
735+
x1, y1 = MIXER_CALIBRATION[i + 1]
738736
if y0 <= db <= y1:
739737
return x0 + (db - y0) * (x1 - x0) / (y1 - y0)
740738
return 1.0
@@ -772,17 +770,19 @@ def _h_mixer_set_pan(p):
772770
mixer.setTrackPan(t, _clamp_pan(p["value"]))
773771
return {"track": t, "pan": round(mixer.getTrackPan(t), 4)}
774772

773+
775774
def _h_mixer_set_stereo_sep(p):
776775
t = int(p["track"])
777776
val = max(-1.0, min(1.0, float(p["value"])))
778777
if hasattr(mixer, "setTrackStereoSep"):
779778
mixer.setTrackStereoSep(t, val)
780-
779+
781780
current = 0.0
782781
if hasattr(mixer, "getTrackStereoSep"):
783782
current = round(mixer.getTrackStereoSep(t), 4)
784783
return {"track": t, "stereo_sep": current}
785784

785+
786786
def _h_mixer_get_stereo_sep(p):
787787
t = int(p["track"])
788788
current = 0.0
@@ -1097,11 +1097,12 @@ def _h_mixer_get_free_track(p):
10971097
return {"track": int(t)}
10981098
except Exception:
10991099
pass
1100-
1100+
11011101
# Fallback manual scan if getFreeTrack is unavailable or returned a lower track
11021102
start = int(p.get("start", 1))
11031103
for i in range(start, mixer.trackCount()):
1104-
if i == 0: continue
1104+
if i == 0:
1105+
continue
11051106
name = mixer.getTrackName(i)
11061107
if not (name.startswith("Insert ") or name.startswith("Track ")):
11071108
continue
@@ -1771,10 +1772,8 @@ def _h_mixer_get_slot(p):
17711772
mute_fn = getattr(plugins, "getPluginMuteState", None)
17721773
enabled = True
17731774
if mute_fn is not None:
1774-
try:
1775+
with contextlib.suppress(Exception):
17751776
enabled = not bool(mute_fn(track, slot))
1776-
except Exception:
1777-
pass
17781777
return {
17791778
"track": track,
17801779
"slot": slot,
@@ -1834,12 +1833,12 @@ def _h_mixer_get_eq(p):
18341833
except TypeError:
18351834
# Fallback if FL Studio version does not support mode
18361835
gain = round(mixer.getEqGain(track, b), 4)
1837-
1836+
18381837
try:
18391838
frequency = round(mixer.getEqFrequency(track, b, mode), 4)
18401839
except TypeError:
18411840
frequency = round(mixer.getEqFrequency(track, b), 4)
1842-
1841+
18431842
bands.append(
18441843
{
18451844
"band": b,
@@ -2052,7 +2051,7 @@ def _h_set_time_sig(p):
20522051
general.setNumerator(num)
20532052
general.setDenominator(den)
20542053
except Exception as e:
2055-
raise _ClientError(f"failed to set time signature: {e}")
2054+
raise _ClientError(f"failed to set time signature: {e}") from e
20562055
return _h_get_time_sig({})
20572056

20582057

@@ -2145,10 +2144,8 @@ def _h_channel_set_steps(p):
21452144
except Exception as e:
21462145
failures.append({"step": step_idx, "param": "pitch", "error": str(e)})
21472146

2148-
try:
2147+
with contextlib.suppress(Exception):
21492148
channels.updateGraphEditor()
2150-
except Exception:
2151-
pass
21522149
out = _h_channel_get_steps({"channel": idx, "pattern": target_pattern})
21532150
if failures:
21542151
out["step_param_failures"] = failures

knowledgebase/known_pitfalls/channel_pattern_indexing.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
"topic": "FL Studio Channel and Pattern Index Synchronization",
33
"date": "2026-06-06",
44
"author": "Antigravity",
5-
"affected_apis": [
6-
"CMD_CHANNEL_ROUTING_SUMMARY",
7-
"channel_list",
8-
"pattern_list"
9-
],
105
"confidence_level": "implementation_verified",
116
"context": "When matching channels and patterns for batch configuration operations, using fixed channel indices from routing states led to misaligned patterns when FL Studio's dynamic rack indices shifted.",
127
"observation": "channel_list returns a dynamically shifting 'i' index. Split by channel creates patterns directly tied to this dynamic channel index (pattern_index = channel_index + 1). Hardcoding names to indices without matching the names in the current list pass causes off-by-one errors.",
138
"result": "Unintentionally renamed patterns or completely missed pattern updates.",
149
"recommended_action": "Always verify 'c[\"name\"]' directly to identify the target element before issuing a rename or color command. Derive 'pat_idx = c[\"i\"] + 1' dynamically from the channel_list match.",
1510
"open_questions": [
1611
"Is there an internal, immutable UUID-like identifier for Channels or Patterns across the bridge?"
17-
]
18-
}
12+
],
13+
"affected_api": "CMD_CHANNEL_ROUTING_SUMMARY, channel_list, pattern_list",
14+
"source_method": "N/A",
15+
"tested_values": "N/A",
16+
"next_recommended_action": "N/A"
17+
}

knowledgebase/mastering/mastering_boundaries.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
],
7272
"confidence_level": "docs_confirmed"
7373
}
74-
]
75-
}
76-
74+
],
75+
"affected_api": "N/A",
76+
"observation": "N/A",
77+
"tested_values": "N/A",
78+
"context": "N/A",
79+
"result": "N/A",
80+
"open_questions": "N/A",
81+
"next_recommended_action": "N/A"
82+
}

knowledgebase/mixing/mixing_fundamentals.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,12 @@
120120
],
121121
"confidence_level": "docs_confirmed"
122122
}
123-
]
124-
}
123+
],
124+
"affected_api": "N/A",
125+
"observation": "N/A",
126+
"tested_values": "N/A",
127+
"context": "N/A",
128+
"result": "N/A",
129+
"open_questions": "N/A",
130+
"next_recommended_action": "N/A"
131+
}

knowledgebase/performance/fl_studio_cpu_optimization.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@
131131
],
132132
"confidence_level": "docs_confirmed"
133133
}
134-
]
135-
}
136-
134+
],
135+
"affected_api": "N/A",
136+
"observation": "N/A",
137+
"tested_values": "N/A",
138+
"context": "N/A",
139+
"result": "N/A",
140+
"open_questions": "N/A",
141+
"next_recommended_action": "N/A"
142+
}

knowledgebase/production/fl_studio_workflow_standards.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@
7474
],
7575
"confidence_level": "docs_confirmed"
7676
}
77-
]
78-
}
79-
77+
],
78+
"affected_api": "N/A",
79+
"observation": "N/A",
80+
"tested_values": "N/A",
81+
"context": "N/A",
82+
"result": "N/A",
83+
"open_questions": "N/A",
84+
"next_recommended_action": "N/A"
85+
}

knowledgebase/recipes/mix_doctor_fixes.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,12 @@
109109
],
110110
"confidence_level": "implementation_verified"
111111
}
112-
]
113-
}
112+
],
113+
"affected_api": "N/A",
114+
"observation": "N/A",
115+
"tested_values": "N/A",
116+
"context": "N/A",
117+
"result": "N/A",
118+
"open_questions": "N/A",
119+
"next_recommended_action": "N/A"
120+
}

0 commit comments

Comments
 (0)