@vessel-dsp/core 0.6.4 → 0.6.6

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.
Files changed (182) hide show
  1. package/README.md +10 -2
  2. package/dist/editor/commands.d.ts +13 -13
  3. package/dist/editor/commands.d.ts.map +1 -1
  4. package/dist/editor/commands.js +44 -29
  5. package/dist/editor/commands.js.map +1 -1
  6. package/dist/editor/factory.d.ts +1 -1
  7. package/dist/editor/factory.d.ts.map +1 -1
  8. package/dist/editor/factory.js +51 -51
  9. package/dist/editor/factory.js.map +1 -1
  10. package/dist/editor/history.d.ts +7 -7
  11. package/dist/editor/history.d.ts.map +1 -1
  12. package/dist/editor/history.js +20 -12
  13. package/dist/editor/history.js.map +1 -1
  14. package/dist/editor/index.d.ts +8 -8
  15. package/dist/editor/index.d.ts.map +1 -1
  16. package/dist/editor/index.js +4 -4
  17. package/dist/editor/index.js.map +1 -1
  18. package/dist/editor/layout.d.ts +1 -1
  19. package/dist/editor/layout.d.ts.map +1 -1
  20. package/dist/editor/layout.js +11 -6
  21. package/dist/editor/layout.js.map +1 -1
  22. package/dist/formats/circuit-json/serializer.d.ts +15 -15
  23. package/dist/formats/circuit-json/serializer.d.ts.map +1 -1
  24. package/dist/formats/circuit-json/serializer.js +486 -394
  25. package/dist/formats/circuit-json/serializer.js.map +1 -1
  26. package/dist/formats/document.d.ts +6 -6
  27. package/dist/formats/document.d.ts.map +1 -1
  28. package/dist/formats/document.js +112 -92
  29. package/dist/formats/document.js.map +1 -1
  30. package/dist/formats/interchange/parser.d.ts +1 -1
  31. package/dist/formats/interchange/parser.d.ts.map +1 -1
  32. package/dist/formats/interchange/parser.js +463 -286
  33. package/dist/formats/interchange/parser.js.map +1 -1
  34. package/dist/formats/interchange/serializer.d.ts +1 -1
  35. package/dist/formats/interchange/serializer.d.ts.map +1 -1
  36. package/dist/formats/interchange/serializer.js +41 -28
  37. package/dist/formats/interchange/serializer.js.map +1 -1
  38. package/dist/formats/ltspice/catalog.d.ts +1 -1
  39. package/dist/formats/ltspice/catalog.d.ts.map +1 -1
  40. package/dist/formats/ltspice/catalog.js +150 -48
  41. package/dist/formats/ltspice/catalog.js.map +1 -1
  42. package/dist/formats/ltspice/encoding.js +12 -40
  43. package/dist/formats/ltspice/encoding.js.map +1 -1
  44. package/dist/formats/ltspice/parser.d.ts +1 -1
  45. package/dist/formats/ltspice/parser.d.ts.map +1 -1
  46. package/dist/formats/ltspice/parser.js +122 -75
  47. package/dist/formats/ltspice/parser.js.map +1 -1
  48. package/dist/formats/ltspice/serializer.d.ts +1 -1
  49. package/dist/formats/ltspice/serializer.d.ts.map +1 -1
  50. package/dist/formats/ltspice/serializer.js +69 -47
  51. package/dist/formats/ltspice/serializer.js.map +1 -1
  52. package/dist/formats/schx/catalog.d.ts +1 -1
  53. package/dist/formats/schx/catalog.d.ts.map +1 -1
  54. package/dist/formats/schx/catalog.js +499 -254
  55. package/dist/formats/schx/catalog.js.map +1 -1
  56. package/dist/formats/schx/parser.d.ts +1 -1
  57. package/dist/formats/schx/parser.d.ts.map +1 -1
  58. package/dist/formats/schx/parser.js +40 -38
  59. package/dist/formats/schx/parser.js.map +1 -1
  60. package/dist/formats/schx/runtime-descriptors.d.ts +1 -1
  61. package/dist/formats/schx/runtime-descriptors.d.ts.map +1 -1
  62. package/dist/formats/schx/runtime-descriptors.js +239 -201
  63. package/dist/formats/schx/runtime-descriptors.js.map +1 -1
  64. package/dist/formats/schx/serializer.d.ts +2 -2
  65. package/dist/formats/schx/serializer.d.ts.map +1 -1
  66. package/dist/formats/schx/serializer.js +106 -106
  67. package/dist/formats/schx/serializer.js.map +1 -1
  68. package/dist/formats/schx/transforms.d.ts +1 -1
  69. package/dist/formats/schx/transforms.d.ts.map +1 -1
  70. package/dist/formats/schx/transforms.js +16 -8
  71. package/dist/formats/schx/transforms.js.map +1 -1
  72. package/dist/formats/spice/parser.d.ts +1 -1
  73. package/dist/formats/spice/parser.d.ts.map +1 -1
  74. package/dist/formats/spice/parser.js +105 -56
  75. package/dist/formats/spice/parser.js.map +1 -1
  76. package/dist/formats/spice/serializer.d.ts +1 -1
  77. package/dist/formats/spice/serializer.js +14 -12
  78. package/dist/formats/spice/serializer.js.map +1 -1
  79. package/dist/index.d.ts +47 -46
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +32 -31
  82. package/dist/index.js.map +1 -1
  83. package/dist/model/connectivity.d.ts +1 -1
  84. package/dist/model/connectivity.d.ts.map +1 -1
  85. package/dist/model/connectivity.js +22 -7
  86. package/dist/model/connectivity.js.map +1 -1
  87. package/dist/model/netlist.d.ts +3 -3
  88. package/dist/model/netlist.d.ts.map +1 -1
  89. package/dist/model/netlist.js +117 -100
  90. package/dist/model/netlist.js.map +1 -1
  91. package/dist/model/properties.d.ts +1 -1
  92. package/dist/model/properties.d.ts.map +1 -1
  93. package/dist/model/properties.js +16 -16
  94. package/dist/model/properties.js.map +1 -1
  95. package/dist/model/quantity.d.ts +1 -1
  96. package/dist/model/quantity.d.ts.map +1 -1
  97. package/dist/model/quantity.js +35 -35
  98. package/dist/model/quantity.js.map +1 -1
  99. package/dist/model/types.d.ts +61 -33
  100. package/dist/model/types.d.ts.map +1 -1
  101. package/dist/model/types.js +1 -1
  102. package/dist/model/types.js.map +1 -1
  103. package/dist/model/validation.d.ts +5 -5
  104. package/dist/model/validation.d.ts.map +1 -1
  105. package/dist/model/validation.js +668 -331
  106. package/dist/model/validation.js.map +1 -1
  107. package/dist/model/wires.d.ts +1 -1
  108. package/dist/model/wires.d.ts.map +1 -1
  109. package/dist/model/wires.js +4 -1
  110. package/dist/model/wires.js.map +1 -1
  111. package/dist/panel/extract.d.ts +2 -2
  112. package/dist/panel/extract.d.ts.map +1 -1
  113. package/dist/panel/extract.js +327 -225
  114. package/dist/panel/extract.js.map +1 -1
  115. package/dist/panel/index.d.ts +7 -7
  116. package/dist/panel/index.d.ts.map +1 -1
  117. package/dist/panel/index.js +5 -5
  118. package/dist/panel/index.js.map +1 -1
  119. package/dist/panel/knobs.d.ts +4 -4
  120. package/dist/panel/knobs.d.ts.map +1 -1
  121. package/dist/panel/knobs.js +1 -1
  122. package/dist/panel/knobs.js.map +1 -1
  123. package/dist/panel/placement.d.ts +1 -1
  124. package/dist/panel/placement.d.ts.map +1 -1
  125. package/dist/panel/placement.js +11 -9
  126. package/dist/panel/placement.js.map +1 -1
  127. package/dist/panel/protocol.d.ts +1 -1
  128. package/dist/panel/protocol.d.ts.map +1 -1
  129. package/dist/panel/protocol.js +32 -23
  130. package/dist/panel/protocol.js.map +1 -1
  131. package/dist/panel/types.d.ts +18 -18
  132. package/dist/panel/types.d.ts.map +1 -1
  133. package/dist/panel/types.js.map +1 -1
  134. package/dist/preview/bounds.d.ts +1 -1
  135. package/dist/preview/bounds.d.ts.map +1 -1
  136. package/dist/preview/bounds.js +3 -3
  137. package/dist/preview/bounds.js.map +1 -1
  138. package/dist/preview/box-layout.d.ts +2 -2
  139. package/dist/preview/box-layout.js.map +1 -1
  140. package/dist/preview/colors.d.ts +1 -1
  141. package/dist/preview/colors.js +35 -35
  142. package/dist/preview/colors.js.map +1 -1
  143. package/dist/preview/hanging.d.ts +1 -1
  144. package/dist/preview/hanging.d.ts.map +1 -1
  145. package/dist/preview/hanging.js +4 -1
  146. package/dist/preview/hanging.js.map +1 -1
  147. package/dist/preview/junctions.d.ts +1 -1
  148. package/dist/preview/junctions.d.ts.map +1 -1
  149. package/dist/preview/junctions.js.map +1 -1
  150. package/dist/preview/label-layout.d.ts.map +1 -1
  151. package/dist/preview/label-layout.js +4 -4
  152. package/dist/preview/label-layout.js.map +1 -1
  153. package/dist/preview/ports.d.ts +1 -1
  154. package/dist/preview/ports.d.ts.map +1 -1
  155. package/dist/preview/ports.js +2 -1
  156. package/dist/preview/ports.js.map +1 -1
  157. package/dist/preview/renderable-wires.d.ts +1 -1
  158. package/dist/preview/renderable-wires.d.ts.map +1 -1
  159. package/dist/preview/renderable-wires.js +3 -1
  160. package/dist/preview/renderable-wires.js.map +1 -1
  161. package/dist/preview/routing.d.ts +1 -1
  162. package/dist/preview/routing.js +1 -1
  163. package/dist/preview/routing.js.map +1 -1
  164. package/dist/preview/snap.d.ts +1 -1
  165. package/dist/preview/snap.d.ts.map +1 -1
  166. package/dist/preview/snap.js +11 -3
  167. package/dist/preview/snap.js.map +1 -1
  168. package/dist/preview/symbols/svg-content.d.ts.map +1 -1
  169. package/dist/preview/symbols/svg-content.js +200 -50
  170. package/dist/preview/symbols/svg-content.js.map +1 -1
  171. package/dist/preview/symbols.d.ts +2 -2
  172. package/dist/preview/symbols.d.ts.map +1 -1
  173. package/dist/preview/symbols.js +100 -97
  174. package/dist/preview/symbols.js.map +1 -1
  175. package/dist/preview/wire-chains.d.ts +1 -1
  176. package/dist/preview/wire-chains.d.ts.map +1 -1
  177. package/dist/preview/wire-chains.js.map +1 -1
  178. package/dist/profiles.d.ts +600 -0
  179. package/dist/profiles.d.ts.map +1 -0
  180. package/dist/profiles.js +118 -0
  181. package/dist/profiles.js.map +1 -0
  182. package/package.json +54 -54
