AnimalMonk commited on
Commit
045125c
Β·
verified Β·
1 Parent(s): f80344f

v3.6: build_schematic.py

Browse files
Files changed (1) hide show
  1. build_schematic.py +88 -88
build_schematic.py CHANGED
@@ -1,4 +1,4 @@
1
- """Generate ANALOG_SCHEMATIC.pdf v3.5 β€” clean graphical layout."""
2
 
3
  import os
4
  from reportlab.lib.pagesizes import letter
@@ -139,7 +139,7 @@ def page1(c):
139
  c.drawCentredString(W / 2, H - 24, "s.AI AUDIO MASTERING SUITE")
140
  c.setFont(BODY, 10)
141
  c.setFillColor(HexColor("#aaaacc"))
142
- c.drawCentredString(W / 2, H - 42, "Analog Signal Flow Schematic \u2022 v3.5 \u2022 Stereo")
143
 
144
  # ── I/O labels ────────────────────────────────────────────────────
145
  top_y = H - bh - 18
@@ -246,93 +246,13 @@ def page1(c):
246
  def page2(c):
247
  arr_x = W / 2
248
 
249
- # ── Stage 3: Stereo Width ─────────────────────────────────────────
250
  s3_y = H - 28
251
- s3_h = 330
252
  s3_x = M
253
  s3_w = W - 2 * M
254
 
255
  def s3_body(c, x, y, w):
256
- # Crossover
257
- cx_h = 48
258
- bx, by = sub_box(c, x, y - cx_h, w, cx_h, "LINKWITZ-RILEY CROSSOVER (4th-order, 200 Hz)")
259
- by = text(c, bx, by, "Two cascaded 2nd-order Butterworth filters", BODY, 8)
260
- by -= 2
261
- equiv(c, bx, by, "Rane AC 22B active crossover")
262
-
263
- y = y - cx_h - 6
264
-
265
- # Split into two columns
266
- col_w = (w - 20) / 2
267
- left_x = x
268
- right_x = x + col_w + 20
269
-
270
- # LOW BAND label
271
- c.setFillColor(ACCENT2)
272
- c.setFont(BOLD, 8)
273
- c.drawCentredString(left_x + col_w / 2, y - 10, "LOW BAND (< 200 Hz)")
274
- c.setFillColor(TEXT_MID)
275
- c.setFont(BODY, 7.5)
276
- c.drawCentredString(left_x + col_w / 2, y - 22, "Untouched \u2014 mono-safe bass")
277
-
278
- # HIGH BAND label
279
- c.setFillColor(ACCENT)
280
- c.setFont(BOLD, 8)
281
- c.drawCentredString(right_x + col_w / 2, y - 10, "HIGH BAND (\u2265 200 Hz)")
282
-
283
- y -= 30
284
-
285
- # M/S boxes on the right
286
- ms_blocks = [
287
- ("M/S ENCODE", "Mid = (L + R) / 2\nSide = (L \u2212 R) / 2",
288
- "Resistor summing matrix (matched 0.1% precision)"),
289
- ("WIDTH CONTROL", "Mid \u00d7 mid_scale\nSide \u00d7 side_scale",
290
- "Energy-preserving: mid_scale = \u221a(2/(1+w\u00b2)) Range: 80\u2013150%"),
291
- ("M/S DECODE", "L = Mid + Side\nR = Mid \u2212 Side",
292
- "Resistor summing matrix"),
293
- ]
294
-
295
- for i, (name, formulas, desc) in enumerate(ms_blocks):
296
- bh = 52
297
- bx2, by2 = sub_box(c, right_x, y - bh, col_w, bh, name)
298
- for line in formulas.split("\n"):
299
- by2 = text(c, bx2, by2, line, MONO, 7.5, TEXT_MID)
300
- text(c, bx2, by2, desc, BODY, 7, TEXT_MID)
301
- if i < 2:
302
- draw_arrow_down(c, right_x + col_w / 2, y - bh, y - bh - 10)
303
- y = y - bh - 14
304
-
305
- # Summing
306
- y -= 6
307
- c.setStrokeColor(ACCENT)
308
- c.setLineWidth(1)
309
- c.line(left_x + col_w / 2, y + 70, left_x + col_w / 2, y + 10) # low band vertical
310
- c.line(left_x + col_w / 2, y + 10, right_x + col_w / 2, y + 10) # horizontal join
311
- c.line(right_x + col_w / 2, y + 30, right_x + col_w / 2, y + 10)
312
- # Plus symbol
313
- cx = (left_x + col_w / 2 + right_x + col_w / 2) / 2
314
- c.setFont(BOLD, 12)
315
- c.setFillColor(ACCENT)
316
- c.drawCentredString(cx, y + 6, "+")
317
-
318
- draw_arrow_down(c, cx, y + 4, y - 8)
319
- y -= 10
320
- c.setFillColor(TEXT_MID)
321
- c.setFont(BODY, 7.5)
322
- c.drawCentredString(cx, y - 4, "Summing amp (clip protection if peak > 1.0)")
323
- equiv(c, x, y - 18, "Brainworx bx_control V2")
324
-
325
- stage_box(c, s3_x, s3_y - s3_h, s3_w, s3_h, "STEREO WIDTH \u2014 FREQUENCY-SELECTIVE M/S MATRIX", s3_body, 3)
326
-
327
- draw_arrow_down(c, arr_x, s3_y - s3_h, s3_y - s3_h - 20)
328
-
329
- # ── Stage 4: Multiband Compressor ────────────────────────────────
330
- s4_y = s3_y - s3_h - 22
331
- s4_h = 350
332
- s4_x = M
333
- s4_w = W - 2 * M
334
-
335
- def s4_body(c, x, y, w):
336
  # Crossover sub-box
