@vessel-dsp/compiler 0.0.0-stage → 0.2.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.
- package/README.md +314 -2
- package/dist/bake.d.ts +38 -0
- package/dist/bake.d.ts.map +1 -0
- package/dist/bake.js +101 -0
- package/dist/bake.js.map +1 -0
- package/dist/bbd-clock.d.ts +171 -0
- package/dist/bbd-clock.d.ts.map +1 -0
- package/dist/bbd-clock.js +1750 -0
- package/dist/bbd-clock.js.map +1 -0
- package/dist/block-row.d.ts +51 -0
- package/dist/block-row.d.ts.map +1 -0
- package/dist/block-row.js +17 -0
- package/dist/block-row.js.map +1 -0
- package/dist/bypass.d.ts +3 -0
- package/dist/bypass.d.ts.map +1 -0
- package/dist/bypass.js +228 -0
- package/dist/bypass.js.map +1 -0
- package/dist/compile.d.ts +24 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +344 -0
- package/dist/compile.js.map +1 -0
- package/dist/converter-scale.d.ts +14 -0
- package/dist/converter-scale.d.ts.map +1 -0
- package/dist/converter-scale.js +133 -0
- package/dist/converter-scale.js.map +1 -0
- package/dist/couple.d.ts +28 -0
- package/dist/couple.d.ts.map +1 -0
- package/dist/couple.js +567 -0
- package/dist/couple.js.map +1 -0
- package/dist/dangling-active-terminal.d.ts +47 -0
- package/dist/dangling-active-terminal.d.ts.map +1 -0
- package/dist/dangling-active-terminal.js +542 -0
- package/dist/dangling-active-terminal.js.map +1 -0
- package/dist/declared-program.d.ts +23 -0
- package/dist/declared-program.d.ts.map +1 -0
- package/dist/declared-program.js +387 -0
- package/dist/declared-program.js.map +1 -0
- package/dist/denomination.d.ts +48 -0
- package/dist/denomination.d.ts.map +1 -0
- package/dist/denomination.js +27 -0
- package/dist/denomination.js.map +1 -0
- package/dist/device-laws.d.ts +237 -0
- package/dist/device-laws.d.ts.map +1 -0
- package/dist/device-laws.js +3497 -0
- package/dist/device-laws.js.map +1 -0
- package/dist/diagnostics.d.ts +13 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +19 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/emit.d.ts +8 -0
- package/dist/emit.d.ts.map +1 -0
- package/dist/emit.js +43 -0
- package/dist/emit.js.map +1 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +39 -0
- package/dist/errors.js.map +1 -0
- package/dist/firmware-class.d.ts +69 -0
- package/dist/firmware-class.d.ts.map +1 -0
- package/dist/firmware-class.js +20 -0
- package/dist/firmware-class.js.map +1 -0
- package/dist/fixtures/circuits.d.ts +1721 -0
- package/dist/fixtures/circuits.d.ts.map +1 -0
- package/dist/fixtures/circuits.js +13404 -0
- package/dist/fixtures/circuits.js.map +1 -0
- package/dist/fixtures/expected.d.ts +257 -0
- package/dist/fixtures/expected.d.ts.map +1 -0
- package/dist/fixtures/expected.js +311 -0
- package/dist/fixtures/expected.js.map +1 -0
- package/dist/fixtures/index.d.ts +4 -0
- package/dist/fixtures/index.d.ts.map +1 -0
- package/dist/fixtures/index.js +8 -0
- package/dist/fixtures/index.js.map +1 -0
- package/dist/fixtures/registry.d.ts +52 -0
- package/dist/fixtures/registry.d.ts.map +1 -0
- package/dist/fixtures/registry.js +341 -0
- package/dist/fixtures/registry.js.map +1 -0
- package/dist/generic-tube-fit.d.ts +12 -0
- package/dist/generic-tube-fit.d.ts.map +1 -0
- package/dist/generic-tube-fit.js +45 -0
- package/dist/generic-tube-fit.js.map +1 -0
- package/dist/grounded-clock-supply.d.ts +13 -0
- package/dist/grounded-clock-supply.d.ts.map +1 -0
- package/dist/grounded-clock-supply.js +45 -0
- package/dist/grounded-clock-supply.js.map +1 -0
- package/dist/identify.d.ts +50 -0
- package/dist/identify.d.ts.map +1 -0
- package/dist/identify.js +319 -0
- package/dist/identify.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/inert-controls.d.ts +15 -0
- package/dist/inert-controls.d.ts.map +1 -0
- package/dist/inert-controls.js +266 -0
- package/dist/inert-controls.js.map +1 -0
- package/dist/latch-seed.d.ts +53 -0
- package/dist/latch-seed.d.ts.map +1 -0
- package/dist/latch-seed.js +257 -0
- package/dist/latch-seed.js.map +1 -0
- package/dist/link.d.ts +7 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +270 -0
- package/dist/link.js.map +1 -0
- package/dist/lower.d.ts +79 -0
- package/dist/lower.d.ts.map +1 -0
- package/dist/lower.js +1855 -0
- package/dist/lower.js.map +1 -0
- package/dist/netlist.d.ts +79 -0
- package/dist/netlist.d.ts.map +1 -0
- package/dist/netlist.js +4746 -0
- package/dist/netlist.js.map +1 -0
- package/dist/non-executable-clock-drivers.d.ts +8 -0
- package/dist/non-executable-clock-drivers.d.ts.map +1 -0
- package/dist/non-executable-clock-drivers.js +33 -0
- package/dist/non-executable-clock-drivers.js.map +1 -0
- package/dist/open-category.d.ts +98 -0
- package/dist/open-category.d.ts.map +1 -0
- package/dist/open-category.js +111 -0
- package/dist/open-category.js.map +1 -0
- package/dist/over-driven-node.d.ts +33 -0
- package/dist/over-driven-node.d.ts.map +1 -0
- package/dist/over-driven-node.js +188 -0
- package/dist/over-driven-node.js.map +1 -0
- package/dist/part-catalog.d.ts +7 -0
- package/dist/part-catalog.d.ts.map +1 -0
- package/dist/part-catalog.js +6639 -0
- package/dist/part-catalog.js.map +1 -0
- package/dist/part-number.d.ts +32 -0
- package/dist/part-number.d.ts.map +1 -0
- package/dist/part-number.js +80 -0
- package/dist/part-number.js.map +1 -0
- package/dist/partition.d.ts +7 -0
- package/dist/partition.d.ts.map +1 -0
- package/dist/partition.js +242 -0
- package/dist/partition.js.map +1 -0
- package/dist/port-full-scale.d.ts +70 -0
- package/dist/port-full-scale.d.ts.map +1 -0
- package/dist/port-full-scale.js +235 -0
- package/dist/port-full-scale.js.map +1 -0
- package/dist/pot-orientation.d.ts +114 -0
- package/dist/pot-orientation.d.ts.map +1 -0
- package/dist/pot-orientation.js +551 -0
- package/dist/pot-orientation.js.map +1 -0
- package/dist/power-domain-control.d.ts +40 -0
- package/dist/power-domain-control.d.ts.map +1 -0
- package/dist/power-domain-control.js +142 -0
- package/dist/power-domain-control.js.map +1 -0
- package/dist/proxy-declaration.d.ts +121 -0
- package/dist/proxy-declaration.d.ts.map +1 -0
- package/dist/proxy-declaration.js +50 -0
- package/dist/proxy-declaration.js.map +1 -0
- package/dist/registry.d.ts +323 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +192 -0
- package/dist/registry.js.map +1 -0
- package/dist/sparse-schedule.d.ts +65 -0
- package/dist/sparse-schedule.d.ts.map +1 -0
- package/dist/sparse-schedule.js +421 -0
- package/dist/sparse-schedule.js.map +1 -0
- package/dist/speaker-load.d.ts +38 -0
- package/dist/speaker-load.d.ts.map +1 -0
- package/dist/speaker-load.js +97 -0
- package/dist/speaker-load.js.map +1 -0
- package/dist/stage-coverage.d.ts +21 -0
- package/dist/stage-coverage.d.ts.map +1 -0
- package/dist/stage-coverage.js +124 -0
- package/dist/stage-coverage.js.map +1 -0
- package/dist/stamp-partition.d.ts +314 -0
- package/dist/stamp-partition.d.ts.map +1 -0
- package/dist/stamp-partition.js +472 -0
- package/dist/stamp-partition.js.map +1 -0
- package/dist/supply-reference.d.ts +19 -0
- package/dist/supply-reference.d.ts.map +1 -0
- package/dist/supply-reference.js +66 -0
- package/dist/supply-reference.js.map +1 -0
- package/dist/supply-short.d.ts +32 -0
- package/dist/supply-short.d.ts.map +1 -0
- package/dist/supply-short.js +118 -0
- package/dist/supply-short.js.map +1 -0
- package/dist/supply-stamps.d.ts +51 -0
- package/dist/supply-stamps.d.ts.map +1 -0
- package/dist/supply-stamps.js +363 -0
- package/dist/supply-stamps.js.map +1 -0
- package/dist/terminal-role.d.ts +109 -0
- package/dist/terminal-role.d.ts.map +1 -0
- package/dist/terminal-role.js +46 -0
- package/dist/terminal-role.js.map +1 -0
- package/dist/terminal-roles.d.ts +59 -0
- package/dist/terminal-roles.d.ts.map +1 -0
- package/dist/terminal-roles.js +92 -0
- package/dist/terminal-roles.js.map +1 -0
- package/dist/transformer.d.ts +181 -0
- package/dist/transformer.d.ts.map +1 -0
- package/dist/transformer.js +476 -0
- package/dist/transformer.js.map +1 -0
- package/dist/types.d.ts +3157 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/unbounded-operating-point.d.ts +35 -0
- package/dist/unbounded-operating-point.d.ts.map +1 -0
- package/dist/unbounded-operating-point.js +181 -0
- package/dist/unbounded-operating-point.js.map +1 -0
- package/dist/unexecuted-region.d.ts +3 -0
- package/dist/unexecuted-region.d.ts.map +1 -0
- package/dist/unexecuted-region.js +122 -0
- package/dist/unexecuted-region.js.map +1 -0
- package/dist/unimplemented-control-role.d.ts +3 -0
- package/dist/unimplemented-control-role.d.ts.map +1 -0
- package/dist/unimplemented-control-role.js +61 -0
- package/dist/unimplemented-control-role.js.map +1 -0
- package/dist/unreachable-output.d.ts +3 -0
- package/dist/unreachable-output.d.ts.map +1 -0
- package/dist/unreachable-output.js +97 -0
- package/dist/unreachable-output.js.map +1 -0
- package/dist/unreadable-terminal-role.d.ts +67 -0
- package/dist/unreadable-terminal-role.d.ts.map +1 -0
- package/dist/unreadable-terminal-role.js +409 -0
- package/dist/unreadable-terminal-role.js.map +1 -0
- package/dist/unverified-pinout.d.ts +27 -0
- package/dist/unverified-pinout.d.ts.map +1 -0
- package/dist/unverified-pinout.js +121 -0
- package/dist/unverified-pinout.js.map +1 -0
- package/package.json +75 -5
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// Hand-computed expected values.
|
|
2
|
+
//
|
|
3
|
+
// Written down from the circuit, never captured from the implementation. A snapshot
|
|
4
|
+
// of current output only proves the code still does what it did; a divider ratio
|
|
5
|
+
// proves it is right.
|
|
6
|
+
/** Two equal resistors in series: the midpoint sits at half the input. */
|
|
7
|
+
export const dividerGain = 0.5;
|
|
8
|
+
/** R = 10k, C = 10n -> f_c = 1 / (2*pi*R*C). */
|
|
9
|
+
export const rcCornerHz = 1 / (2 * Math.PI * 10_000 * 10e-9);
|
|
10
|
+
/** A first-order low pass is -3 dB at its corner: |H| = 1/sqrt(2). */
|
|
11
|
+
export const rcGainAtCorner = 1 / Math.SQRT2;
|
|
12
|
+
/** A linear pot at position x divides by x. */
|
|
13
|
+
export function potGainAt(position) {
|
|
14
|
+
return position;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A 10k series resistor into anti-parallel diodes clips well below the drive level.
|
|
18
|
+
* Silicon conducts hard by roughly 0.7 V, so a 5 V peak must come out under 1 V.
|
|
19
|
+
*/
|
|
20
|
+
export const clipperCeilingVolts = 1;
|
|
21
|
+
/**
|
|
22
|
+
* Diode clipper peak voltage knee at 5 V drive with 10 kΩ series resistor.
|
|
23
|
+
* Shockley equation: I ≈ (5 - 0.55)/10k = 0.445 mA.
|
|
24
|
+
* V_d = n * V_t * ln(I / I_s) = 1.752 * 0.02585 * ln(0.445e-3 / 2.52e-9) ≈ 0.546 V.
|
|
25
|
+
*/
|
|
26
|
+
export const diodeClipperPeakVolts = 0.546;
|
|
27
|
+
/**
|
|
28
|
+
* LED clipper peak voltage knee at 5 V drive with 10 kΩ series resistor.
|
|
29
|
+
* Shockley equation: I ≈ (5 - 1.72)/10k = 0.328 mA.
|
|
30
|
+
* V_led = n * V_t * ln(I / I_s) = 1.752 * 0.05 * ln(0.328e-3 / 1e-12) ≈ 1.718 V.
|
|
31
|
+
*/
|
|
32
|
+
export const ledClipperPeakVolts = 1.718;
|
|
33
|
+
/** Inverting amplifier: -R_feedback / R_in = -100k / 10k. Magnitude 10. */
|
|
34
|
+
export const invertingGain = 10;
|
|
35
|
+
/**
|
|
36
|
+
* A 100k rheostat at mid travel on a linear sweep is 50k, so a 100k series feed reads
|
|
37
|
+
* 50k / (100k + 50k). With a 20k residual minimum the sweep runs 20k..100k, and mid
|
|
38
|
+
* travel is 60k, giving 60k / 160k.
|
|
39
|
+
*/
|
|
40
|
+
export const rheostatMidGain = 50_000 / 150_000;
|
|
41
|
+
export const rheostatMidGainWithMinimum = 60_000 / 160_000;
|
|
42
|
+
/**
|
|
43
|
+
* `quietSeedRheostat` at 1 kHz with a 1 V input. The stage is an inverting amplifier whose
|
|
44
|
+
* feedback is a 100k DC path in parallel with the track: a 10 uF coupling capacitor
|
|
45
|
+
* (15.915 ohms at 1 kHz), the wiper-adjacent share of the 100k pot, and 30k of series feed
|
|
46
|
+
* back to the inverting input.
|
|
47
|
+
*
|
|
48
|
+
* With the track oriented to its input-adjacent end (the decision this fixture pins), the
|
|
49
|
+
* wiper-adjacent share is `100k * p` on a linear taper, so the magnitude is
|
|
50
|
+
* `(100k || (30k + 100k*p + 15.915)) / 10k`:
|
|
51
|
+
* p = 0.25 -> 3.5490, p = 0.50 -> 4.4449, p = 0.75 -> 5.1223.
|
|
52
|
+
*
|
|
53
|
+
* Before 2026-08-25, `vplus` seeded the orientation evidence, so the rail-adjacent end won
|
|
54
|
+
* and the share was `100k * (1 - p)`: the 0.25 and 0.75 values are mirrored (5.1223 and
|
|
55
|
+
* 3.5490) while the 0.50 midpoint is identical, which is why the mid-travel value here is an
|
|
56
|
+
* anchor, not a discriminator, and the pair off centre is what detects the flip.
|
|
57
|
+
*/
|
|
58
|
+
export const quietSeedGainQuarter = 3.549;
|
|
59
|
+
export const quietSeedGainMid = 4.4449;
|
|
60
|
+
export const quietSeedGainThreeQuarter = 5.1223;
|
|
61
|
+
/**
|
|
62
|
+
* A 10k pot with an audio (logarithmic) taper at half rotation: **exactly** a tenth of the
|
|
63
|
+
* track, not approximately.
|
|
64
|
+
*
|
|
65
|
+
* `runtime/taper.ts` evaluates `(81^x - 1)/(81 - 1)`, and base 81 is not a fitted constant --
|
|
66
|
+
* it is the value for which that expression is exactly 0.1 at `x = 0.5`, which is the audio-taper
|
|
67
|
+
* convention of 10% at half rotation. `81^0.5 = 9`, so the fraction is `(9 - 1)/80 = 0.1`, and
|
|
68
|
+
* the fixture measures 0.10000000 with no loading error to absorb.
|
|
69
|
+
*
|
|
70
|
+
* Stated as exact on purpose: describing it as "roughly 10%" invites a later tolerance loosening
|
|
71
|
+
* that this reference does not need, and it is one of the few numbers in this file that is a
|
|
72
|
+
* closed form rather than a hand-solved approximation.
|
|
73
|
+
*/
|
|
74
|
+
export const logTaperMidGain = 0.1;
|
|
75
|
+
/** Ideal 1:2 step-up: turns ratio Np/Ns = 0.5, so V_secondary = V_primary / 0.5. */
|
|
76
|
+
export const transformerStepUpGain = 2;
|
|
77
|
+
/** Ideal 2:1 step-down: turns ratio Np/Ns = 2.0, so V_secondary = V_primary / 2.0. */
|
|
78
|
+
export const transformerStepDownGain = 0.5;
|
|
79
|
+
/**
|
|
80
|
+
* The peak amplitude a winding stated as `volts` RMS is driven at. The source states RMS by
|
|
81
|
+
* this project's convention and `device-laws.ts` converts once, so a driven winding's stamp
|
|
82
|
+
* carries peak -- the same reading `ac-source`'s own `amplitudeVolts` has.
|
|
83
|
+
*/
|
|
84
|
+
export const drivenWindingPeak = (rmsVolts) => rmsVolts * Math.SQRT2;
|
|
85
|
+
/** `twoWindingVoltageDerivedTransformer`: a 6 V RMS filament winding. */
|
|
86
|
+
export const twoWindingVoltageDerivedRms = 6;
|
|
87
|
+
/**
|
|
88
|
+
* `centerTappedVoltageDerivedTransformer`: a `20-0-20` winding, so **20 V RMS across each
|
|
89
|
+
* half**, not 40 across the pair. The typed 20 V already is the per-half voltage, the same
|
|
90
|
+
* convention `fender-5e3-deluxe-tweed`'s `Derivation` states for its own HV winding, and
|
|
91
|
+
* doubling it would be the silent-truncation failure this work has already been bitten by.
|
|
92
|
+
*/
|
|
93
|
+
export const centerTappedVoltageDerivedRmsPerHalf = 20;
|
|
94
|
+
/**
|
|
95
|
+
* `powerTransformerVoltageDerived`: three windings off one core at three different voltages,
|
|
96
|
+
* which is exactly what no single `Ratio` can express.
|
|
97
|
+
*/
|
|
98
|
+
export const powerTransformerHvRmsPerHalf = 250;
|
|
99
|
+
export const powerTransformerRectifierHeaterRms = 5;
|
|
100
|
+
export const powerTransformerFilamentRms = 10;
|
|
101
|
+
/**
|
|
102
|
+
* `reverbTankInputOutputTransformer`: `n = sqrt(Zinput / Zoutput) = sqrt(8 / 2250)`, the same
|
|
103
|
+
* `parametersFor` arithmetic `tappedPrimaryOutputTransformer` already exercises via
|
|
104
|
+
* `PrimaryImpedance`/`SecondaryImpedance` -- `InputImpedance`/`OutputImpedance` is the reverb-tank
|
|
105
|
+
* spelling of the same two properties, and `input_hot`/`input_return`/`output_hot`/`output_return`
|
|
106
|
+
* (added to `transformerTerminalRoles` 2026-08-14) is the terminal-side half of that same synonym.
|
|
107
|
+
*/
|
|
108
|
+
export const reverbTankInputOutputRatio = Math.sqrt(8 / 2250);
|
|
109
|
+
/**
|
|
110
|
+
* JFET source follower, hand-solved. With Vto = -2 V and beta = 1e-3, the quiescent
|
|
111
|
+
* source voltage solves Vs / 2200 = beta * (2 - Vs)^2, giving Vs ~ 1.247 V and
|
|
112
|
+
* Id ~ 0.567 mA. Then gm = 2 * beta * (2 - Vs) ~ 1.506 mS and the follower's gain is
|
|
113
|
+
* gm * Rs / (1 + gm * Rs) ~ 0.77.
|
|
114
|
+
*/
|
|
115
|
+
export const jfetFollowerGain = 0.77;
|
|
116
|
+
/** RL low pass: f_c = R / (2*pi*L), with R = 10k and L = 1 H. */
|
|
117
|
+
export const rlCornerHz = 10_000 / (2 * Math.PI * 1);
|
|
118
|
+
/**
|
|
119
|
+
* MOSFET source follower, hand-solved the same way as the JFET but with an
|
|
120
|
+
* enhancement threshold of +2 V and a 4.5 V gate bias. Vs solves
|
|
121
|
+
* 2.2 * (2.5 - Vs)^2 = Vs, giving Vs ~ 1.633 V, so gm = 2 * beta * (2.5 - Vs)
|
|
122
|
+
* ~ 1.734 mS and the follower gain gm * Rs / (1 + gm * Rs) ~ 0.79.
|
|
123
|
+
*/
|
|
124
|
+
export const mosfetFollowerGain = 0.79;
|
|
125
|
+
/**
|
|
126
|
+
* The common-emitter BJT stage mid-band AC gain and operating point.
|
|
127
|
+
*
|
|
128
|
+
* 9 V rail, RB1=100k, RB2=22k divider, RC=4.7k, RE=1k into 1M load.
|
|
129
|
+
* Vth = 9 * 22 / 122 = 1.623 V, Rth = 100k || 22k = 18.03k.
|
|
130
|
+
* With Vbe ~ 0.68 V and beta ~ 100:
|
|
131
|
+
* Ib ~ (1.623 - 0.68) / (18.03k + 101 * 1k) ~ 7.92 uA
|
|
132
|
+
* Ie ~ 101 * Ib ~ 0.80 mA
|
|
133
|
+
* re = Vt / Ie ~ 25.85 mV / 0.80 mA ~ 32.3 ohm
|
|
134
|
+
* Rc || Rload = 4.7k || 1M = 4.678k
|
|
135
|
+
* Small-signal AC voltage gain: |Av| = (Rc || Rload) / (RE + re) ~ 4.678k / 1032.3 = 4.532 V/V.
|
|
136
|
+
*/
|
|
137
|
+
export const commonEmitterGain = 4.532;
|
|
138
|
+
/**
|
|
139
|
+
* The 5F1's V1A stage operating point, from `whole-amp-5f1`.
|
|
140
|
+
*
|
|
141
|
+
* A 12AX7 with a 1.5k cathode resistor and a 100k plate load on a 250 V rail. The three
|
|
142
|
+
* numbers are self-consistent and hand-checkable independently of the experiment, which is
|
|
143
|
+
* what makes them an oracle rather than a snapshot: `Ip = Vk / Rk = 1.251 / 1500 = 0.834 mA`,
|
|
144
|
+
* and `Vp = 250 - Ip * 100k = 166.6 V`. Any two of them plus Koren's law fix the third.
|
|
145
|
+
*/
|
|
146
|
+
export const triodeStageCathodeVolts = 1.251;
|
|
147
|
+
export const triodeStagePlateVolts = 166.6;
|
|
148
|
+
/**
|
|
149
|
+
* `hybridDelayPedal`'s end-to-end gain: two passive dividers the `coupled` port's boundary
|
|
150
|
+
* stamps create, with nothing from the macro's own core -- a delay cannot change a steady
|
|
151
|
+
* sine's amplitude, only its phase, so the whole gain is electrical.
|
|
152
|
+
*
|
|
153
|
+
* Input: R_IN (10k) into R_IN_SHUNT (10k) *parallel with* the macro's declared input
|
|
154
|
+
* impedance (`fixtureRegistry`'s `audioPortImpedanceOhms.input`, 47k) -- the `conductance`
|
|
155
|
+
* stamp `couple.ts` adds to the driver region, and the number that proves the coupled port is
|
|
156
|
+
* really loading it: without that stamp this divider would be the bare 10k/10k half gate 1a's
|
|
157
|
+
* own README already established, not this smaller one.
|
|
158
|
+
*
|
|
159
|
+
* Output: the macro's declared output impedance (1k) in series with R_OUT (10k), dividing
|
|
160
|
+
* against R_OUT_LOAD (1meg).
|
|
161
|
+
*/
|
|
162
|
+
const hybridDelayInputLoadOhms = 1 / (1 / 10_000 + 1 / 47_000);
|
|
163
|
+
export const hybridDelayInputGain = hybridDelayInputLoadOhms / (10_000 + hybridDelayInputLoadOhms);
|
|
164
|
+
export const hybridDelayOutputGain = 1_000_000 / (1_000_000 + 1_000 + 10_000);
|
|
165
|
+
export const hybridDelayPedalGain = hybridDelayInputGain * hybridDelayOutputGain;
|
|
166
|
+
export const hybridDelayLoadedOutputGain = hybridDelayInputGain * (10_000 / (10_000 + 1_000 + 10_000));
|
|
167
|
+
/**
|
|
168
|
+
* Expected values for physical BBD stamps (MN3007/MN3207 family).
|
|
169
|
+
*
|
|
170
|
+
* Modeled output impedance is 400 Ohms.
|
|
171
|
+
* - Driving 10k load: divider is 10k / (10k + 400) = 10000 / 10400 ~ 0.961538.
|
|
172
|
+
* - Driving 400 Ohm matched load: divider is 400 / (400 + 400) = 0.500000.
|
|
173
|
+
*
|
|
174
|
+
* Forward VGG clipping with 0.6V threshold:
|
|
175
|
+
* - N-channel at +5V drive: (5.0 - 0.6) * (10000 / 10400) ~ 4.230769 V.
|
|
176
|
+
* - N-channel at +5V drive with matched 400 Ohm load: (5.0 - 0.6) * 0.5 = 2.20 V.
|
|
177
|
+
* - P-channel at -5V drive: (-5.0 + 0.6) * (10000 / 10400) ~ -4.230769 V.
|
|
178
|
+
*/
|
|
179
|
+
export const bbdStampOutputGain10k = 10_000 / (10_000 + 400);
|
|
180
|
+
export const bbdStampOutputGainMatched = 400 / (400 + 400);
|
|
181
|
+
export const bbdStampNChannelPeakVolts = (5.0 - 0.6) * bbdStampOutputGain10k;
|
|
182
|
+
export const bbdStampNChannelMatchedLoadPeakVolts = (5.0 - 0.6) * bbdStampOutputGainMatched;
|
|
183
|
+
export const bbdStampPChannelPeakVolts = (-5.0 + 0.6) * bbdStampOutputGain10k;
|
|
184
|
+
/**
|
|
185
|
+
* The unloaded input divider `hybridDelayInputGain` is NOT: R_IN (10k) into R_IN_SHUNT (10k)
|
|
186
|
+
* alone, ignoring the macro's input impedance entirely. The gap between this and the measured
|
|
187
|
+
* gain is what a missing `coupled` port would look like -- silent under-loading, the same
|
|
188
|
+
* class of error as a single-sample port the architecture already forbids.
|
|
189
|
+
*/
|
|
190
|
+
export const hybridDelayUnloadedInputGain = 10_000 / (10_000 + 10_000);
|
|
191
|
+
/**
|
|
192
|
+
* `ne570Expander`'s gain, from the datasheet's own closed form rather than from our
|
|
193
|
+
* output: onsemi NE570/D Rev. 4, Figure 6.
|
|
194
|
+
*
|
|
195
|
+
* GAIN = 2 * R3 * VIN(avg) / (R1 * R2 * IB)
|
|
196
|
+
*
|
|
197
|
+
* with the five internal values Figure 5 draws (R1 10k, R2 20k, R3 20k, IB 140 uA). The
|
|
198
|
+
* three-way cross-check that this reading of the datasheet is right: the same numbers put
|
|
199
|
+
* unity gain at VIN(avg) = 0.7 V, which is 0 dBm -- the reference level a telephone-system
|
|
200
|
+
* compandor is specified at, and the level Figure 6's own text describes as nominal.
|
|
201
|
+
*
|
|
202
|
+
* `VIN(avg)` is the **full-wave average** of the input, so for a sine of amplitude A it is
|
|
203
|
+
* `2A/pi`, not A and not A/sqrt(2). Getting this wrong is a 1.11x error that would sit
|
|
204
|
+
* just inside a loose tolerance, which is why it is spelled out.
|
|
205
|
+
*/
|
|
206
|
+
const ne570R1 = 10_000;
|
|
207
|
+
const ne570R2 = 20_000;
|
|
208
|
+
const ne570R3 = 20_000;
|
|
209
|
+
const ne570IBias = 140e-6;
|
|
210
|
+
export const ne570ExpanderGainAt = (amplitudeVolts) => (2 * ne570R3 * ((2 * amplitudeVolts) / Math.PI)) /
|
|
211
|
+
(ne570R1 * ne570R2 * ne570IBias);
|
|
212
|
+
/**
|
|
213
|
+
* `ne570Expander`'s quiescent output, which the datasheet states outright: "The output of
|
|
214
|
+
* the expander will bias up to VOUT_DC = (1 + R3/R4) * VREF ... The output will bias to
|
|
215
|
+
* 3.0 V when the internal resistors are used."
|
|
216
|
+
*
|
|
217
|
+
* This is the number that fixes the *topology* rather than the gain. It is the
|
|
218
|
+
* non-inverting-amplifier form, so it only comes out at 3.0 V with R4 returned to
|
|
219
|
+
* **ground**; returned to VREF instead, R4 would carry no current and the output would
|
|
220
|
+
* sit at VREF's own 1.8 V. A 1.2 V discrepancy is what a mis-referenced R4 looks like.
|
|
221
|
+
*/
|
|
222
|
+
export const ne570ExpanderBiasVolts = 3.0;
|
|
223
|
+
/** `ne570Compressor`'s external network, and the two internal values its DC bias needs. */
|
|
224
|
+
const ne570CompressorRin = 20_000;
|
|
225
|
+
const ne570CompressorRfb = 36_000;
|
|
226
|
+
const ne570Vref = 1.8;
|
|
227
|
+
const ne570R4 = 30_000;
|
|
228
|
+
/**
|
|
229
|
+
* `ne570Compressor`'s output level for a sine of `amplitudeVolts`, and the only assertion in
|
|
230
|
+
* this file that pins the gain cell's **direction** rather than its magnitude.
|
|
231
|
+
*
|
|
232
|
+
* The expander cannot pin it. Its cell is outside the op amp's loop, so reversing the cell's
|
|
233
|
+
* current inverts that fixture's output and changes nothing measurable: `ne570ExpanderGainAt`
|
|
234
|
+
* is a magnitude, `ne570ExpanderBiasVolts` comes from R3/R4 with the cell carrying no DC, and
|
|
235
|
+
* the harness reads half peak-to-peak. Figure 7 puts the cell inside the loop, driven from the
|
|
236
|
+
* output, and the direction becomes the whole behaviour.
|
|
237
|
+
*
|
|
238
|
+
* KCL at the summing node, which the op amp holds at VREF:
|
|
239
|
+
*
|
|
240
|
+
* A_out * (1/Rfb + k * A_out) = A_in / (Rin + R3), k = 4 / (pi * R1 * R2 * IB)
|
|
241
|
+
*
|
|
242
|
+
* `k` is the cell's conductance per volt of output, and it is the expander's own closed form
|
|
243
|
+
* rearranged -- `ne570ExpanderGainAt(A) = R3 * k * A` -- so both fixtures are checked against
|
|
244
|
+
* one reading of the datasheet, not two. The `4/pi` is `2 * (2/pi)`: the factor of two Figure 9
|
|
245
|
+
* states for the mirrored rectifier current, times the full-wave average of a sine.
|
|
246
|
+
*
|
|
247
|
+
* Solving the quadratic gives the level below. Two properties make it the right assertion:
|
|
248
|
+
* it is external to our output, and it separates the signs by a factor of fourteen at unit
|
|
249
|
+
* drive (0.4965 against a measured 6.8 with the current delivered the wrong way). A
|
|
250
|
+
* monotonic-compression check would not separate them at all -- **both** signs produce gain
|
|
251
|
+
* that falls with level, one of them by walking away from a pole at `gCell = 1/Rfb`.
|
|
252
|
+
*/
|
|
253
|
+
export const ne570CompressorOutputAt = (amplitudeVolts) => {
|
|
254
|
+
const k = 4 / (Math.PI * ne570R1 * ne570R2 * ne570IBias);
|
|
255
|
+
const g = 1 / ne570CompressorRfb;
|
|
256
|
+
return ((-g +
|
|
257
|
+
Math.sqrt(g * g +
|
|
258
|
+
(4 * k * amplitudeVolts) / (ne570CompressorRin + ne570R3))) /
|
|
259
|
+
(2 * k));
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* `ne570Compressor`'s quiescent output: `VREF + Rfb * (VREF / R4)` = 3.96 V.
|
|
263
|
+
*
|
|
264
|
+
* Figure 7 takes pin 6 away for the signal input, so the internal R3 no longer closes the DC
|
|
265
|
+
* loop and the external leg does. That makes the bias a different arithmetic from the
|
|
266
|
+
* expander's stated `(1 + R3/R4) * VREF`, and checking it is what proves the fixture wired
|
|
267
|
+
* Figure 7 rather than a mis-drawn Figure 6: R4's 60 uA has to return through Rfb, and only
|
|
268
|
+
* through Rfb.
|
|
269
|
+
*/
|
|
270
|
+
export const ne570CompressorBiasVolts = ne570Vref + (ne570CompressorRfb * ne570Vref) / ne570R4;
|
|
271
|
+
/**
|
|
272
|
+
* Optocoupler attenuator small-signal AC gain.
|
|
273
|
+
*
|
|
274
|
+
* Series resistor R1=10k, shunt LDR to ground.
|
|
275
|
+
* - Dark (LED = 0V): Rldr = 10M, gain = 10M / (10k + 10M) ~ 0.9990.
|
|
276
|
+
* - Illuminated (LED = 2V): Rldr = 100, gain = 100 / (10k + 100) ~ 0.00990.
|
|
277
|
+
*/
|
|
278
|
+
export const optocouplerDarkGain = 0.999;
|
|
279
|
+
export const optocouplerIlluminatedGain = 0.0099;
|
|
280
|
+
/**
|
|
281
|
+
* `pentodeGainStage`'s operating point under the generic pentode law (`GENERIC_PENTODE`:
|
|
282
|
+
* mu 8, kg1 1534, kp 72, kvb 38, ex 1.34, no screen current), hand-solved independently of
|
|
283
|
+
* the runtime's Newton loop by bisection on the cathode voltage.
|
|
284
|
+
*
|
|
285
|
+
* Grid at 0 V DC (1M leak), Rk = 470, Rp = 2.2k to a 250 V rail, screen at the rail.
|
|
286
|
+
* E1 = (Vsk/kp) ln(1 + exp(kp (1/mu + Vgk / sqrt(kvb + Vsk^2)))), Vgk = -Vk, Vsk = 250 - Vk
|
|
287
|
+
* Ip = (2/kg1) E1^ex atan(Vpk/kvb), Vpk = Vp - Vk, Vp = 250 - Ip Rp
|
|
288
|
+
* closes at Vk = 18.626 V, Ip = 39.63 mA, Vp = 162.8 V. The three are self-consistent the way
|
|
289
|
+
* the triode's are: `Vk / Rk = 39.63 mA = (250 - Vp) / Rp`, so any two fix the third.
|
|
290
|
+
*/
|
|
291
|
+
export const pentodeStageCathodeVolts = 18.63;
|
|
292
|
+
export const pentodeStagePlateVolts = 162.8;
|
|
293
|
+
/** RL high pass: series 10k into a 1 H shunt. Same corner as `rlCornerHz`; passes nothing at DC. */
|
|
294
|
+
export const rlHighPassGainAtDecadeBelow = 1 / Math.sqrt(1 + 100);
|
|
295
|
+
export const rlHighPassGainAtDecadeAbove = 1 / Math.sqrt(1 + 0.01);
|
|
296
|
+
/** `selectorThreeWay`: each throw is a series resistor into a 1k load. */
|
|
297
|
+
export const selectorThreeWayGains = {
|
|
298
|
+
low: 1_000 / (1_000 + 1_000),
|
|
299
|
+
mid: 1_000 / (3_000 + 1_000),
|
|
300
|
+
high: 1_000 / (9_000 + 1_000),
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* `linearVcaCell` hand-computed voltage gains (Vout/Vin): the input divider
|
|
304
|
+
* (100 ohm virtual ground against Rin 10k) times the input conductance times
|
|
305
|
+
* the Ro load times the control gain Vc / 1 V, halved once for the cell's
|
|
306
|
+
* 1/2 current ratio (datasheet 0 dB condition: unity iff Vc = Vref and
|
|
307
|
+
* Ro = 2*Ri).
|
|
308
|
+
*/
|
|
309
|
+
export const linearVcaGainFull = ((100 / 10100) * 0.01 * 22000 * 1) / 2;
|
|
310
|
+
export const linearVcaGainHalf = ((100 / 10100) * 0.01 * 22000 * 0.5) / 2;
|
|
311
|
+
//# sourceMappingURL=expected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expected.js","sourceRoot":"","sources":["../../src/fixtures/expected.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,sBAAsB;AAEtB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,gDAAgD;AAChD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;AAE7D,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;AAE7C,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,QAAgB;IACzC,OAAO,QAAQ,CAAC;AACjB,CAAC;A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C,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Synthetic circuits with hand-computed expectations: the compiler's and runtime's test
|
|
2
|
+
// inputs, and the known-answer controls the parity instruments render. Shipped as a
|
|
3
|
+
// subpath because an instrument's control must be a circuit whose answer is known
|
|
4
|
+
// independently of the instrument, and these are the only such circuits.
|
|
5
|
+
export * from "./circuits.js";
|
|
6
|
+
export * from "./expected.js";
|
|
7
|
+
export * from "./registry.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,oFAAoF;AACpF,kFAAkF;AAClF,yEAAyE;AACzE,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PartRegistry } from "../registry";
|
|
2
|
+
/** Knows one macro model, by exact part id, declared type, and pinout. */
|
|
3
|
+
export declare const fixtureRegistry: PartRegistry;
|
|
4
|
+
/**
|
|
5
|
+
* The same part, declaring a DSP algorithm no runtime implements.
|
|
6
|
+
*
|
|
7
|
+
* The negative control for the model lockout, and it is the whole point of that lockout: a
|
|
8
|
+
* compander is a real thing a real chip in a real pedal does, it is not a delay line, and
|
|
9
|
+
* before `modelId` was dispatched on at all it would have *executed* as one -- plausible,
|
|
10
|
+
* silent and completely wrong. Only the `modelId` differs from `fixtureRegistry`, so a program
|
|
11
|
+
* built from this is identical in every other respect -- same pinout, same ports, same
|
|
12
|
+
* schedule, same stamps -- and whatever refuses it can only be refusing the model.
|
|
13
|
+
*/
|
|
14
|
+
export declare const unimplementedMacroRegistry: PartRegistry;
|
|
15
|
+
/**
|
|
16
|
+
* The fixture part as the `digital-delay-line` model, with feedback regeneration.
|
|
17
|
+
*
|
|
18
|
+
* The positive control for the runtime's dispatch: same identity, same ports, same schedule as
|
|
19
|
+
* `fixtureRegistry` above, differing only in the algorithm name and the one parameter that model
|
|
20
|
+
* carries (`feedback`). A `digital-delay-line` that rendered as a plain delay would be the
|
|
21
|
+
* same plausible-wrong-pedal defect the `compander` lockout above pins, so this is the case that
|
|
22
|
+
* must regenerate.
|
|
23
|
+
*/
|
|
24
|
+
export declare const digitalDelayLineRegistry: PartRegistry;
|
|
25
|
+
/** The `digital-delay-line` model with no regeneration: the plain-delay negative control. */
|
|
26
|
+
export declare const digitalDelayLineDryRegistry: PartRegistry;
|
|
27
|
+
/**
|
|
28
|
+
* Mock ICs for the parity gate (`scripts/report-fixture-spice-parity.ts`).
|
|
29
|
+
*
|
|
30
|
+
* Every chip in the corpus carrying a law that gate cannot reach is a `macro`: a BBD, a delay
|
|
31
|
+
* memory, a compandor. A macro is lifted out of the solver and executed as DSP, so ngspice has
|
|
32
|
+
* no circuit to compare against one and no fixture can change that. `sections` is the other
|
|
33
|
+
* thing a registry can say -- the chip expands into ordinary device laws that stay in the
|
|
34
|
+
* matrix -- and that is the path most of the corpus's registry-expanded devices actually take.
|
|
35
|
+
* These entries exist so that path has fixtures.
|
|
36
|
+
*
|
|
37
|
+
* Fictional part numbers, like every entry in this file. The *laws* are real: a mock law would
|
|
38
|
+
* mean the gate graded behaviour no pedal runs.
|
|
39
|
+
*/
|
|
40
|
+
export declare const sectionsRegistry: PartRegistry;
|
|
41
|
+
/** Knows one part as a lumped law rather than a macro model. */
|
|
42
|
+
export declare const resistiveChipRegistry: PartRegistry;
|
|
43
|
+
/**
|
|
44
|
+
* Knows one multi-section part: a fictional dual op-amp on eight pins.
|
|
45
|
+
*
|
|
46
|
+
* The shape real dual op-amps take, without a real part number. Sections index the device's own
|
|
47
|
+
* terminals, so pins 4 and 7 -- the supply pins -- appear in no section and contribute nothing,
|
|
48
|
+
* which is correct: an `ideal-opamp` resolves its rails from the circuit's supply set rather than
|
|
49
|
+
* from its own pins.
|
|
50
|
+
*/
|
|
51
|
+
export declare const dualOpampRegistry: PartRegistry;
|
|
52
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/fixtures/registry.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,aAAa,CAAC;AA8B3E,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,YAO7B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,EAAE,YAUxC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAE,YActC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B,EAAE,YAczC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,YA4J9B,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,EAAE,YASnC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAyC/B,CAAC"}
|