@@ -1,330 +1,575 @@
1
1
  const TWO_TERMINAL_AB = [
2
- { name: 'a', local: { x: 0, y: 20 } },
3
- { name: 'b', local: { x: 0, y: -20 } },
2
+ { name: "a", local: { x: 0, y: 20 } },
3
+ { name: "b", local: { x: 0, y: -20 } },
4
4
  ];
5
5
  const TWO_TERMINAL_DIODE = [
6
- { name: 'anode', local: { x: 0, y: 20 } },
7
- { name: 'cathode', local: { x: 0, y: -20 } },
6
+ { name: "anode", local: { x: 0, y: 20 } },
7
+ { name: "cathode", local: { x: 0, y: -20 } },
8
8
  ];
9
9
  const TWO_TERMINAL_SOURCE = [
10
- { name: '+', local: { x: 0, y: 20 } },
11
- { name: '-', local: { x: 0, y: -20 } },
10
+ { name: "+", local: { x: 0, y: 20 } },
11
+ { name: "-", local: { x: 0, y: -20 } },
12
12
  ];
13
13
  const SINGLE_TERMINAL = [
14
- { name: 't', local: { x: 0, y: 0 } },
14
+ { name: "t", local: { x: 0, y: 0 } },
15
15
  ];
16
16
  const BJT_TERMINALS = [
17
- { name: 'collector', local: { x: 0, y: 20 } },
18
- { name: 'base', local: { x: -20, y: 0 } },
19
- { name: 'emitter', local: { x: 10, y: -20 } },
17
+ { name: "collector", local: { x: 0, y: 20 } },
18
+ { name: "base", local: { x: -20, y: 0 } },
19
+ { name: "emitter", local: { x: 10, y: -20 } },
20
20
  ];
21
21
  const SPDT_TERMINALS = [
22
- { name: 'common', local: { x: -20, y: 0 } },
23
- { name: 'throw0', local: { x: 0, y: 20 } },
24
- { name: 'throw1', local: { x: 10, y: -20 } },
22
+ { name: "common", local: { x: -20, y: 0 } },
23
+ { name: "throw0", local: { x: 0, y: 20 } },
24
+ { name: "throw1", local: { x: 10, y: -20 } },
25
25
  ];
26
26
  const SP3T_TERMINALS = [
27
- { name: 'common', local: { x: -20, y: 0 } },
28
- { name: 'throw0', local: { x: 0, y: 20 } },
29
- { name: 'throw1', local: { x: 10, y: 0 } },
30
- { name: 'throw2', local: { x: 0, y: -20 } },
27
+ { name: "common", local: { x: -20, y: 0 } },
28
+ { name: "throw0", local: { x: 0, y: 20 } },
29
+ { name: "throw1", local: { x: 10, y: 0 } },
30
+ { name: "throw2", local: { x: 0, y: -20 } },
31
31
  ];
32
32
  const SP4T_TERMINALS = [
33
- { name: 'common', local: { x: -20, y: 0 } },
34
- { name: 'throw0', local: { x: 0, y: 20 } },
35
- { name: 'throw1', local: { x: 10, y: 7 } },
36
- { name: 'throw2', local: { x: 10, y: -7 } },
37
- { name: 'throw3', local: { x: 0, y: -20 } },
33
+ { name: "common", local: { x: -20, y: 0 } },
34
+ { name: "throw0", local: { x: 0, y: 20 } },
35
+ { name: "throw1", local: { x: 10, y: 7 } },
36
+ { name: "throw2", local: { x: 10, y: -7 } },
37
+ { name: "throw3", local: { x: 0, y: -20 } },
38
38
  ];
