@vessel-dsp/compiler 0.9.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1272,19 +1272,75 @@ const entries = [
1272
1272
  // BA728F", ROHM), Fig. 4's BA718 9-pin SIP block diagram and pin row, which states pin 1
1273
1273
  // through 9 as: VCC, VOUT(1ch), I1, IN1, VEE, IN2, I2, VOUT(2ch), VCC. Electrical
1274
1274
  // characteristics (Ta=25C, VCC=6V, VEE=-6V): "Large signal voltage gain Av ... Min 86 Typ
1275
- // 100 ... dB". Used as `openLoopGain: decibelGain(100)`, the typ figure, matching this
1275
+ // 100 ... dB". Used as `openLoopGain: 100000`, the typ figure, matching this
1276
1276
  // file's convention for the other op-amps above.
1277
1277
  //
1278
- // `boss-cs-3.vdsp`'s `IC4` declares only 5 of the real 9 pins, named plainly `pin1`
1279
- // through `pin5` (no suffix, so `terminalRoleToken` folds every one of them to `null` --
1280
- // this entry cannot be pinout-guarded, the same bound `identify.ts` documents for a part
1281
- // numbered `pin1..pinN`). Declaration order there is sequential ascending pin number, the
1282
- // same convention verified for the NE570 entry above: `pin1`=idx0 through `pin5`=idx4. Read
1283
- // against the real 9-pin table, that is exactly channel 1's five pins in order -- VCC, OUT1,
1284
- // I1 (the inverting/feedback node), IN1, VEE -- a self-contained single-op-amp capture of
1285
- // the chip's first section, with channel 2's pins 6-9 simply absent from this component.
1286
- // Only the three audio terminals matter to `ideal-opamp`; VCC/VEE are not read (rails come
1287
- // from the circuit's own supply set, same as every other entry here).
1278
+ // Two shapes share this part id (one entry each, told apart by arity, the M5218 dual-split
1279
+ // precedent): the full 9-pin dual declaration first, then the older 5-pin single-section
1280
+ // capture. The re-traced `boss-cs-3.vdsp` `IC4` declares all nine in strict sequential
1281
+ // ascending pin order (`pin1`..`pin9`, bare names folding to null roles, so this entry
1282
+ // cannot be pinout-guarded and stays on the documented-positional route with the
1283
+ // cross-check below, the NE570 precedent):
1284
+ // 4a: out=pin2 (node 42), -in=pin3/I1 (node 41), +in=pin4/IN1 (node 5, the 4.5 V rail),
1285
+ // VEE=pin5 (node 0, ground); 4b: +in=pin6/IN2 (node 76, SUSTAIN/ATTACK wiper net),
1286
+ // out=pin7 (node 47 into D6), -in=pin8/I2 (node 47, follower strap), VCC=pin1/pin9
1287
+ // (node 4, 9 V). Each section below carries only its own three audio terminals in the
1288
+ // `ideal-opamp` [+, -, out] order; VCC/VEE are not read (rails come from the circuit's
1289
+ // own supply set, same as every other entry here).
1290
+ {
1291
+ "partIds": [
1292
+ "BA718"
1293
+ ],
1294
+ "declaredTypes": [],
1295
+ "terminalRoleGroups": [],
1296
+ "model": {
1297
+ "kind": "sections",
1298
+ "sections": [
1299
+ {
1300
+ "law": {
1301
+ "kind": "ideal-opamp",
1302
+ "railHigh": null,
1303
+ "railLow": null,
1304
+ "openLoopGain": 100000
1305
+ },
1306
+ "terminals": [
1307
+ 3,
1308
+ 2,
1309
+ 1
1310
+ ]
1311
+ },
1312
+ {
1313
+ "law": {
1314
+ "kind": "ideal-opamp",
1315
+ "railHigh": null,
1316
+ "railLow": null,
1317
+ "openLoopGain": 100000
1318
+ },
1319
+ "terminals": [
1320
+ 5,
1321
+ 6,
1322
+ 7
1323
+ ]
1324
+ }
1325
+ ],
1326
+ "pinout": [
1327
+ null,
1328
+ null,
1329
+ null,
1330
+ null,
1331
+ null,
1332
+ null,
1333
+ null,
1334
+ null,
1335
+ null
1336
+ ]
1337
+ }
1338
+ },
1339
+ // The older BA718 5-pin single-section capture: channel 1's five pins in declaration
1340
+ // order (VCC, OUT1, I1, IN1, VEE), kept working for the pre-retrace capture that declares
1341
+ // only them. Same part id, same typ gain; the 9-pin entry above serves the full dual
1342
+ // declaration. Bare `pin1`..`pin5` names fold to null roles here too, so this entry is
1343
+ // likewise positional with the declaration order as its only assertion.
1288
1344
  {
1289
1345
  "partIds": [
1290
1346
  "BA718"
@@ -4301,6 +4357,114 @@ const entries = [
4301
4357
  // constant is -5.9 mV per dB, over a +/-30 dB range, matching `boss-lm-2`'s own
4302
4358
  // `boss-lm-2-upc1252h2-vca-control.cir` reference deck (`gain_db = -v(ctrl)/0.0059`).
4303
4359
  //
4360
+ // BEHAVIORAL LAW v4 (session-calibrated: threshold/rest-gain + release).
4361
+ // v2 rendered the pedal linear (flat 0.303: the island sigmoid needs volts, GC1
4362
+ // delivers millivolts) and v3 rendered it expanding (the v2 envelope rectified the
4363
+ // cell's virtual-ground node volts, ~100x too small, while raw audio on node 70
4364
+ // pumped the gain). v4 fits the session threshold curves directly: SUSTAIN-coupled
4365
+ // rest (sustainGain -4.23, sustainRef 4.6504 V -- rest gain rises with SUSTAIN,
4366
+ // +27.5 dB across the engine-measured V70 rest span 4.6325->4.6728, inverting the
4367
+ // old -6.8 dB SUSTAIN response with the session curves quoted as cause) plus a
4368
+ // log-domain envelope with a SUSTAIN-tracked knee (envelopeSlope 0.049 V/neper,
4369
+ // kneeBase -0.069 V at V70 4.65 rising 4.36 V/V): below the knee the pedal holds
4370
+ // rest gain, above it each input decade adds the same dB of reduction, and the knee
4371
+ // tracks SUSTAIN so sus-min stays flat to 300 mV while centre and sus-max engage
4372
+ // progressively. Joint fit to the 12-point session sweep (worst residual 0.7 dB);
4373
+ // hot points stay within ~1 dB of the coordinator's renders (no regression).
4374
+ // The island still quotes 4.5 V for its off-chip ctrl_bus (both quoted).
4375
+ //
4376
+ // CENTER (rest span, both quoted): the GC rest moves 4.6325->4.6728 across SUSTAIN
4377
+ // 0->1 (engine-measured at declared defaults). sustainRef 4.6504 V with sustainGain
4378
+ // -4.23 maps that span onto the session rest gains (sus-min -13.2, centre +5.68,
4379
+ // sus-max +14.28 dB at 10 mV in).
4380
+ //
4381
+ // KNEE (threshold moves with SUSTAIN): the knee must sit above 300 mV-equivalent
4382
+ // at sus-min (flat -13.2), near 30-50 mV at centre, and near 10 mV at sus-max --
4383
+ // a fixed knee cannot satisfy 30 mV-off (centre) and 30 mV-on (sus-max) at once,
4384
+ // so it tracks V70 at +4.36 V/V. The chip's true threshold mechanism is
4385
+ // silicon-internal (excluded); LM-2's biasing is unverified (workbench-side).
4386
+ //
4387
+ // SMOOTHING (load-bearing as in v3): node 70 carries tens of millivolts of audio,
4388
+ // so both the external control and the rectified input are smoothed with
4389
+ // attack/release (C8 4.7 uF by R13 10k ~ 47 ms release, D6 charge path ~ 0.5 ms
4390
+ // attack) and held across the Newton loop. Release TC varies with suppression
4391
+ // depth (releaseSlowdown 2400: 50 ms near top, minutes-slow from deep suppression;
4392
+ // releaseShape 6 bends the mid-depth curve down (depth^6 in the slowdown
4393
+ // exponent): 56 ms at half depth instead of 2.45 s, endpoints pinned
4394
+ // (50 ms at top for session-3 immediacy, 120 s at full depth for
4395
+ // cross-take persistence). The v6 pick-attack fit: in-stream gain was
4396
+ // frozen (identical peak/sustain gains across 30-1000 ms dips), so the
4397
+ // engine passed dry ratios through while hardware breathes in the dips;
4398
+ // the shape restores dip recovery without touching settled tones, the v4
4399
+ // threshold fit, or the session-8 shutdown path;
4400
+ // H1 base-attack fix (drive numbers as cause: full-pedal Mayer feed
4401
+ // 20.9 uA peak / 3.51 uA RMS with the jack carrying 0.23 V peaks --
4402
+ // 2.2x the fixture feed that already breathes to 17x -- and GC pooled
4403
+ // identical in peak and body windows (4.6729 vs 4.6728 V), so the miss
4404
+ // is envelope dynamics, not drive). Probe wall: no single attack TC
4405
+ // threads the gate and the bars (bars need <=~5 ms: 8 ms already fails
4406
+ // the threshold sweep 1.96 dB and the synthetic body 0.84; the gate
4407
+ // needs >=12 ms: 8 ms stays frozen ~5.9x; depth-gating and depth-norm
4408
+ // moves fail the medians or the top). The frozen joint is the pegged
4409
+ // release: loud-body targets hit depth 1.0 (0.179 V peak vs 0.15 norm),
4410
+ // where the TC sits at 120 s, so short dips recover ~0%. releaseMax
4411
+ // caps the deep release at 0.8 s -- surgical to depths above ~0.84,
4412
+ // where no fitted bar operates except the v4 slow-end pair (see the
4413
+ // tension note in the H1 entry): ripple, mild-pip and body windows all
4414
+ // live below it, and the session-8 post-gap path is the separate victim
4415
+ // follower;
4416
+ // fit hook for the hot-start + 60 s take, which does not exist yet) -- a fixed
4417
+ // release is refuted by the session (pips annihilated after hot history, passing
4418
+ // after mild history, across the same gap). The 4a/Q6/Q8 auxiliary chain cannot
4419
+ // substitute: 4a's audio input is an open trace residual.
4420
+ //
4421
+ // SHUTDOWN (v5, session-8 victim dependence, on top of the untouched v4 above):
4422
+ // the depth-only release clears slowly everywhere-post-hot, but hardware clears
4423
+ // in <1 s under tone while holding across a 30 s gap -- so the release from a
4424
+ // post-gap transient crush must be victim-dependent, not just depth-dependent.
4425
+ // A fourth follower holds the shutdown: pumped only by hot peaks while primed
4426
+ // (silence builds prime over ~10 s, signal disarms in fractions of a second),
4427
+ // with an absolute gulp threshold (shutdownEdgeVolts) and quadratic size
4428
+ // (shutdownGain fit: D6 conducting hard into the depleted C8 on the first
4429
+ // post-gap peak, the square the D6 diode exponential over the range; the
4430
+ // absolute threshold is the diode forward drop plus topped-C8 headroom, which
4431
+ // is why sine ripple and mild peaks never pump). Render onsets and continuous
4432
+ // tones never pump (priming starts at zero and signal holds it there): the v4
4433
+ // threshold fit is structurally untouched. The shutdown bleeds
4434
+ // victim-dependently (shutdownFastSeconds under sustained signal through the
4435
+ // signal-driven Q6/Q8 collector plus Q7 transconductance discharge,
4436
+ // shutdownSlowSeconds R-only in silence: holds across takes, finite).
4437
+ // Session-8 fit: post-gap pip 0.007x mild, tone from +1 s at baseline flat,
4438
+ // no creep.
4439
+ //
4440
+ // BINDING. `boss-lm-2`'s `IC1_UPC1252H2` spells its pins with role suffixes
4441
+ // (`pin1_input`, `pin2_gc2`, `pin3_gc1`, `pin4_symmetry`, `pin5_iset`,
4442
+ // `pin6_ground_reference`, `pin7_vcc`, `pin8_output`), which fold to
4443
+ // input/gc2/gc1/symmetry/iset/groundreference/vcc/output -- every group below
4444
+ // resolves onto exactly one of those, so it binds by clean role bijection with no
4445
+ // positional assumption. `boss-cs-3`'s `IC3` names its pins bare `pin1`..`pin8`
4446
+ // (roles all null), so it binds positionally in strict sequential pin order, the
4447
+ // NE570 precedent, cross-checked here: pin1 = node 14 (signal in through R9),
4448
+ // pin2/pin3 = node 70 (GC pair, driven by the R11/Q7 detector network), pin4/pin6 =
4449
+ // node 15 (GC3/GND side, coupled to 70 through R8), pin5 = node 17 (ISET through R7
4450
+ // to ground), pin7 = node 4 (9 V rail), pin8 = node 18 (signal out through R6/C5).
4451
+ // The single section below carries [in, ref, out, control] in the `dbx-vca` law order
4452
+ // as canonical positions [0, 5, 7, 2]: in = pin1, ref = pin6 (GND), out = pin8,
4453
+ // control = pin3 (GC1 -- the detector-driven GC pin on both pedals: on `boss-lm-2`
4454
+ // D8/D9 feed node 6, which is pin3_gc1, while pin2_gc2 sits on node 17).
4455
+ //
4456
+ // `inputSiemens` 0.01 is the current-input impedance convention this file already
4457
+ // uses for a current-input VCA pin (the `linear-vca` entries carry the same 0.01);
4458
+ // the absolute level is then set by the external transimpedance (CS-3's R6 10k into
4459
+ // IC2's inverting stage), not by this number alone.
4460
+ //
4461
+ // KNOWN DEVIATIONS (documented, not hidden):
4462
+ // - SUSTAIN rest span, knee track, and envelope slope are fitted to the session
4463
+ // threshold curves (worst residual 0.7 dB); a packet re-trace moving the
4464
+ // SUSTAIN-default bias moves rest with it. LM-2's biasing is unverified:
4465
+ // the entry's numbers are the CS-3's, and LM-2 calibration belongs
4466
+ // workbench-side.
4467
+ //
4304
4468
  // `declaredTypes` deliberately empty. It listed `Circuit.IC`, the format's generic "this is a
4305
4469
  // chip", which identifies nothing and could only ever act as a catch-all: measured 2026-09-04,
4306
4470
  // both corpus users (`boss-cs-3`'s `IC3` and `boss-lm-2`'s `IC1_UPC1252H2`) match by exact part
@@ -4342,11 +4506,13 @@ const entries = [
4342
4506
  "pin6",
4343
4507
  "gnd",
4344
4508
  "ref",
4345
- "ground"
4509
+ "ground",
4510
+ "groundreference"
4346
4511
  ],
4347
4512
  [
4348
4513
  "pin7",
4349
- "vc"
4514
+ "vc",
4515
+ "vcc"
4350
4516
  ],
4351
4517
  [
4352
4518
  "pin8",
@@ -4360,23 +4526,34 @@ const entries = [
4360
4526
  "sections": [
4361
4527
  {
4362
4528
  "law": {
4363
- "kind": "conductance",
4364
- "siemens": 0.01
4365
- },
4366
- "terminals": [
4367
- 0,
4368
- 5
4369
- ]
4370
- },
4371
- {
4372
- "law": {
4373
- "kind": "ota",
4374
- "transconductance": 0.01
4529
+ "kind": "dbx-vca",
4530
+ "inputSiemens": 0.01,
4531
+ "sustainGain": -4.23,
4532
+ "sustainRef": 4.6504,
4533
+ "envelopeSlope": 0.049,
4534
+ "kneeBaseVolts": -0.069,
4535
+ "kneeTrack": 4.36,
4536
+ "attackSeconds": 0.004,
4537
+ "releaseSeconds": 0.05,
4538
+ "releaseSlowdown": 2400,
4539
+ "releaseShape": 6,
4540
+ "releaseMaxSeconds": 0.8,
4541
+ "shutdownEdgeVolts": 0.08,
4542
+ "shutdownGain": 28,
4543
+ "primeRiseSeconds": 10,
4544
+ "primeFallSeconds": 0.15,
4545
+ "shutdownAttackSeconds": 0.00015,
4546
+ "shutdownFastSeconds": 0.025,
4547
+ "shutdownSlowSeconds": 300,
4548
+ "primeRefCurrent": 0.0000005,
4549
+ "minGainDb": -30,
4550
+ "maxGainDb": 30
4375
4551
  },
4376
4552
  "terminals": [
4377
4553
  0,
4378
4554
  5,
4379
- 7
4555
+ 7,
4556
+ 2
4380
4557
  ]
4381
4558
  }
4382
4559
  ],