337
  xo_h = 38
338
  bx, by = sub_box(c, x, y - xo_h, w, xo_h,
@@ -417,7 +337,87 @@ def page2(c):
417
  y -= 12
418
  equiv(c, x, y, "SSL G384 / Manley Vari-Mu / Maselec MLA-3 (3-band)")
419
 
420
- stage_box(c, s4_x, s4_y - s4_h, s4_w, s4_h, "MULTIBAND COMPRESSOR (3-Band)", s4_body, 4)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
 
422
  draw_arrow_down(c, arr_x, s4_y - s4_h, s4_y - s4_h - 18)
423
  c.setFillColor(TEXT_LIGHT)
@@ -502,9 +502,9 @@ def page3(c):
502
  rows = [
503
  ("1U", "Dangerous Music Liaison", "Input gain / level matching"),
504
  ("2U", "Sontec MEP-250A", "HPF + 4-band parametric EQ"),
 
505
  ("1U", "Rane AC 22B", "Linkwitz-Riley crossover (200 Hz)"),
506
  ("1U", "Brainworx bx_control V2", "M/S encode / width / decode"),
507
- ("3U", "SSL G384 / Manley Vari-Mu / Maselec MLA-3", "3-band multiband compression, bypass at 0"),
508
  ("1U", "Dorrough 40-A + Dangerous ST", "LUFS metering + output gain trim"),
509
  ]
510
 
@@ -556,8 +556,8 @@ def page3(c):
556
  "Pre-Gain\nDrop\n(-18 LUFS)",
557
  "HPF\n15 Hz",
558
  "EQ\n4-Band",
559
- "Stereo\nWidth\n(M/S)",
560
  "Multiband\nComp\n(3-Band)",
 
561
  "LUFS\nNormalize",
562
  "Output",
563
  ]
@@ -608,7 +608,7 @@ def page3(c):
608
 
609
  def build():
610
  c = canvas.Canvas(OUTPUT, pagesize=letter)
611
- c.setTitle("s.AI Audio Mastering Suite \u2014 Analog Signal Flow Schematic v3.5")
612
  c.setAuthor("StudioAI")
613
 
614
  page1(c)
 
1
+ """Generate ANALOG_SCHEMATIC.pdf v3.6 β€” clean graphical layout."""
2
 
3
  import os
4
  from reportlab.lib.pagesizes import letter
 
139
  c.drawCentredString(W / 2, H - 24, "s.AI AUDIO MASTERING SUITE")
140
  c.setFont(BODY, 10)
141
  c.setFillColor(HexColor("#aaaacc"))
142
+ c.drawCentredString(W / 2, H - 42, "Analog Signal Flow Schematic \u2022 v3.6 \u2022 Stereo")
143
 
144
  # ── I/O labels ────────────────────────────────────────────────────
145
  top_y = H - bh - 18
 
246
  def page2(c):
247
  arr_x = W / 2
248
 
249
+ # ── Stage 3: Multiband Compressor ────────────────────────────────
250
  s3_y = H - 28
251
+ s3_h = 350
252
  s3_x = M
253
  s3_w = W - 2 * M
254
 
255
  def s3_body(c, x, y, w):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  # Crossover sub-box
257
  xo_h = 38