39
39
  const JFET_TERMINALS = [
40
- { name: 'drain', local: { x: 0, y: 20 } },
41
- { name: 'gate', local: { x: -20, y: 0 } },
42
- { name: 'source', local: { x: 0, y: -20 } },
40
+ { name: "drain", local: { x: 0, y: 20 } },
41
+ { name: "gate", local: { x: -20, y: 0 } },
42
+ { name: "source", local: { x: 0, y: -20 } },
43
43
  ];
44
44
  const LIVE_SPICE_JUNCTION_FET_TERMINALS = [
45
- { name: 'drain', local: { x: 10, y: 20 } },
46
- { name: 'gate', local: { x: -20, y: 0 } },
47
- { name: 'source', local: { x: 10, y: -20 } },
45
+ { name: "drain", local: { x: 10, y: 20 } },
46
+ { name: "gate", local: { x: -20, y: 0 } },
47
+ { name: "source", local: { x: 10, y: -20 } },
48
48
  ];
49
49
  const MOSFET_TERMINALS = [
50
- { name: 'drain', local: { x: 0, y: 20 } },
51
- { name: 'gate', local: { x: -20, y: 0 } },
52
- { name: 'source', local: { x: 0, y: -20 } },
53
- { name: 'body', local: { x: 10, y: 0 } },
50
+ { name: "drain", local: { x: 0, y: 20 } },
51
+ { name: "gate", local: { x: -20, y: 0 } },
52
+ { name: "source", local: { x: 0, y: -20 } },
53
+ { name: "body", local: { x: 10, y: 0 } },
54
54
  ];
55
55
  const OPAMP_TERMINALS = [
56
- { name: 'vin+', local: { x: -30, y: 10 } },
57
- { name: 'vin-', local: { x: -30, y: -10 } },
58
- { name: 'vout', local: { x: 30, y: 0 } },
59
- { name: 'vcc', local: { x: 0, y: 20 } },
60
- { name: 'vee', local: { x: 0, y: -20 } },
56
+ { name: "vin+", local: { x: -30, y: 10 } },
57
+ { name: "vin-", local: { x: -30, y: -10 } },
58
+ { name: "vout", local: { x: 30, y: 0 } },
59
+ { name: "vcc", local: { x: 0, y: 20 } },
60
+ { name: "vee", local: { x: 0, y: -20 } },
61
61
  ];
62
62
  const TRIODE_TERMINALS = [
63
- { name: 'plate', local: { x: 0, y: 20 } },
64
- { name: 'grid', local: { x: -20, y: 0 } },
65
- { name: 'cathode', local: { x: -10, y: -20 } },
63
+ { name: "plate", local: { x: 0, y: 20 } },
64
+ { name: "grid", local: { x: -20, y: 0 } },
65
+ { name: "cathode", local: { x: -10, y: -20 } },
66
66
  ];
67
67
  const PENTODE_TERMINALS = [
68
- { name: 'plate', local: { x: 0, y: 20 } },
69
- { name: 'screen', local: { x: 10, y: 10 } },
70
- { name: 'grid', local: { x: -20, y: 0 } },
71
- { name: 'cathode', local: { x: -10, y: -20 } },
72
- { name: 'suppressor', local: { x: 10, y: -10 } },
68
+ { name: "plate", local: { x: 0, y: 20 } },
69
+ { name: "screen", local: { x: 10, y: 10 } },
70
+ { name: "grid", local: { x: -20, y: 0 } },
71
+ { name: "cathode", local: { x: -10, y: -20 } },
72
+ { name: "suppressor", local: { x: 10, y: -10 } },
73
73
  ];
74
74
  const POT_TERMINALS = [
75
- { name: 'a', local: { x: -10, y: 40 } },
76
- { name: 'wiper', local: { x: 10, y: 0 } },
77
- { name: 'b', local: { x: -10, y: -40 } },
75
+ { name: "a", local: { x: -10, y: 40 } },
76
+ { name: "wiper", local: { x: 10, y: 0 } },
77
+ { name: "b", local: { x: -10, y: -40 } },
78
78
  ];
79
79
  const TRANSFORMER_TERMINALS = [
80
- { name: 'p+', local: { x: -10, y: 20 } },
81
- { name: 'p-', local: { x: -10, y: -20 } },
82
- { name: 's+', local: { x: 10, y: 20 } },
83
- { name: 's-', local: { x: 10, y: -20 } },
80
+ { name: "p+", local: { x: -10, y: 20 } },
81
+ { name: "p-", local: { x: -10, y: -20 } },
82
+ { name: "s+", local: { x: 10, y: 20 } },
83
+ { name: "s-", local: { x: 10, y: -20 } },
84
84
  ];
85
85
  const CENTER_TAP_TRANSFORMER_TERMINALS = [
86
86
  ...TRANSFORMER_TERMINALS,
87
- { name: 'sct', local: { x: 10, y: 0 } },
87
+ { name: "sct", local: { x: 10, y: 0 } },
88
88
  ];
89
89
  const VOLTAGE_DEFINITION_TERMINALS = [
90
- { name: '+', local: { x: 0, y: -50 } },
91
- { name: '-', local: { x: 0, y: 50 } },
90
+ { name: "+", local: { x: 0, y: -50 } },
91
+ { name: "-", local: { x: 0, y: 50 } },
92
92
  ];
93
93
  // 3PDT footswitch — 3 columns (one per pole) × 3 rows (top throw / pole / bottom throw).
94
94
  // Pole names are p1..p3; per-pole throws are tNa (top, world-down → SVG y=+20) and tNb (bottom).
95
95
  // The "ganged" mechanical link is implicit — wires define which throws are connected to what.
96
96
  const THREE_PDT_TERMINALS = [
97
- { name: 't1a', local: { x: -20, y: 20 } },
98
- { name: 'p1', local: { x: -20, y: 0 } },
99
- { name: 't1b', local: { x: -20, y: -20 } },
100
- { name: 't2a', local: { x: 0, y: 20 } },
101
- { name: 'p2', local: { x: 0, y: 0 } },
102
- { name: 't2b', local: { x: 0, y: -20 } },
103
- { name: 't3a', local: { x: 20, y: 20 } },
104
- { name: 'p3', local: { x: 20, y: 0 } },
105
- { name: 't3b', local: { x: 20, y: -20 } },
97
+ { name: "t1a", local: { x: -20, y: 20 } },
98
+ { name: "p1", local: { x: -20, y: 0 } },
99
+ { name: "t1b", local: { x: -20, y: -20 } },
100
+ { name: "t2a", local: { x: 0, y: 20 } },
101
+ { name: "p2", local: { x: 0, y: 0 } },
102
+ { name: "t2b", local: { x: 0, y: -20 } },
103
+ { name: "t3a", local: { x: 20, y: 20 } },
104
+ { name: "p3", local: { x: 20, y: 0 } },
105
+ { name: "t3b", local: { x: 20, y: -20 } },
106
106
  ];
107
107
  // LM13700-style OTA: differential inputs + bias current + output. Two amps per package
108
108
  // are modeled as separate symbols sharing the same supply.
