linked-rolls 0.56.0 → 0.58.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.
Files changed (131) hide show
  1. package/README.md +54 -361
  2. package/lib/{constraints.d.ts → analysis/constraints.d.ts} +1 -1
  3. package/lib/{constraints.js → analysis/constraints.js} +9 -8
  4. package/lib/analysis/ownPaper.d.ts +26 -0
  5. package/lib/analysis/ownPaper.js +41 -0
  6. package/lib/{reservations.d.ts → analysis/reservations.d.ts} +3 -3
  7. package/lib/{reservations.js → analysis/reservations.js} +3 -3
  8. package/lib/{sigla.d.ts → analysis/sigla.d.ts} +2 -2
  9. package/lib/{sigla.js → analysis/sigla.js} +4 -4
  10. package/lib/{witnesses.d.ts → analysis/witnesses.d.ts} +2 -2
  11. package/lib/{witnesses.js → analysis/witnesses.js} +4 -4
  12. package/lib/{Collation.d.ts → collation/Collation.d.ts} +4 -4
  13. package/lib/{Collation.js → collation/Collation.js} +4 -4
  14. package/lib/{alignment.d.ts → collation/alignment.d.ts} +4 -4
  15. package/lib/{alignment.js → collation/alignment.js} +10 -16
  16. package/lib/{scatter.d.ts → collation/scatter.d.ts} +4 -4
  17. package/lib/{scatter.js → collation/scatter.js} +6 -6
  18. package/lib/{statistics.d.ts → collation/statistics.d.ts} +1 -1
  19. package/lib/{statistics.js → collation/statistics.js} +2 -2
  20. package/lib/{substitution.d.ts → collation/substitution.d.ts} +9 -24
  21. package/lib/{substitution.js → collation/substitution.js} +13 -37
  22. package/lib/emulation/Emulation.d.ts +64 -0
  23. package/lib/emulation/Emulation.js +282 -0
  24. package/lib/emulation/negotiation.d.ts +14 -0
  25. package/lib/emulation/negotiation.js +20 -0
  26. package/lib/index.d.ts +43 -35
  27. package/lib/index.js +36 -35
  28. package/lib/{asJsonLd.d.ts → io/asJsonLd.d.ts} +1 -1
  29. package/lib/{asJsonLd.js → io/asJsonLd.js} +22 -51
  30. package/lib/{context.d.ts → io/context.d.ts} +4 -4
  31. package/lib/{context.js → io/context.js} +4 -4
  32. package/lib/{importJsonLd.d.ts → io/importJsonLd.d.ts} +1 -1
  33. package/lib/io/importJsonLd.js +128 -0
  34. package/lib/{migrate.d.ts → io/migrate.d.ts} +9 -0
  35. package/lib/{migrate.js → io/migrate.js} +97 -54
  36. package/lib/{Agent.d.ts → model/Agent.d.ts} +1 -1
  37. package/lib/{Assumption.d.ts → model/Assumption.d.ts} +1 -1
  38. package/lib/{ConditionState.d.ts → model/ConditionState.d.ts} +1 -2
  39. package/lib/{Edit.d.ts → model/Edit.d.ts} +1 -1
  40. package/lib/{Edition.d.ts → model/Edition.d.ts} +2 -2
  41. package/lib/{Feature.d.ts → model/Feature.d.ts} +3 -1
  42. package/lib/{Feature.js → model/Feature.js} +2 -0
  43. package/lib/{FeatureSource.d.ts → model/FeatureSource.d.ts} +1 -1
  44. package/lib/{Perforator.d.ts → model/Perforator.d.ts} +1 -1
  45. package/lib/{RollCopy.d.ts → model/RollCopy.d.ts} +5 -12
  46. package/lib/{RollCopy.js → model/RollCopy.js} +3 -5
  47. package/lib/{Symbol.d.ts → model/Symbol.d.ts} +1 -1
  48. package/lib/{Version.d.ts → model/Version.d.ts} +11 -3
  49. package/lib/{Version.js → model/Version.js} +24 -1
  50. package/lib/{vocabulary.js → model/vocabulary.js} +2 -2
  51. package/lib/ops/beliefs.d.ts +9 -0
  52. package/lib/ops/beliefs.js +31 -0
  53. package/lib/ops/collation.d.ts +62 -0
  54. package/lib/ops/collation.js +228 -0
  55. package/lib/ops/commands.d.ts +9 -0
  56. package/lib/ops/commands.js +29 -0
  57. package/lib/ops/copies.d.ts +74 -0
  58. package/lib/ops/copies.js +135 -0
  59. package/lib/ops/draft.d.ts +59 -0
  60. package/lib/ops/draft.js +81 -0
  61. package/lib/ops/edits.d.ts +10 -0
  62. package/lib/ops/edits.js +82 -0
  63. package/lib/ops/features.d.ts +84 -0
  64. package/lib/ops/features.js +296 -0
  65. package/lib/ops/forget.d.ts +31 -0
  66. package/lib/ops/forget.js +110 -0
  67. package/lib/ops/immutable.d.ts +16 -0
  68. package/lib/ops/immutable.js +46 -0
  69. package/lib/ops/index.d.ts +13 -0
  70. package/lib/ops/index.js +7 -0
  71. package/lib/ops/versions.d.ts +33 -0
  72. package/lib/ops/versions.js +95 -0
  73. package/lib/readers/AtonParser.js +5 -7
  74. package/lib/readers/phillipsEroll.d.ts +3 -3
  75. package/lib/readers/phillipsEroll.js +4 -5
  76. package/lib/readers/spencerBar.d.ts +2 -2
  77. package/lib/readers/spencerBar.js +2 -3
  78. package/lib/readers/stanfordAton.d.ts +3 -3
  79. package/lib/readers/stanfordAton.js +2 -4
  80. package/lib/schema.json +11 -151
  81. package/lib/spec/context.json +2 -12
  82. package/lib/{ReproducingSystem.d.ts → systems/ReproducingSystem.d.ts} +3 -3
  83. package/lib/{TrackerBar.d.ts → systems/TrackerBar.d.ts} +48 -8
  84. package/lib/{TrackerBar.js → systems/TrackerBar.js} +11 -2
  85. package/lib/systems/index.d.ts +8 -2
  86. package/lib/systems/index.js +7 -1
  87. package/lib/systems/welte.d.ts +100 -0
  88. package/lib/systems/welte.js +119 -0
  89. package/lib/systems/welteLicensee/bar.d.ts +1 -1
  90. package/lib/systems/welteLicensee/bar.js +5 -2
  91. package/lib/systems/welteLicensee/system.d.ts +1 -1
  92. package/lib/systems/welteLicensee/system.js +1 -1
  93. package/lib/systems/welteT100/bar.d.ts +27 -1
  94. package/lib/systems/welteT100/bar.js +44 -2
  95. package/lib/systems/welteT100/system.d.ts +6 -39
  96. package/lib/systems/welteT100/system.js +19 -128
  97. package/lib/systems/welteT98/bar.d.ts +1 -1
  98. package/lib/systems/welteT98/bar.js +18 -2
  99. package/lib/systems/welteT98/system.d.ts +20 -38
  100. package/lib/systems/welteT98/system.js +20 -121
  101. package/lib/validate.d.ts +1 -1
  102. package/lib/{EditionView.d.ts → view/EditionView.d.ts} +38 -48
  103. package/lib/{EditionView.js → view/EditionView.js} +90 -96
  104. package/package.json +7 -2
  105. package/lib/Emulation.d.ts +0 -36
  106. package/lib/Emulation.js +0 -250
  107. package/lib/editionOps.d.ts +0 -260
  108. package/lib/editionOps.js +0 -1081
  109. package/lib/importJsonLd.js +0 -62
  110. /package/lib/{Agent.js → model/Agent.js} +0 -0
  111. /package/lib/{Assumption.js → model/Assumption.js} +0 -0
  112. /package/lib/{ConditionState.js → model/ConditionState.js} +0 -0
  113. /package/lib/{Edit.js → model/Edit.js} +0 -0
  114. /package/lib/{Edition.js → model/Edition.js} +0 -0
  115. /package/lib/{FeatureSource.js → model/FeatureSource.js} +0 -0
  116. /package/lib/{Perforator.js → model/Perforator.js} +0 -0
  117. /package/lib/{Quantity.d.ts → model/Quantity.d.ts} +0 -0
  118. /package/lib/{Quantity.js → model/Quantity.js} +0 -0
  119. /package/lib/{Symbol.js → model/Symbol.js} +0 -0
  120. /package/lib/{TrackCalibration.d.ts → model/TrackCalibration.d.ts} +0 -0
  121. /package/lib/{TrackCalibration.js → model/TrackCalibration.js} +0 -0
  122. /package/lib/{notes.d.ts → model/notes.d.ts} +0 -0
  123. /package/lib/{notes.js → model/notes.js} +0 -0
  124. /package/lib/{procedures.d.ts → model/procedures.d.ts} +0 -0
  125. /package/lib/{procedures.js → model/procedures.js} +0 -0
  126. /package/lib/{vocabulary.d.ts → model/vocabulary.d.ts} +0 -0
  127. /package/lib/{sorted.d.ts → shared/sorted.d.ts} +0 -0
  128. /package/lib/{sorted.js → shared/sorted.js} +0 -0
  129. /package/lib/{utils.d.ts → shared/utils.d.ts} +0 -0
  130. /package/lib/{utils.js → shared/utils.js} +0 -0
  131. /package/lib/{ReproducingSystem.js → systems/ReproducingSystem.js} +0 -0