258
  bx, by = sub_box(c, x, y - xo_h, w, xo_h,
 
337
  y -= 12
338
  equiv(c, x, y, "SSL G384 / Manley Vari-Mu / Maselec MLA-3 (3-band)")
339
 
340
+ stage_box(c, s3_x, s3_y - s3_h, s3_w, s3_h, "MULTIBAND COMPRESSOR (3-Band)", s3_body, 3)
341
+
342
+ draw_arrow_down(c, arr_x, s3_y - s3_h, s3_y - s3_h - 20)
343
+
344
+ # ── Stage 4: Stereo Width ─────────────────────────────────────────
345
+ s4_y = s3_y - s3_h - 22
346
+ s4_h = 330
347
+ s4_x = M
348
+ s4_w = W - 2 * M
349
+
350
+ def s4_body(c, x, y, w):
351
+ # Crossover
352
+ cx_h = 48
353
+ bx, by = sub_box(c, x, y - cx_h, w, cx_h, "LINKWITZ-RILEY CROSSOVER (4th-order, 200 Hz)")
354
+ by = text(c, bx, by, "Two cascaded 2nd-order Butterworth filters", BODY, 8)
355
+ by -= 2
356
+ equiv(c, bx, by, "Rane AC 22B active crossover")
357
+
358
+ y = y - cx_h - 6
359
+
360
+ # Split into two columns
361
+ col_w = (w - 20) / 2
362
+ left_x = x
363
+ right_x = x + col_w + 20
364
+
365
+ # LOW BAND label
366
+ c.setFillColor(ACCENT2)
367
+ c.setFont(BOLD, 8)
368
+ c.drawCentredString(left_x + col_w / 2, y - 10, "LOW BAND (< 200 Hz)")
369
+ c.setFillColor(TEXT_MID)
370
+ c.setFont(BODY, 7.5)
371
+ c.drawCentredString(left_x + col_w / 2, y - 22, "Untouched \u2014 mono-safe bass")
372
+
373
+ # HIGH BAND label
374
+ c.setFillColor(ACCENT)
375
+ c.setFont(BOLD, 8)
376
+ c.drawCentredString(right_x + col_w / 2, y - 10, "HIGH BAND (\u2265 200 Hz)")
377
+
378
+ y -= 30
379
+
380
+ # M/S boxes on the right
381
+ ms_blocks = [
382
+ ("M/S ENCODE", "Mid = (L + R) / 2\nSide = (L \u2212 R) / 2",
383
+ "Resistor summing matrix (matched 0.1% precision)"),
384
+ ("WIDTH CONTROL", "Mid \u00d7 mid_scale\nSide \u00d7 side_scale",
385
+ "Energy-preserving: mid_scale = \u221a(2/(1+w\u00b2)) Range: 80\u2013150%"),
386
+ ("M/S DECODE", "L = Mid + Side\nR = Mid \u2212 Side",
387
+ "Resistor summing matrix"),
388
+ ]
389
+
390
+ for i, (name, formulas, desc) in enumerate(ms_blocks):
391
+ bh = 52
392
+ bx2, by2 = sub_box(c, right_x, y - bh, col_w, bh, name)
393
+ for line in formulas.split("\n"):
394
+ by2 = text(c, bx2, by2, line, MONO, 7.5, TEXT_MID)
395
+ text(c, bx2, by2, desc, BODY, 7, TEXT_MID)
396
+ if i < 2:
397
+ draw_arrow_down(c, right_x + col_w / 2, y - bh, y - bh - 10)
398
+ y = y - bh - 14
399
+
400
+ # Summing
401
+ y -= 6
402
+ c.setStrokeColor(ACCENT)
403
+ c.setLineWidth(1)
404
+ c.line(left_x + col_w / 2, y + 70, left_x + col_w / 2, y + 10) # low band vertical
405
+ c.line(left_x + col_w / 2, y + 10, right_x + col_w / 2, y + 10) # horizontal join
406
+ c.line(right_x + col_w / 2, y + 30, right_x + col_w / 2, y + 10)
407
+ # Plus symbol
408
+ cx = (left_x + col_w / 2 + right_x + col_w / 2) / 2
409
+ c.setFont(BOLD, 12)
410
+ c.setFillColor(ACCENT)
411
+ c.drawCentredString(cx, y + 6, "+")
412
+
413
+ draw_arrow_down(c, cx, y + 4, y - 8)
414
+ y -= 10
415
+ c.setFillColor(TEXT_MID)
416
+ c.setFont(BODY, 7.5)
417
+ c.drawCentredString(cx, y - 4, "Summing amp (clip protection if peak > 1.0)")
418
+ equiv(c, x, y - 18, "Brainworx bx_control V2")
419
+
420
+ stage_box(c, s4_x, s4_y - s4_h, s4_w, s4_h, "STEREO WIDTH \u2014 FREQUENCY-SELECTIVE M/S MATRIX", s4_body, 4)
421
 
422
  draw_arrow_down(c, arr_x, s4_y - s4_h, s4_y - s4_h - 18)
423
  c.setFillColor(TEXT_LIGHT)
 
502
  rows = [
503
  ("1U", "Dangerous Music Liaison", "Input gain / level matching"),
504
  ("2U", "Sontec MEP-250A", "HPF + 4-band parametric EQ"),
505
+ ("3U", "SSL G384 / Manley Vari-Mu / Maselec MLA-3", "3-band multiband compression, bypass at 0"),
506
  ("1U", "Rane AC 22B", "Linkwitz-Riley crossover (200 Hz)"),
507
  ("1U", "Brainworx bx_control V2", "M/S encode / width / decode"),
 
508
  ("1U", "Dorrough 40-A + Dangerous ST", "LUFS metering + output gain trim"),
509
  ]
510
 
 
556
  "Pre-Gain\nDrop\n(-18 LUFS)",
557
  "HPF\n15 Hz",
558
  "EQ\n4-Band",
 
559
  "Multiband\nComp\n(3-Band)",
560
+ "Stereo\nWidth\n(M/S)",
561
  "LUFS\nNormalize",
562
  "Output",
563
  ]
 
608
 
609
  def build():
610
  c = canvas.Canvas(OUTPUT, pagesize=letter)
611
+ c.setTitle("s.AI Audio Mastering Suite \u2014 Analog Signal Flow Schematic v3.6")
612
  c.setAuthor("StudioAI")
613
 
614
  page1(c)