109
109
  const OTA_TERMINALS = [
110
- { name: 'vin+', local: { x: -30, y: 10 } },
111
- { name: 'vin-', local: { x: -30, y: -10 } },
112
- { name: 'ibias', local: { x: -30, y: 20 } },
113
- { name: 'iout', local: { x: 30, y: 0 } },
114
- { name: 'vcc', local: { x: 0, y: 20 } },
115
- { name: 'vee', local: { x: 0, y: -20 } },
110
+ { name: "vin+", local: { x: -30, y: 10 } },
111
+ { name: "vin-", local: { x: -30, y: -10 } },
112
+ { name: "ibias", local: { x: -30, y: 20 } },
113
+ { name: "iout", local: { x: 30, y: 0 } },
114
+ { name: "vcc", local: { x: 0, y: 20 } },
115
+ { name: "vee", local: { x: 0, y: -20 } },
116
116
  ];
117
117
  // Bucket-brigade delay (MN3007/3008/3205 family). Symmetric balanced outputs.
118
118
  const BBD_TERMINALS = [
119
- { name: 'vdd', local: { x: -30, y: 20 } },
120
- { name: 'vgg', local: { x: -30, y: 0 } },
121
- { name: 'vss', local: { x: -30, y: -20 } },
122
- { name: 'cp1', local: { x: 0, y: 20 } },
123
- { name: 'cp2', local: { x: 0, y: -20 } },
124
- { name: 'in', local: { x: -30, y: -10 } },
125
- { name: 'out1', local: { x: 30, y: 10 } },
126
- { name: 'out2', local: { x: 30, y: -10 } },
119
+ { name: "vdd", local: { x: -30, y: 20 } },
120
+ { name: "vgg", local: { x: -30, y: 0 } },
121
+ { name: "vss", local: { x: -30, y: -20 } },
122
+ { name: "cp1", local: { x: 0, y: 20 } },
123
+ { name: "cp2", local: { x: 0, y: -20 } },
124
+ { name: "in", local: { x: -30, y: -10 } },
125
+ { name: "out1", local: { x: 30, y: 10 } },
126
+ { name: "out2", local: { x: 30, y: -10 } },
127
127
  ];
128
128
  // PT2399 digital echo IC (16-pin DIP). Key audio + control pins; others omitted from the
129
129
  // terminal map but still preserved as raw_attributes properties on the component.
130
130
  const PT2399_TERMINALS = [
131
- { name: 'vcc', local: { x: -30, y: 20 } },
132
- { name: 'gnd', local: { x: -30, y: -20 } },
133
- { name: 'vref', local: { x: -30, y: 10 } },
134
- { name: 'vco', local: { x: -30, y: 0 } },
135
- { name: 'in', local: { x: -30, y: -10 } },
136
- { name: 'out', local: { x: 30, y: 10 } },
137
- { name: 'fb', local: { x: 30, y: 0 } },
138
- { name: 'da1', local: { x: 30, y: -5 } },
139
- { name: 'da2', local: { x: 30, y: -10 } },
131
+ { name: "vcc", local: { x: -30, y: 20 } },
132
+ { name: "gnd", local: { x: -30, y: -20 } },
133
+ { name: "vref", local: { x: -30, y: 10 } },
134
+ { name: "vco", local: { x: -30, y: 0 } },
135
+ { name: "in", local: { x: -30, y: -10 } },
136
+ { name: "out", local: { x: 30, y: 10 } },
137
+ { name: "fb", local: { x: 30, y: 0 } },
138
+ { name: "da1", local: { x: 30, y: -5 } },
139
+ { name: "da2", local: { x: 30, y: -10 } },
140
140
  ];
141
141
  // LM386 mini power amp (8-pin DIP).
142
142
  const LM386_TERMINALS = [
143
- { name: 'gain1', local: { x: -30, y: 20 } },
144
- { name: 'vin-', local: { x: -30, y: 10 } },
145
- { name: 'vin+', local: { x: -30, y: 0 } },
146
- { name: 'gnd', local: { x: -30, y: -20 } },
147
- { name: 'vout', local: { x: 30, y: 0 } },
148
- { name: 'vs', local: { x: 30, y: 20 } },
149
- { name: 'bypass', local: { x: 30, y: 10 } },
150
- { name: 'gain8', local: { x: 30, y: -20 } },
143
+ { name: "gain1", local: { x: -30, y: 20 } },
144
+ { name: "vin-", local: { x: -30, y: 10 } },
145
+ { name: "vin+", local: { x: -30, y: 0 } },
146
+ { name: "gnd", local: { x: -30, y: -20 } },
147
+ { name: "vout", local: { x: 30, y: 0 } },
148
+ { name: "vs", local: { x: 30, y: 20 } },
149
+ { name: "bypass", local: { x: 30, y: 10 } },
150
+ { name: "gain8", local: { x: 30, y: -20 } },
151
151
  ];
152
152
  const MICROBLOCK_STAGE_TERMINALS = [
153
- { name: 'in', local: { x: 0, y: 20 } },
154
- { name: 'out', local: { x: 0, y: -20 } },
153
+ { name: "in", local: { x: 0, y: 20 } },
154
+ { name: "out", local: { x: 0, y: -20 } },
155
155
  ];
156
156
  const RUNTIME_DESCRIPTOR_TERMINALS = [
157
- { name: 'input', local: { x: 0, y: 20 } },
158
- { name: 'output', local: { x: 0, y: -20 } },
157
+ { name: "input", local: { x: 0, y: 20 } },
158
+ { name: "output", local: { x: 0, y: -20 } },
159
159
  ];
160
160
  const MICROBLOCK_STAGE_QUANTITY_PROPS = [
161
- 'ClipThreshold',
162
- 'InputHighpassHz',
163
- 'OutputLowpassHz',
164
- 'MinDriveGain',
165
- 'MaxDriveGain',
166
- 'DriveControlWipe',
167
- 'MinOutputLevel',
168
- 'MaxOutputLevel',
169
- 'OutputControlWipe',
170
- 'MinToneHz',
171
- 'MaxToneHz',
172
- 'ToneControlWipe',
173
- 'DecaySeconds',
174
- 'PreDelaySeconds',
175
- 'DelaySeconds',
176
- 'MinDelaySeconds',
177
- 'MaxDelaySeconds',
178
- 'Feedback',
179
- 'FeedbackControlWipe',
180
- 'Mix',
181
- 'MixControlWipe',
182
- 'WetMix',
183
- 'DryMix',
184
- 'RoomSize',
185
- 'Damping',
186
- 'DampingHz',
187
- 'ModDepth',
188
- 'ModRateHz',
189
- 'SampleRateHz',
161
+ "ClipThreshold",
162
+ "InputHighpassHz",
163
+ "OutputLowpassHz",
164
+ "MinDriveGain",
165
+ "MaxDriveGain",
166
+ "DriveControlWipe",
167
+ "MinOutputLevel",
168
+ "MaxOutputLevel",
169
+ "OutputControlWipe",
170
+ "MinToneHz",
171
+ "MaxToneHz",
172
+ "ToneControlWipe",
173
+ "DecaySeconds",
174
+ "PreDelaySeconds",
175
+ "DelaySeconds",
176
+ "MinDelaySeconds",
177
+ "MaxDelaySeconds",
178
+ "Feedback",
179
+ "FeedbackControlWipe",
180
+ "Mix",
181
+ "MixControlWipe",
182
+ "WetMix",
183
+ "DryMix",
184
+ "RoomSize",
185
+ "Damping",
186
+ "DampingHz",
187
+ "ModDepth",
188
+ "ModRateHz",
189
+ "SampleRateHz",
190
190
  ];