package/lib/schema.json CHANGED
@@ -1221,7 +1221,7 @@
1221
1221
  "$ref": "#/definitions/AnyFeature"
1222
1222
  },
1223
1223
  "type": "array",
1224
- "ontology": "crm:P108 has produced"
1224
+ "ontology": "reo:produced"
1225
1225
  },
1226
1226
  "purpose": {
1227
1227
  "$ref": "#/definitions/ModificationPurpose",
@@ -1566,22 +1566,6 @@
1566
1566
  "description": "The type discriminator for this object.",
1567
1567
  "type": "string",
1568
1568
  "ontology": "rdf:type"
1569
- },
1570
- "bears": {
1571
- "type": "array",
1572
- "items": {
1573
- "type": "object",
1574
- "properties": {
1575
- "@id": {
1576
- "type": "string"
1577
- }
1578
- },
1579
- "required": [
1580
- "@id"
1581
- ]
1582
- },
1583
- "description": "The features the patch bears. Derived on export.",
1584
- "ontology": "crm:P56 bears feature"
1585
1569
  }
1586
1570
  },
1587
1571
  "required": [
@@ -1682,17 +1666,10 @@
1682
1666
  "description": "A free-text description of the condition, providing details beyond the type classification.",
1683
1667
  "type": "string",
1684
1668
  "ontology": "crm:P3 has note"
1685
- },
1686
- "@type": {
1687
- "const": "ConditionState",
1688
- "description": "The type discriminator for this object.",
1689
- "type": "string",
1690
- "ontology": "rdf:type"
1691
1669
  }
