linked-rolls 0.5.1 → 0.6.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 CHANGED
@@ -49,10 +49,13 @@ take-up spool sets the time axis, the Nuancierbälge fill through their
49
49
  conduits and are arrested by the Mezzoforte pin, and the two pedals travel
50
50
  rather than switch. The constants are those fitted against the hand-drawn
51
51
  nuance lines of roll 3309, with the terms that describe the drawing
52
- apparatus switched off. What the emulator does not determine is how
53
- bellows travel maps onto MIDI velocity; `WelteT100Options.velocity`
54
- anchors that map at the open rail, the Mezzoforte pin and the closed rail,
55
- and its defaults are midi2exp's.
52
+ apparatus switched off. The pedals leave no drawn line, so their constants
53
+ come as two readings, `pedalPresets.damping`, under which every lift the
54
+ rolls punch damps, and `pedalPresets.brushing`, under which the quick runs
55
+ of latch changes brush the strings without damping. What the emulator does
56
+ not determine is how bellows travel maps onto MIDI velocity;
57
+ `WelteT100Options.velocity` anchors that map at the open rail, the
58
+ Mezzoforte pin and the closed rail, and its defaults are midi2exp's.
56
59
 
57
60
  ```ts
58
61
  import { Emulation } from 'linked-rolls'
package/lib/Feature.d.ts CHANGED
@@ -116,6 +116,8 @@ export declare const writingMethods: readonly ["Print", "Handwriting", "Stamp"];
116
116
  * printed, handwritten, or stamped.
117
117
  */
118
118
  export type WritingMethod = typeof writingMethods[number];
119
+ /** The text a writing carries. It names no carriers of its own, the writing being its carrier. */
120
+ export type Transcription = Omit<Text, 'carriers'>;
119
121
  /**
120
122
  * A piece of writing found on the roll, such as a label,
121
123
  * catalogue number, or annotation. Writings have a method
@@ -135,7 +137,7 @@ export interface Writing extends Trace<'Writing'> {
135
137
  * can be annotated with a belief about its correctness.
136
138
  * @see crm:P128 carries
137
139
  */
138
- transcription: ObjectAssumption<Omit<Text, 'carriers'>>;
140
+ transcription: ObjectAssumption<Transcription>;
139
141
  }
140
142
  /**
141
143
  * A visible mark on the roll, such as a pencil mark,
package/lib/schema.json CHANGED
@@ -1189,7 +1189,7 @@
1189
1189
  ],
1190
1190
  "type": "object"
1191
1191
  },
1192
- "ObjectAssumption<alias-731470504-73739-73887-731470504-0-217694<def-interface-src_Symbol.ts-5758-6122-src_Symbol.ts-0-6378400334313,\"carriers\">>": {
1192
+ "ObjectAssumption<Transcription>": {
1193
1193
  "description": "An object assumption wraps a complex object with an optional annotation. Used for structured values (e.g. persons, conditions) whose properties may be uncertain.",
1194
1194
  "properties": {
1195
1195
  "@annotation": {
@@ -1760,7 +1760,7 @@
1760
1760
  "description": "The method by which this writing was produced (e.g. through print, handwriting, or stamping). [ontology: crm:P2 has type]"
1761
1761
  },
1762
1762
  "transcription": {
1763
- "$ref": "#/definitions/ObjectAssumption%3Calias-731470504-73739-73887-731470504-0-217694%3Cdef-interface-src_Symbol.ts-5758-6122-src_Symbol.ts-0-6378400334313%2C%22carriers%22%3E%3E",
1763
+ "$ref": "#/definitions/ObjectAssumption%3CTranscription%3E",
1764
1764
  "description": "A transcription of the text content of the writing. This is an object assumption so that the transcription can be annotated with a belief about its correctness. [ontology: crm:P128 carries]"
1765
1765
  },
1766
1766
  "vertical": {
@@ -12,6 +12,21 @@ export type VelocityMap = {
12
12
  mezzoforte: number;
13
13
  forte: number;
14
14
  };
15
+ /**
16
+ * The two readings of the pedal mechanism the emulator offers, by name.
17
+ * Under `damping` the dampers reach the strings within the shortest lift
18
+ * the rolls punch, so every lift damps. Under `brushing` their fall is
19
+ * slowed until the quick runs of latch changes in the SUPRA corpus dip
20
+ * without damping, at the price that lifts shorter than about 265 ms brush
21
+ * as well.
22
+ */
23
+ export declare const pedalPresets: {
24
+ damping: Readonly<Record<string, number>>;
25
+ brushing: Readonly<Record<string, number>>;
26
+ };
27
+ export type PedalPreset = keyof typeof pedalPresets;
28
+ /** The preset a set of pedal constants is, if it is one. */
29
+ export declare const pedalPresetOf: (pedals: Parameters) => PedalPreset | undefined;
15
30
  export type WelteT100Options = {
16
31
  /**
17
32
  * The take-up spool, which sets the time axis: it is held at a constant
@@ -20,7 +35,7 @@ export type WelteT100Options = {
20
35
  spool: Spool;
21
36
  /** Constants of the nuancing mechanism, one set for each half of the keyboard. */
22
37
  nuance: Record<Half, Parameters>;
23
- /** Constants of the two pedal actions. */
38
+ /** Constants of the two pedal actions, one of `pedalPresets` or a set of one's own. */
24
39
  pedals: Parameters;
25
40
  velocity: VelocityMap;
26
41
  /**
@@ -1,12 +1,28 @@
1
- import { aperturePorts, DEFAULT_PUNCH_MM, geometryInMm, Grid, levelChanges, mezzoforteTravel, paperSeconds, pedalDefaults, playbackParameters, pneumaticModel, ROWS_PER_MM, runPedals, TRACKER_BORE_MM, travelBetweenRails, WELTE_SPOOL, } from "welte-t100-emulator";
1
+ import { aperturePorts, DEFAULT_PUNCH_MM, geometryInMm, Grid, levelChanges, mezzoforteTravel, paperSeconds, pedalBrushing, pedalDefaults, playbackParameters, pneumaticModel, ROWS_PER_MM, runPedals, TRACKER_BORE_MM, travelBetweenRails, WELTE_SPOOL, } from "welte-t100-emulator";
2
2
  import { welteT100 } from "./bar";
3
+ /**
4
+ * The two readings of the pedal mechanism the emulator offers, by name.
5
+ * Under `damping` the dampers reach the strings within the shortest lift
6
+ * the rolls punch, so every lift damps. Under `brushing` their fall is
7
+ * slowed until the quick runs of latch changes in the SUPRA corpus dip
8
+ * without damping, at the price that lifts shorter than about 265 ms brush
9
+ * as well.
10
+ */
11
+ export const pedalPresets = {
12
+ damping: pedalDefaults,
13
+ brushing: pedalBrushing
14
+ };
15
+ const sameParameters = (a, b) => Object.keys(a).length === Object.keys(b).length
16
+ && Object.entries(a).every(([name, value]) => b[name] === value);
17
+ /** The preset a set of pedal constants is, if it is one. */
18
+ export const pedalPresetOf = (pedals) => Object.keys(pedalPresets).find(name => sameParameters(pedalPresets[name], pedals));
3
19
  export const defaultWelteT100Options = {
4
20
  spool: WELTE_SPOOL,
5
21
  nuance: {
6
22
  bass: playbackParameters('bass'),
7
23
  treble: playbackParameters('treble')
8
24
  },
9
- pedals: pedalDefaults,
25
+ pedals: pedalPresets.damping,
10
26
  velocity: { piano: 35, mezzoforte: 60, forte: 90 },
11
27
  pedalMode: 'continuous',
12
28
  trackerBore: TRACKER_BORE_MM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linked-rolls",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Digital editions of piano rolls: import, collation, editorial assumptions, JSON-LD export, and emulation through a reproducing system",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "welte-t100-emulator": "file:../welte-t100"
42
42
  },
43
43
  "peerDependencies": {
44
- "welte-t100-emulator": "^0.3.0"
44
+ "welte-t100-emulator": "^0.4.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "welte-t100-emulator": {