191
191
  const RUNTIME_DESCRIPTOR_QUANTITY_PROPS = [
192
192
  ...MICROBLOCK_STAGE_QUANTITY_PROPS,
193
- 'MinDelayMs',
194
- 'MaxDelayMs',
195
- 'DelayMs',
196
- 'PreDelayMs',
197
- 'Decay',
198
- 'Damping',
199
- 'Size',
200
- 'Tone',
201
- 'ModDepthMs',
202
- 'MinModDepthMs',
203
- 'MaxModDepthMs',
204
- 'ModRateHz',
205
- 'MinModRateHz',
206
- 'MaxModRateHz',
207
- 'InputDrive',
208
- 'Headroom',
209
- 'Sensitivity',
210
- 'MinSensitivity',
211
- 'MaxSensitivity',
212
- 'AttackMs',
213
- 'MinAttackMs',
214
- 'MaxAttackMs',
215
- 'ReleaseMs',
216
- 'TriggerThreshold',
217
- 'MinGain',
218
- 'MinInputGain',
219
- 'MaxInputGain',
220
- 'BandFrequencyControlWipes',
221
- 'BandControlWipes',
222
- 'MinMix',
223
- 'MaxMix',
224
- 'ToneHz',
225
- 'RateHz',
226
- 'MinRateHz',
227
- 'MaxRateHz',
228
- 'Depth',
229
- 'StageCount',
230
- 'MinFeedback',
231
- 'MaxFeedback',
232
- 'SemitoneShift',
233
- 'MinSemitoneShift',
234
- 'MaxSemitoneShift',
193
+ "MinDelayMs",
194
+ "MaxDelayMs",
195
+ "DelayMs",
196
+ "PreDelayMs",
197
+ "Decay",
198
+ "Damping",
199
+ "Size",
200
+ "Tone",
201
+ "ModDepthMs",
202
+ "MinModDepthMs",
203
+ "MaxModDepthMs",
204
+ "ModRateHz",
205
+ "MinModRateHz",
206
+ "MaxModRateHz",
207
+ "InputDrive",
208
+ "Headroom",
209
+ "Sensitivity",
210
+ "MinSensitivity",
211
+ "MaxSensitivity",
212
+ "AttackMs",
213
+ "MinAttackMs",
214
+ "MaxAttackMs",
215
+ "ReleaseMs",
216
+ "TriggerThreshold",
217
+ "MinGain",
218
+ "MinInputGain",
219
+ "MaxInputGain",
220
+ "BandFrequencyControlWipes",
221
+ "BandControlWipes",
222
+ "MinMix",
223
+ "MaxMix",
224
+ "ToneHz",
225
+ "RateHz",
226
+ "MinRateHz",
227
+ "MaxRateHz",
228
+ "Depth",
229
+ "StageCount",
230
+ "MinFeedback",
231
+ "MaxFeedback",
232
+ "SemitoneShift",
233
+ "MinSemitoneShift",
234
+ "MaxSemitoneShift",
235
235
  ];
236
236
  const MICROBLOCK_OVERDRIVE_STAGE_DEF = {
237
- shortType: 'MicroBlockOverdriveStage',
238
- kind: 'ic',
237
+ shortType: "MicroBlockOverdriveStage",
238
+ kind: "ic",
239
239
  terminals: MICROBLOCK_STAGE_TERMINALS,
240
240
  quantityProps: MICROBLOCK_STAGE_QUANTITY_PROPS,
241
241
  };
242
242
  // 78L05 / 78xx 3-terminal linear regulator (TO-92 / TO-220 pinout: input / ground / output).
243
243
  const REGULATOR_TERMINALS = [
244
- { name: 'vin', local: { x: -20, y: 0 } },
245
- { name: 'gnd', local: { x: 0, y: -20 } },
246
- { name: 'vout', local: { x: 20, y: 0 } },
244
+ { name: "vin", local: { x: -20, y: 0 } },
245
+ { name: "gnd", local: { x: 0, y: -20 } },
246
+ { name: "vout", local: { x: 20, y: 0 } },
247
247
  ];
248
248
  // CD4066 quad bilateral switch — one switch element of four. Each instance models one of
249
249
  // the four switches in the package; the package itself is implied by Name + Group metadata.
250
250
  const ANALOG_SWITCH_TERMINALS = [
251
- { name: 'a', local: { x: -20, y: 10 } },
252
- { name: 'b', local: { x: 20, y: 10 } },
253
- { name: 'ctrl', local: { x: 0, y: -20 } },
251
+ { name: "a", local: { x: -20, y: 10 } },
252
+ { name: "b", local: { x: 20, y: 10 } },
253
+ { name: "ctrl", local: { x: 0, y: -20 } },
254
254
  ];
255
255
  // CD4013 dual D flip-flop — single FF instance (D, CLK, Q, Q̅, S, R).
256
256
  const FLIPFLOP_TERMINALS = [
257
- { name: 'd', local: { x: -20, y: 10 } },
258
- { name: 'clk', local: { x: -20, y: -10 } },
259
- { name: 's', local: { x: 0, y: 20 } },
260
- { name: 'r', local: { x: 0, y: -20 } },
261
- { name: 'q', local: { x: 20, y: 10 } },
262
- { name: 'qbar', local: { x: 20, y: -10 } },
257
+ { name: "d", local: { x: -20, y: 10 } },
258
+ { name: "clk", local: { x: -20, y: -10 } },
259
+ { name: "s", local: { x: 0, y: 20 } },
260
+ { name: "r", local: { x: 0, y: -20 } },
261
+ { name: "q", local: { x: 20, y: 10 } },
262
+ { name: "qbar", local: { x: 20, y: -10 } },
263
263
  ];
264
264
  // Generic opaque IC fallback (4 + 4 pins, DIP-8 layout). Used when no specific catalog
265
265
  // entry exists — preserves the source type name for round-tripping.
266
266
  const GENERIC_IC_TERMINALS = [
267
- { name: 'p1', local: { x: -20, y: 15 } },
268
- { name: 'p2', local: { x: -20, y: 5 } },
269
- { name: 'p3', local: { x: -20, y: -5 } },
270
- { name: 'p4', local: { x: -20, y: -15 } },
271
- { name: 'p5', local: { x: 20, y: -15 } },
272
- { name: 'p6', local: { x: 20, y: -5 } },
273
- { name: 'p7', local: { x: 20, y: 5 } },
274
- { name: 'p8', local: { x: 20, y: 15 } },
267
+ { name: "p1", local: { x: -20, y: 15 } },
268
+ { name: "p2", local: { x: -20, y: 5 } },
269
+ { name: "p3", local: { x: -20, y: -5 } },
270
+ { name: "p4", local: { x: -20, y: -15 } },
271
+ { name: "p5", local: { x: 20, y: -15 } },
272
+ { name: "p6", local: { x: 20, y: -5 } },
273
+ { name: "p7", local: { x: 20, y: 5 } },
274
+ { name: "p8", local: { x: 20, y: 15 } },
275
275
  ];