1692
1670
  },
1693
1671
  "required": [
1694
- "conditionType",
1695
- "@type"
1672
+ "conditionType"
1696
1673
  ],
1697
1674
  "type": "object"
1698
1675
  },
@@ -1732,18 +1709,11 @@
1732
1709
  "description": "The stretch factor, e.g. 1.02 means the paper has stretched by 2% compared to its original dimensions.",
1733
1710
  "type": "number",
1734
1711
  "ontology": "rdf:value"
1735
- },
1736
- "@type": {
1737
- "const": "ConditionState",
1738
- "description": "The type discriminator for this object.",
1739
- "type": "string",
1740
- "ontology": "rdf:type"
1741
1712
  }
1742
1713
  },
1743
1714
  "required": [
1744
1715
  "conditionType",
1745
- "factor",
1746
- "@type"
1716
+ "factor"
1747
1717
  ],
1748
1718
  "type": "object"
1749
1719
  }
@@ -1986,17 +1956,10 @@
1986
1956
  "description": "A free-text description of the condition, providing details beyond the type classification.",
1987
1957
  "type": "string",
1988
1958
  "ontology": "crm:P3 has note"
1989
- },
1990
- "@type": {
1991
- "const": "ConditionState",
1992
- "description": "The type discriminator for this object.",
1993
- "type": "string",
1994
- "ontology": "rdf:type"
1995
1959
  }
1996
1960
  },
1997
1961
  "required": [
1998
- "conditionType",
1999
- "@type"
1962
+ "conditionType"
2000
1963
  ],
2001
1964
  "type": "object"
2002
1965
  },
@@ -2035,17 +1998,10 @@
2035
1998
  "description": "A free-text description of the condition, providing details beyond the type classification.",
2036
1999
  "type": "string",
2037
2000
  "ontology": "crm:P3 has note"
2038
- },
2039
- "@type": {
2040
- "const": "ConditionState",
2041
- "description": "The type discriminator for this object.",
2042
- "type": "string",
2043
- "ontology": "rdf:type"
2044
2001
  }
2045
2002
  },
2046
2003
  "required": [
2047
- "conditionType",
2048
- "@type"
2004
+ "conditionType"
2049
2005
  ],
2050
2006
  "type": "object"
2051
2007
  },
@@ -2081,17 +2037,10 @@
2081
2037
  "description": "A free-text description of the condition, providing details beyond the type classification.",
2082
2038
  "type": "string",
2083
2039
  "ontology": "crm:P3 has note"
2084
- },
2085
- "@type": {
2086
- "const": "ConditionState",
2087
- "description": "The type discriminator for this object.",
2088
- "type": "string",
2089
- "ontology": "rdf:type"
2090
2040
  }
2091
2041
  },
2092
2042
  "required": [
2093
- "conditionType",
2094
- "@type"
2043
+ "conditionType"
2095
2044
  ],