276
276
  const DEFS = [
277
- { shortType: 'Resistor', kind: 'resistor', terminals: TWO_TERMINAL_AB, quantityProps: ['Resistance'] },
278
- { shortType: 'Capacitor', kind: 'capacitor', terminals: TWO_TERMINAL_AB, quantityProps: ['Capacitance'] },
279
- { shortType: 'Inductor', kind: 'inductor', terminals: TWO_TERMINAL_AB, quantityProps: ['Inductance'] },
280
- { shortType: 'Conductor', kind: 'unsupported', terminals: TWO_TERMINAL_AB, quantityProps: [] },
281
- { shortType: 'Buffer', kind: 'unsupported', terminals: TWO_TERMINAL_AB, quantityProps: [] },
282
- { shortType: 'Diode', kind: 'diode', terminals: TWO_TERMINAL_DIODE, quantityProps: ['IS', 'Is', 'N', 'n', 'Rs'] },
283
- { shortType: 'TubeDiode', kind: 'tube-diode', terminals: TWO_TERMINAL_DIODE, quantityProps: [] },
284
- { shortType: 'BipolarJunctionTransistor', kind: 'bjt', terminals: BJT_TERMINALS, quantityProps: ['IS', 'BF', 'BR', 'Is', 'Vt', 'Bf', 'Br', 'n'] },
285
- { shortType: 'NpnBjt', kind: 'bjt', terminals: BJT_TERMINALS, quantityProps: ['Is', 'Vt', 'Bf', 'Br'] },
286
- { shortType: 'PnpBjt', kind: 'bjt', terminals: BJT_TERMINALS, quantityProps: ['Is', 'Vt', 'Bf', 'Br'] },
287
- { shortType: 'Bjt', kind: 'bjt', terminals: BJT_TERMINALS, quantityProps: ['Is', 'Vt', 'Bf', 'Br'] },
288
- { shortType: 'NjfJfet', kind: 'jfet', terminals: JFET_TERMINALS, quantityProps: ['Is', 'Beta', 'Vt', 'Lambda'] },
289
- { shortType: 'PjfJfet', kind: 'jfet', terminals: JFET_TERMINALS, quantityProps: ['Is', 'Beta', 'Vt', 'Lambda'] },
290
- { shortType: 'Jfet', kind: 'jfet', terminals: JFET_TERMINALS, quantityProps: ['Is', 'Beta', 'Vt', 'Lambda'] },
291
- { shortType: 'JunctionFieldEffectTransistor', kind: 'jfet', terminals: LIVE_SPICE_JUNCTION_FET_TERMINALS, quantityProps: ['IS', 'Is', 'n', 'Vt0', 'Vt', 'Beta', 'Lambda'] },
292
- { shortType: 'NMosfet', kind: 'mosfet', terminals: MOSFET_TERMINALS, quantityProps: ['Vto', 'Kp', 'Lambda'] },
293
- { shortType: 'PMosfet', kind: 'mosfet', terminals: MOSFET_TERMINALS, quantityProps: ['Vto', 'Kp', 'Lambda'] },
294
- { shortType: 'Mosfet', kind: 'mosfet', terminals: MOSFET_TERMINALS, quantityProps: ['Vto', 'Kp', 'Lambda'] },
295
- { shortType: 'OpAmp', kind: 'opamp', terminals: OPAMP_TERMINALS, quantityProps: ['SupplyVoltage'] },
296
- { shortType: 'IdealOpAmp', kind: 'opamp', terminals: OPAMP_TERMINALS, quantityProps: [] },
297
- { shortType: 'OTA', kind: 'ota', terminals: OTA_TERMINALS, quantityProps: ['SupplyVoltage'] },
298
- { shortType: 'BBD', kind: 'bbd', terminals: BBD_TERMINALS, quantityProps: ['Stages'] },
299
- { shortType: 'PT2399', kind: 'delay-ic', terminals: PT2399_TERMINALS, quantityProps: [] },
300
- { shortType: 'LM386', kind: 'power-amp', terminals: LM386_TERMINALS, quantityProps: ['SupplyVoltage'] },
301
- { shortType: 'Regulator', kind: 'regulator', terminals: REGULATOR_TERMINALS, quantityProps: ['Vout'] },
302
- { shortType: 'AnalogSwitch', kind: 'analog-switch', terminals: ANALOG_SWITCH_TERMINALS, quantityProps: [] },
303
- { shortType: 'FlipFlop', kind: 'flipflop', terminals: FLIPFLOP_TERMINALS, quantityProps: [] },
304
- { shortType: 'IC', kind: 'ic', terminals: GENERIC_IC_TERMINALS, quantityProps: [] },
277
+ {
278
+ shortType: "Resistor",
279
+ kind: "resistor",
280
+ terminals: TWO_TERMINAL_AB,
281
+ quantityProps: ["Resistance"],
282
+ },
283
+ {
284
+ shortType: "Capacitor",
285
+ kind: "capacitor",
286
+ terminals: TWO_TERMINAL_AB,
287
+ quantityProps: ["Capacitance"],
288
+ },
289
+ {
290
+ shortType: "Inductor",
291
+ kind: "inductor",
292
+ terminals: TWO_TERMINAL_AB,
293
+ quantityProps: ["Inductance"],
294
+ },
295
+ {
296
+ shortType: "Conductor",
297
+ kind: "unsupported",
298
+ terminals: TWO_TERMINAL_AB,
299
+ quantityProps: [],
300
+ },
301
+ {
302
+ shortType: "Buffer",
303
+ kind: "unsupported",
304
+ terminals: TWO_TERMINAL_AB,
305
+ quantityProps: [],
306
+ },
307
+ {
308
+ shortType: "Diode",
309
+ kind: "diode",
310
+ terminals: TWO_TERMINAL_DIODE,
311
+ quantityProps: ["IS", "Is", "N", "n", "Rs"],
312
+ },
313
+ {
314
+ shortType: "TubeDiode",
315
+ kind: "tube-diode",
316
+ terminals: TWO_TERMINAL_DIODE,
317
+ quantityProps: [],
318
+ },
319
+ {
320
+ shortType: "BipolarJunctionTransistor",
321
+ kind: "bjt",
322
+ terminals: BJT_TERMINALS,
323
+ quantityProps: ["IS", "BF", "BR", "Is", "Vt", "Bf", "Br", "n"],
324
+ },
325
+ {
326
+ shortType: "NpnBjt",
327
+ kind: "bjt",
328
+ terminals: BJT_TERMINALS,
329
+ quantityProps: ["Is", "Vt", "Bf", "Br"],
330
+ },
331
+ {
332
+ shortType: "PnpBjt",
333
+ kind: "bjt",
334
+ terminals: BJT_TERMINALS,
335
+ quantityProps: ["Is", "Vt", "Bf", "Br"],
336
+ },
337
+ {
338
+ shortType: "Bjt",
339
+ kind: "bjt",
340
+ terminals: BJT_TERMINALS,
341
+ quantityProps: ["Is", "Vt", "Bf", "Br"],
342
+ },
343
+ {
344
+ shortType: "NjfJfet",
345
+ kind: "jfet",
346
+ terminals: JFET_TERMINALS,
347
+ quantityProps: ["Is", "Beta", "Vt", "Lambda"],
348
+ },
349
+ {
350
+ shortType: "PjfJfet",
351
+ kind: "jfet",
352
+ terminals: JFET_TERMINALS,
353
+ quantityProps: ["Is", "Beta", "Vt", "Lambda"],
354
+ },
355
+ {
356
+ shortType: "Jfet",
357
+ kind: "jfet",
358
+ terminals: JFET_TERMINALS,
359
+ quantityProps: ["Is", "Beta", "Vt", "Lambda"],
360
+ },
361
+ {
362
+ shortType: "JunctionFieldEffectTransistor",
363
+ kind: "jfet",
364
+ terminals: LIVE_SPICE_JUNCTION_FET_TERMINALS,
365
+ quantityProps: ["IS", "Is", "n", "Vt0", "Vt", "Beta", "Lambda"],
366
+ },
367
+ {
368
+ shortType: "NMosfet",
369
+ kind: "mosfet",
370
+ terminals: MOSFET_TERMINALS,
371
+ quantityProps: ["Vto", "Kp", "Lambda"],
372
+ },
373
+ {
374
+ shortType: "PMosfet",
375
+ kind: "mosfet",
376
+ terminals: MOSFET_TERMINALS,
377
+ quantityProps: ["Vto", "Kp", "Lambda"],
378
+ },
379
+ {
380
+ shortType: "Mosfet",
381
+ kind: "mosfet",
382
+ terminals: MOSFET_TERMINALS,
383
+ quantityProps: ["Vto", "Kp", "Lambda"],
384
+ },
385
+ {
386
+ shortType: "OpAmp",
387
+ kind: "opamp",
388
+ terminals: OPAMP_TERMINALS,
389
+ quantityProps: ["SupplyVoltage"],
390
+ },
391
+ {
392
+ shortType: "IdealOpAmp",
393
+ kind: "opamp",
394
+ terminals: OPAMP_TERMINALS,
395
+ quantityProps: [],
396
+ },
397
+ {
398
+ shortType: "OTA",
399
+ kind: "ota",
400
+ terminals: OTA_TERMINALS,
401
+ quantityProps: ["SupplyVoltage"],
402
+ },
403
+ {
404
+ shortType: "BBD",
405
+ kind: "bbd",
406
+ terminals: BBD_TERMINALS,
407
+ quantityProps: ["Stages"],
408
+ },
409
+ {
410
+ shortType: "PT2399",
411
+ kind: "delay-ic",
412
+ terminals: PT2399_TERMINALS,
413
+ quantityProps: [],
414
+ },
415
+ {
416
+ shortType: "LM386",
417
+ kind: "power-amp",
418
+ terminals: LM386_TERMINALS,
419
+ quantityProps: ["SupplyVoltage"],
420
+ },
421
+ {
422
+ shortType: "Regulator",
423
+ kind: "regulator",
424
+ terminals: REGULATOR_TERMINALS,
425
+ quantityProps: ["Vout"],
426
+ },
427
+ {
428
+ shortType: "AnalogSwitch",
429
+ kind: "analog-switch",
430
+ terminals: ANALOG_SWITCH_TERMINALS,
431
+ quantityProps: [],
432
+ },
433
+ {
434
+ shortType: "FlipFlop",
435
+ kind: "flipflop",
436
+ terminals: FLIPFLOP_TERMINALS,
437
+ quantityProps: [],
438
+ },
439
+ {
440
+ shortType: "IC",
441
+ kind: "ic",
442
+ terminals: GENERIC_IC_TERMINALS,
443
+ quantityProps: [],
444
+ },
305
445
  MICROBLOCK_OVERDRIVE_STAGE_DEF,
306
- { shortType: 'Triode', kind: 'triode', terminals: TRIODE_TERMINALS, quantityProps: ['Mu', 'K', 'Kp', 'Kvb', 'Ex'] },
307
- { shortType: 'Pentode', kind: 'pentode', terminals: PENTODE_TERMINALS, quantityProps: ['Mu', 'K', 'Kp', 'Kvb', 'Ex'] },
308
- { shortType: 'Transformer', kind: 'transformer', terminals: TRANSFORMER_TERMINALS, quantityProps: ['Lp', 'Ls', 'k'] },
309
- { shortType: 'CenterTapTransformer', kind: 'transformer', terminals: CENTER_TAP_TRANSFORMER_TERMINALS, quantityProps: ['Turns'] },
310
- { shortType: 'Potentiometer', kind: 'potentiometer', terminals: POT_TERMINALS, quantityProps: ['Resistance', 'Wipe', 'Sweep'] },
311
- { shortType: 'VariableResistor', kind: 'variable-resistor', terminals: TWO_TERMINAL_AB, quantityProps: ['Resistance'] },
312
- { shortType: 'Switch', kind: 'switch', terminals: TWO_TERMINAL_AB, quantityProps: [] },
313
- { shortType: 'SPDT', kind: 'switch', terminals: SPDT_TERMINALS, quantityProps: [] },
314
- { shortType: 'SP3T', kind: 'switch', terminals: SP3T_TERMINALS, quantityProps: [] },
315
- { shortType: 'SP4T', kind: 'switch', terminals: SP4T_TERMINALS, quantityProps: [] },
316
- { shortType: '3PDT', kind: 'switch', terminals: THREE_PDT_TERMINALS, quantityProps: [] },
317
- { shortType: 'VoltageSource', kind: 'voltage-source', terminals: TWO_TERMINAL_SOURCE, quantityProps: ['Voltage'] },
318
- { shortType: 'CurrentSource', kind: 'current-source', terminals: TWO_TERMINAL_SOURCE, quantityProps: ['Current'] },
319
- { shortType: 'Battery', kind: 'battery', terminals: TWO_TERMINAL_SOURCE, quantityProps: ['Voltage'] },
320
- { shortType: 'Rail', kind: 'rail', terminals: SINGLE_TERMINAL, quantityProps: ['Voltage'] },
321
- { shortType: 'Ground', kind: 'ground', terminals: SINGLE_TERMINAL, quantityProps: [] },
322
- { shortType: 'VoltageDefinition', kind: 'unsupported', terminals: VOLTAGE_DEFINITION_TERMINALS, quantityProps: [] },
323
- { shortType: 'Input', kind: 'jack', terminals: TWO_TERMINAL_AB, quantityProps: ['V0dBFS'] },
324
- { shortType: 'Speaker', kind: 'jack', terminals: TWO_TERMINAL_AB, quantityProps: ['Impedance', 'V0dBFS'] },
325
- { shortType: 'NamedWire', kind: 'named-wire', terminals: SINGLE_TERMINAL, quantityProps: [] },
326
- { shortType: 'Label', kind: 'label', terminals: [], quantityProps: [] },
327
- { shortType: 'Port', kind: 'port', terminals: SINGLE_TERMINAL, quantityProps: [] },
446
+ {
447
+ shortType: "Triode",
448
+ kind: "triode",
449
+ terminals: TRIODE_TERMINALS,
450
+ quantityProps: ["Mu", "K", "Kp", "Kvb", "Ex"],
451
+ },
452
+ {
453
+ shortType: "Pentode",
454
+ kind: "pentode",
455
+ terminals: PENTODE_TERMINALS,
456
+ quantityProps: ["Mu", "K", "Kp", "Kvb", "Ex"],
457
+ },
458
+ {
459
+ shortType: "Transformer",
460
+ kind: "transformer",
461
+ terminals: TRANSFORMER_TERMINALS,
462
+ quantityProps: ["Lp", "Ls", "k"],
463
+ },
464
+ {
465
+ shortType: "CenterTapTransformer",
466
+ kind: "transformer",
467
+ terminals: CENTER_TAP_TRANSFORMER_TERMINALS,
468
+ quantityProps: ["Turns"],
469
+ },
470
+ {
471
+ shortType: "Potentiometer",
472
+ kind: "potentiometer",
473
+ terminals: POT_TERMINALS,
474
+ quantityProps: ["Resistance", "Wipe", "Sweep"],
475
+ },
476
+ {
477
+ shortType: "VariableResistor",
478
+ kind: "variable-resistor",
479
+ terminals: TWO_TERMINAL_AB,
480
+ quantityProps: ["Resistance"],
481
+ },
482
+ {
483
+ shortType: "Switch",
484
+ kind: "switch",
485
+ terminals: TWO_TERMINAL_AB,
486
+ quantityProps: [],
487
+ },
488
+ {
489
+ shortType: "SPDT",
490
+ kind: "switch",
491
+ terminals: SPDT_TERMINALS,
492
+ quantityProps: [],
493
+ },
494
+ {
495
+ shortType: "SP3T",
496
+ kind: "switch",
497
+ terminals: SP3T_TERMINALS,
498
+ quantityProps: [],
499
+ },
500
+ {
501
+ shortType: "SP4T",
502
+ kind: "switch",
503
+ terminals: SP4T_TERMINALS,
504
+ quantityProps: [],
505
+ },
506
+ {
507
+ shortType: "3PDT",
508
+ kind: "switch",
509
+ terminals: THREE_PDT_TERMINALS,
510
+ quantityProps: [],
511
+ },
512
+ {
513
+ shortType: "VoltageSource",
514
+ kind: "voltage-source",
515
+ terminals: TWO_TERMINAL_SOURCE,
516
+ quantityProps: ["Voltage"],
517
+ },
518
+ {
519
+ shortType: "CurrentSource",
520
+ kind: "current-source",
521
+ terminals: TWO_TERMINAL_SOURCE,
522
+ quantityProps: ["Current"],
523
+ },
524
+ {
525
+ shortType: "Battery",
526
+ kind: "battery",
527
+ terminals: TWO_TERMINAL_SOURCE,
528
+ quantityProps: ["Voltage"],
529
+ },
530
+ {
531
+ shortType: "Rail",
532
+ kind: "rail",
533
+ terminals: SINGLE_TERMINAL,
534
+ quantityProps: ["Voltage"],
535
+ },
536
+ {
537
+ shortType: "Ground",
538
+ kind: "ground",
539
+ terminals: SINGLE_TERMINAL,
540
+ quantityProps: [],
541
+ },
542
+ {
543
+ shortType: "VoltageDefinition",
544
+ kind: "unsupported",
545
+ terminals: VOLTAGE_DEFINITION_TERMINALS,
546
+ quantityProps: [],
547
+ },
548
+ {
549
+ shortType: "Input",
550
+ kind: "jack",
551
+ terminals: TWO_TERMINAL_AB,
552
+ quantityProps: ["V0dBFS"],
553
+ },
554
+ {
555
+ shortType: "Speaker",
556
+ kind: "jack",
557
+ terminals: TWO_TERMINAL_AB,
558
+ quantityProps: ["Impedance", "V0dBFS"],
559
+ },
560
+ {
561
+ shortType: "NamedWire",
562
+ kind: "named-wire",
563
+ terminals: SINGLE_TERMINAL,
564
+ quantityProps: [],
565
+ },
566
+ { shortType: "Label", kind: "label", terminals: [], quantityProps: [] },
567
+ {
568
+ shortType: "Port",
569
+ kind: "port",
570
+ terminals: SINGLE_TERMINAL,
571
+ quantityProps: [],
572
+ },
328
573
  ];