2096
2045
  "type": "object"
2097
2046
  },
@@ -2127,17 +2076,10 @@
2127
2076
  "description": "A free-text description of the condition, providing details beyond the type classification.",
2128
2077
  "type": "string",
2129
2078
  "ontology": "crm:P3 has note"
2130
- },
2131
- "@type": {
2132
- "const": "ConditionState",
2133
- "description": "The type discriminator for this object.",
2134
- "type": "string",
2135
- "ontology": "rdf:type"
2136
2079
  }
2137
2080
  },
2138
2081
  "required": [
2139
- "conditionType",
2140
- "@type"
2082
+ "conditionType"
2141
2083
  ],
2142
2084
  "type": "object"
2143
2085
  },
@@ -2176,17 +2118,10 @@
2176
2118
  "description": "A free-text description of the condition, providing details beyond the type classification.",
2177
2119
  "type": "string",
2178
2120
  "ontology": "crm:P3 has note"
2179
- },
2180
- "@type": {
2181
- "const": "ConditionState",
2182
- "description": "The type discriminator for this object.",
2183
- "type": "string",
2184
- "ontology": "rdf:type"
2185
2121
  }
2186
2122
  },
2187
2123
  "required": [
2188
- "conditionType",
2189
- "@type"
2124
+ "conditionType"
2190
2125
  ],
2191
2126
  "type": "object"
2192
2127
  },
@@ -2650,22 +2585,6 @@
2650
2585
  "description": "The type discriminator for this object.",
2651
2586
  "type": "string",
2652
2587
  "ontology": "rdf:type"
2653
- },
2654
- "bears": {
2655
- "type": "array",
2656
- "items": {
2657
- "type": "object",
2658
- "properties": {
2659
- "@id": {
2660
- "type": "string"
2661
- }
2662
- },
2663
- "required": [
2664
- "@id"
2665
- ]
2666
- },
2667
- "description": "The features the patch bears. Derived on export.",
2668
- "ontology": "crm:P56 bears feature"
2669
2588
  }
2670
2589
  },
2671
2590
  "required": [
@@ -2734,17 +2653,10 @@
2734
2653
  "$ref": "#/definitions/ObjectAssumption%3CMeasure%3C%22mm%22%3E%3E",
2735
2654
  "description": "The diameter of the round punch. Taken across the roll, it is the one value of the setting that neither the scale along the roll nor the shrinkage of the paper enters.",
2736
2655
  "ontology": "reo:punchDiameter"
2737
- },
2738
- "@type": {
2739
- "const": "ConditionState",
2740
- "description": "The type discriminator for this object.",
2741
- "type": "string",
2742
- "ontology": "rdf:type"
2743
2656
  }
2744
2657
  },
2745
2658
  "required": [
2746
- "conditionType",
2747
- "@type"
2659
+ "conditionType"
2748
2660
  ],
2749
2661
  "type": "object",
2750
2662
  "ontology": "crm:E3 Condition State"
@@ -2813,7 +2725,7 @@
2813
2725
  "$ref": "#/definitions/AnyFeature"
2814
2726
  },
2815
2727
  "type": "array",
2816
- "ontology": "crm:P108 has produced"
2728
+ "ontology": "reo:produced"
2817
2729
  },
2818
2730
  "speed": {
2819
2731
  "$ref": "#/definitions/ObjectAssumption%3CPaperSpeed%3E",
@@ -3111,18 +3023,6 @@
3111
3023
  "type": "array",
3112
3024
  "ontology": "crm:P31i was modified by"
3113
3025
  },
3114
- "ops": {
3115
- "description": "A list of operations that have been applied to this copy's features (e.g. 'shifted', 'stretched') to normalize measurements for comparison with other copies. Not exported to RDF.",
3116
- "items": {
3117
- "enum": [
3118
- "shifted",
3119
- "stretched",
3120
- "shortened"
3121
- ],
3122
- "type": "string"
3123
- },
3124
- "type": "array"
3125
- },
3126
3026
  "production": {
3127
3027
  "$ref": "#/definitions/ProductionEvent",
3128
3028
  "description": "The production event that created this roll copy.",
@@ -3152,38 +3052,6 @@
3152
3052
  "description": "The type discriminator for this object.",
3153
3053
  "type": "string",
3154
3054
  "ontology": "rdf:type"
3155
- },
3156
- "bears": {
3157
- "type": "array",
3158
- "items": {
3159
- "type": "object",
3160
- "properties": {
3161
- "@id": {
3162
- "type": "string"
3163
- }
3164
- },
3165
- "required": [
3166
- "@id"
3167
- ]
3168
- },
3169
- "description": "The features the copy bears, whichever of its acts brought them about. Derived on export.",
3170
- "ontology": "crm:P56 bears feature"
3171
- },
3172
- "composedOf": {
3173
- "type": "array",
3174
- "items": {
3175
- "type": "object",
3176
- "properties": {
3177
- "@id": {
3178
- "type": "string"
3179
- }
3180
- },
3181
- "required": [
3182
- "@id"
3183
- ]
3184
- },
3185
- "description": "The patches glued onto the copy. A patch is an object rather than a feature, so it is stated as a part. Derived on export.",
3186
- "ontology": "crm:P46 is composed of"
3187
3055
  }
3188
3056
  },
3189
3057
  "required": [
@@ -3191,7 +3059,6 @@
3191
3059
  "@id",
3192
3060
  "measurements",
3193
3061
  "modifications",
3194
- "ops",
3195
3062
  "@type"
3196
3063
  ],
3197
3064
  "type": "object",
@@ -3361,19 +3228,12 @@
3361
3228
  "@id": {
3362
3229
  "description": "A unique identifier for this object.",
3363
3230
  "type": "string"
3364
- },
3365
- "@type": {
3366
- "const": "Version",
3367
- "description": "The type discriminator for this object.",
3368
- "type": "string",
3369
- "ontology": "rdf:type"
3370
3231
  }
3371
3232
  },
3372
3233
  "required": [
3373
3234
  "@id",
3374
3235
  "motivations",
3375
- "system",
3376
- "@type"
3236
+ "system"
3377
3237
  ],
3378
3238
  "type": "object",
3379
3239
  "ontology": "lrmoo:F2 Expression"
@@ -11,8 +11,6 @@
11
11
  "crminf": "http://www.cidoc-crm.org/extensions/crminf/",
12
12
  "lrmoo": "http://iflastandards.info/ns/lrm/lrmoo/",
13
13
  "reo": "https://w3id.org/reo/",
14
- "Edition": "lrmoo:F2_Expression",
15
- "Version": "lrmoo:F2_Expression",
16
14
  "RollCopy": "reo:RollCopy",
17
15
  "HoleChain": "reo:HoleChain",
18
16
  "Mark": "reo:Mark",
@@ -22,7 +20,6 @@
22
20
  "Removal": "crm:E80_Part_Removal",
23
21
  "Alteration": "crm:E12_Production",
24
22
  "Perforator": "crm:E22_Human-Made_Object",
25
- "ConditionState": "crm:E3_Condition_State",
26
23
  "note": "reo:Note",
27
24
  "expression": "reo:Expression",
28
25
  "text": {
@@ -92,6 +89,7 @@
92
89
  "@type": "xsd:date"
93
90
  },
94
91
  "collationTolerance": null,
92
+ "formatVersion": null,
95
93
  "annotation": null,
96
94
  "roll": "lrmoo:R3i_realises",
97
95
  "catalogueNumber": "dcterms:identifier",
@@ -280,7 +278,7 @@
280
278
  }
281
279
  },
282
280
  "actor": "crm:P14_carried_out_by",
283
- "produced": "crm:P108_has_produced",
281
+ "produced": "reo:produced",
284
282
  "added": "crm:P111_added",
285
283
  "removed": {
286
284
  "@id": "crm:P113_removed",
@@ -291,14 +289,6 @@
291
289
  "@type": "@vocab",
292
290
  "@context": { "@vocab": "https://w3id.org/reo/type/" }
293
291
  },