329
574
  const BY_SHORT_TYPE = new Map(DEFS.map((d) => [d.shortType, d]));
330
575
  const BY_KIND = new Map(DEFS.reduce((acc, def) => {
@@ -334,33 +579,33 @@ const BY_KIND = new Map(DEFS.reduce((acc, def) => {
334
579
  return acc;
335
580
  }, []));
336
581
  export function shortenSchxType(fullType) {
337
- if (fullType.includes('Circuit.Components.Diode')) {
338
- return 'TubeDiode';
582
+ if (fullType.includes("Circuit.Components.Diode")) {
583
+ return "TubeDiode";
339
584
  }
340
585
  const match = fullType.match(/Circuit\.(?:Components\.)?([A-Za-z0-9_]+)/);
341
586
  return match?.[1] ?? fullType;
342
587
  }
343
588
  export function lookupSchxDef(shortType) {
344
- return BY_SHORT_TYPE.get(shortType)
345
- ?? lookupMicroBlockStageDef(shortType)
346
- ?? lookupRuntimeDescriptorDef(shortType);
589
+ return (BY_SHORT_TYPE.get(shortType) ??
590
+ lookupMicroBlockStageDef(shortType) ??
591
+ lookupRuntimeDescriptorDef(shortType));
347
592
  }
348
593
  export function isSchxRuntimeDescriptor(shortType) {
349
- return /^MicroBlock[A-Za-z0-9_]*$/.test(shortType)
350
- || shortType === 'MacroTremolo'
351
- || shortType === 'MacroPhaser';
594
+ return (/^MicroBlock[A-Za-z0-9_]*$/.test(shortType) ||
595
+ shortType === "MacroTremolo" ||
596
+ shortType === "MacroPhaser");
352
597
  }
353
598
  export function defaultDefForKind(kind) {
354
599
  return BY_KIND.get(kind);
355
600
  }
356
- const CIRCUIT_ASSEMBLY = 'Circuit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null';
601
+ const CIRCUIT_ASSEMBLY = "Circuit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
357
602
  export const SCHX_SYMBOL_ELEMENT_TYPE = `Circuit.Symbol, ${CIRCUIT_ASSEMBLY}`;
358
603
  export const SCHX_WIRE_ELEMENT_TYPE = `Circuit.Wire, ${CIRCUIT_ASSEMBLY}`;
359
604
  export function fullSchxType(shortType) {
360
- if (shortType === 'TubeDiode') {
605
+ if (shortType === "TubeDiode") {
361
606
  return `Circuit.Components.Diode, ${CIRCUIT_ASSEMBLY}`;
362
607
  }
363
- const namespace = shortType === 'Pentode' ? 'Circuit.Components' : 'Circuit';
608
+ const namespace = shortType === "Pentode" ? "Circuit.Components" : "Circuit";
364
609
  return `${namespace}.${shortType}, ${CIRCUIT_ASSEMBLY}`;
365
610
  }
366
611
  function lookupMicroBlockStageDef(shortType) {
@@ -378,7 +623,7 @@ function lookupRuntimeDescriptorDef(shortType) {
378
623
  }
379
624
  return {
380
625
  shortType,
381
- kind: 'ic',
626
+ kind: "ic",
382
627
  terminals: RUNTIME_DESCRIPTOR_TERMINALS,
383
628
  quantityProps: RUNTIME_DESCRIPTOR_QUANTITY_PROPS,
384
629
  };