294
- "bears": {
295
- "@id": "crm:P56_bears_feature",
296
- "@type": "@id"
297
- },
298
- "composedOf": {
299
- "@id": "crm:P46_is_composed_of",
300
- "@type": "@id"
301
- },
302
292
  "augmented": {
303
293
  "@id": "crm:P110_augmented",
304
294
  "@type": "@id"
@@ -1,7 +1,7 @@
1
- import { HoleChain } from "./Feature.js";
2
- import { Expression, Note } from "./Symbol.js";
1
+ import { HoleChain } from "../model/Feature.js";
2
+ import { Expression, Note } from "../model/Symbol.js";
3
3
  import { TrackerBar } from "./TrackerBar.js";
4
- import { Millimeters, Quantity, Seconds } from "./Quantity.js";
4
+ import { Millimeters, Quantity, Seconds } from "../model/Quantity.js";
5
5
  export type SpeedUnit = 'ft/min' | 'm/min';
6
6
  /**
7
7
  * The playback tempo of the roll as a paper speed, stated at the
@@ -1,6 +1,6 @@
1
- import type { Concept } from "./Agent.js";
2
- import { Expression, Note } from "./Symbol.js";
3
- import { Millimeters, SpeedMeasure, Track } from "./Quantity.js";
1
+ import type { Concept } from "../model/Agent.js";
2
+ import { Expression, Note } from "../model/Symbol.js";
3
+ import { Millimeters, SpeedMeasure, Track } from "../model/Quantity.js";
4
4
  /**
5
5
  * What a tracker bar position does: sound a note, or operate one of
6
6
  * the expression valves on the bass or the treble side.
@@ -15,6 +15,27 @@ export interface TrackArea {
15
15
  readonly from: Track;
16
16
  readonly to: Track;
17
17
  }
18
+ /**
19
+ * How a scale words a function: as a command that turns it on, one that
20
+ * cancels it, or one that holds it for as long as it lasts.
21
+ */
22
+ export type Spelling = 'on' | 'off' | 'held';
23
+ /**
24
+ * What a word of a scale operates, rather than the word itself, so that
25
+ * two scales can be compared at all.
26
+ */
27
+ export interface Operation {
28
+ /** The function operated, named the same wherever a scale has it. */
29
+ operates: string;
30
+ spelling: Spelling;
31
+ /**
32
+ * Whether the half of the keyboard the valve serves is part of the
33
+ * function operated. The dynamics are per half; the pedals are not,
34
+ * and the two Welte scales put them on opposite edges of the paper,
35
+ * so a rule that compared sides would leave every pedal unpaired.
36
+ */
37
+ sided: boolean;
38
+ }
18
39
  export type NoteMeaning = Pick<Note, 'type' | 'pitch'>;
19
40
  export type ExpressionMeaning = Pick<Expression, 'type' | 'expressionType' | 'scope'>;
20
41
  export type TrackMeaning = NoteMeaning | ExpressionMeaning;
@@ -44,6 +65,12 @@ export interface TrackerBar {
44
65
  readonly areas: readonly TrackArea[];
45
66
  /** The expression types the bar reads, each a term of the system. */
46
67
  readonly expressionTypes: readonly string[];
68
+ /**
69
+ * How the system spells a single added accent, each spelling a
70
+ * sequence of its expression types: a latched system turns a valve on
71
+ * and off again, a held one holds one perforation for the accent.
72
+ */
73
+ readonly accents: readonly (readonly string[])[];
47
74
  /**
48
75
  * The position carrying the rewind perforation, which runs at
49
76
  * the very end of a roll and is the usual landmark for calibrating
@@ -90,6 +117,11 @@ export interface TrackerBar {
90
117
  positionOf(meaning: TrackMeaning): Track | undefined;
91
118
  /** `undefined` for a position the bar does not read; snapped as `meaningOf` is. */
92
119
  roleOf(position: Track): TrackRole | undefined;
120
+ /**
121
+ * What the expression type operates, or `undefined` for one the bar
122
+ * does not read or whose function has no counterpart in another scale.
123
+ */
124
+ operationOf(expressionType: string): Operation | undefined;
93
125
  /** The positions a feature lies across, snapped to the grid. */
94
126
  positionsIn(span: OnBar): readonly Track[];
95
127
  }
@@ -105,11 +137,6 @@ export declare const systemOf: (bar: TrackerBar) => Concept;
105
137
  export declare const systemIdIn: (id: string | undefined) => string | undefined;
106
138
  /** The identifier of a system the type vocabulary knows, from its concept. */
107
139
  export declare const systemIdOf: (system: Concept | undefined) => string | undefined;
108
- /**
109
- * A tracker bar as written down, with its positions as plain numbers
110
- * in the bar's own 1-based numbering; `describeTrackerBar` gives them
111
- * their type.
112
- */
113
140
  /**
114
141
  * Where a roll's own content ends, as far as its perforations say.
115
142
  *
@@ -141,6 +168,11 @@ export type OnBar = {
141
168
  readonly from: Track;
142
169
  readonly to?: Track;
143
170
  };
171
+ /**
172
+ * A tracker bar as written down, with its positions as plain numbers
173
+ * in the bar's own 1-based numbering; `describeTrackerBar` gives them
174
+ * their type.
175
+ */
144
176
  export interface TrackerBarSpec {
145
177
  id: string;
146
178
  name: string;
@@ -170,6 +202,14 @@ export interface TrackerBarSpec {
170
202
  * its own needs no threshold, since anything there is the rewind.
171
203
  */
172
204
  rewindHold?: Millimeters;
205
+ /**
206
+ * What each expression type operates, keyed by type. A type left out
207
+ * operates a function no other scale has a word for, and a transfer
208
+ * leaves it a plain deletion.
209
+ */
210
+ operations?: Readonly<Record<string, Operation>>;
211
+ /** How the system spells a single added accent; see `TrackerBar.accents`. */
212
+ accents?: readonly (readonly string[])[];
173
213
  }
174
214
  export declare const describeTrackerBar: (spec: TrackerBarSpec) => TrackerBar;
175
215
  /**
@@ -1,4 +1,4 @@
1
- import { mm, track } from "./Quantity.js";
1
+ import { mm, track } from "../model/Quantity.js";
2
2
  /**
3
3
  * What a position says, as a key. Two bars read the same thing exactly
4
4
  * where their keys agree, which is what lets a symbol cross from one
@@ -66,6 +66,13 @@ export const describeTrackerBar = (spec) => {
66
66
  if (rewind === undefined) {
67
67
  throw new Error(`${spec.name} declares no rewind track`);
68
68
  }
69
+ const expressionTypes = [...new Set(spec.expressions.values())];
70
+ const operations = spec.operations ?? {};
71
+ const accents = spec.accents ?? [];
72
+ const unread = [...Object.keys(operations), ...accents.flat()].filter(type => !expressionTypes.includes(type));
73
+ if (unread.length > 0) {
74
+ throw new Error(`${spec.name} names expression types its bar does not read: ${[...new Set(unread)].join(', ')}`);
75
+ }
69
76
  // A rewind on a line of its own is unambiguous; one sharing a line is only
70
77
  // the rewind when it is far longer than that line's usual command.
71
78
  const shared = spec.rewindTrack !== undefined;
@@ -84,13 +91,15 @@ export const describeTrackerBar = (spec) => {
84
91
  trackCount: spec.trackCount,
85
92
  endsAt,
86
93
  areas,
87
- expressionTypes: [...new Set(spec.expressions.values())],
94
+ expressionTypes,
95
+ accents,
88
96
  rewindTrack: track(rewind),
89
97
  ...(spec.paperSpeed && { paperSpeed: spec.paperSpeed }),
90
98
  meaningOf,
91
99
  meaningsOf,
92
100
  positionOf: meaning => positions.get(keyOf(meaning)),
93
101
  roleOf,
102
+ operationOf: expressionType => Object.hasOwn(operations, expressionType) ? operations[expressionType] : undefined,
94
103
  positionsIn: positionsBetween
95
104
  };
96
105
  };
@@ -1,6 +1,12 @@
1
- import { Concept } from "../Agent.js";
2
- import { TrackerBar } from "../TrackerBar.js";
1
+ import { Concept } from "../model/Agent.js";
2
+ import { TrackerBar } from "./TrackerBar.js";
3
3
  /** The tracker bars the library knows, the T-100 first as the usual one. */
4
4
  export declare const trackerBars: readonly TrackerBar[];
5
5
  /** The bar of a system the type vocabulary knows, from its concept. */
6
6
  export declare const trackerBarOf: (system: Concept | undefined) => TrackerBar | undefined;
7
+ /**
8
+ * The bar a copy is read by where it names no system of its own: every
9
+ * copy was read by the T-100's before the systems were told apart, and
10
+ * `reservationsAbout` reports a copy that still relies on this.
11
+ */
12
+ export declare const defaultTrackerBar: TrackerBar;
@@ -1,4 +1,4 @@
1
- import { systemIdOf } from "../TrackerBar.js";
1
+ import { systemIdOf } from "./TrackerBar.js";
2
2
  import { welteT100 } from "./welteT100/bar.js";
3
3
  import { welteLicensee } from "./welteLicensee/bar.js";
4
4
  import { welteT98 } from "./welteT98/bar.js";
@@ -9,3 +9,9 @@ export const trackerBarOf = (system) => {
9
9
  const id = systemIdOf(system);
10
10
  return trackerBars.find(bar => bar.id === id);
11
11
  };
12
+ /**
13
+ * The bar a copy is read by where it names no system of its own: every
14
+ * copy was read by the T-100's before the systems were told apart, and
15
+ * `reservationsAbout` reports a copy that still relies on this.
16
+ */
17
+ export const defaultTrackerBar = welteT100;
@@ -0,0 +1,100 @@
1
+ import { Grid, Half, Model, ModelInput, Parameters, PedalInput, PedalMode, PedalTravel, PortGeometry, Spool } from "welte-mignon-emulator";
2
+ import { Expression } from "../model/Symbol.js";
3
+ import { NegotiatedEvent, Performance, RollProperties } from "./ReproducingSystem.js";
4
+ import { Millimeters, Seconds, Track } from "../model/Quantity.js";
5
+ import { type VelocityMap } from "./velocity.js";
6
+ /**
7
+ * What the Welte systems share downstream of the relay. Hagmann has the
8
+ * nuancing unit built the same for both tracker scales (p. 96) and the valves
9
+ * and bellows that move the pedals the same in both (p. 106), so the way a
10
+ * performance is read off the emulator is one; what differs is in front of it,
11
+ * and each system says that in the `Mechanism` it hands to `performWelte`.
12
+ */
13
+ /** The options every Welte system takes. */
14
+ export type WelteOptions = {
15
+ /**
16
+ * The take-up spool, which sets the time axis: it is held at a constant
17
+ * rate of revolution, so the paper runs faster as the spool fills.
18
+ */
19
+ spool: Spool;
20
+ /** Constants of the nuancing mechanism, one set for each half of the keyboard. */
21
+ nuance: Record<Half, Parameters>;
22
+ /** Constants of the two pedal actions, one of `pedalPresets` or a set of one's own. */
23
+ pedals: Parameters;
24
+ velocity: VelocityMap;
25
+ /**
26
+ * How the pedals go out: as a continuous controller carrying the travel
27
+ * of the bellows, or thresholded to the two values a switching renderer
28
+ * understands.
29
+ */
30
+ pedalMode: PedalMode;
31
+ /** Diameter of the tracker-bar bore. */
32
+ trackerBore: Millimeters;
33
+ /** Punch diameter for an edition whose copies record none. */
34
+ punchDiameter: Millimeters;
35
+ /**
36
+ * The track at which the keyboard is divided, so that notes from here
37
+ * upwards follow the treble expression and the ones below it the bass.
38
+ * Which side an expression perforation itself belongs to is not decided
39
+ * here but read off the tracker bar.
40
+ */
41
+ division: Track;
42
+ };
43
+ /** Whether two sets of constants are the same, value for value. */
44
+ export declare const sameParameters: (a: Parameters, b: Parameters) => boolean;
45
+ /**
46
+ * Between the edition's shared place axis and this version's own paper.
47
+ * `toOwnPaper` is 1 for a version on the axis it was measured on, and about
48
+ * 0.775 for a green version whose places are in the red axis; see
49
+ * `RollProperties`.
50
+ *
51
+ * Rows are rows of the version's own paper, so the spool is asked in
52
+ * `paperOfRow` and never in `placeOfRow`: one is the paper that passes the
53
+ * tracker bar, the other is the coordinate the edition states.
54
+ */
55
+ export type Paper = {
56
+ readonly rowOf: (place: Millimeters) => number;
57
+ readonly placeOfRow: (row: number) => Millimeters;
58
+ readonly paperOfRow: (row: number) => Millimeters;
59
+ };
60
+ /** When the spool brings a place on the roll to the tracker bar. */
61
+ export declare const secondsAt: (spool: Spool, place: Millimeters) => Seconds;
62
+ /** A perforation as the emulator reads it: the control it operates and the rows it spans. */
63
+ export type WeltePunch = {
64
+ readonly half: Half;
65
+ readonly control: string;
66
+ readonly rowOn: number;
67
+ readonly rowOff: number;
68
+ };
69
+ export type Ports = ModelInput['ports'];
70
+ /**
71
+ * What a Welte system puts in front of the shared nuancing unit and pedals:
72
+ * how it reads a perforation, how it opens the ports, which pneumatic model
73
+ * drives the bellows, and which the pedals.
74
+ */
75
+ export type Mechanism<P extends WeltePunch> = {
76
+ /** The punch the expression is read as, or nothing for one the mechanism does not read. */
77
+ readonly punchOf: (event: NegotiatedEvent & Expression, rows: {
78
+ rowOn: number;
79
+ rowOff: number;
80
+ }) => P | undefined;
81
+ readonly portsOf: (grid: Grid, punches: readonly P[], geometry: PortGeometry) => Ports;
82
+ readonly model: Model;
83
+ readonly runPedals: (input: PedalInput, params: Parameters) => PedalTravel;
84
+ /** The name of the instrument the curves say they came from. */
85
+ readonly instrument: string;
86
+ };
87
+ /** A performance, with the grid and ports it was read off, for a system that has more to ask of them. */
88
+ export type WeltePerformance = Performance & {
89
+ readonly grid: Grid;
90
+ readonly ports: Ports;
91
+ };
92
+ /**
93
+ * Plays the events on a Welte mechanism: notes at the velocity of their half's
94
+ * bellows, and the two pedals as the travel of theirs.
95
+ *
96
+ * The edition's tempo adjustment is left aside: it is stated as a paper
97
+ * speed, and what the spool holds constant is its rate of revolution, so
98
+ * the two are not the same quantity. The spool in the options sets the speed.
99
+ */
100
+ export declare const performWelte: <P extends WeltePunch>(events: readonly NegotiatedEvent[], options: WelteOptions, roll: RollProperties, mechanism: Mechanism<P>) => WeltePerformance;