linked-rolls 0.0.1 → 0.1.1
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 +48 -1
- package/lib/Assumption.d.ts +124 -0
- package/lib/Assumption.js +34 -0
- package/lib/Collation.d.ts +11 -0
- package/lib/ConditionState.d.ts +8 -3
- package/lib/ConditionState.js +0 -5
- package/lib/Edit.d.ts +44 -14
- package/lib/Edit.js +2 -95
- package/lib/Edition.d.ts +144 -4
- package/lib/EditionView.d.ts +51 -0
- package/lib/EditionView.js +294 -0
- package/lib/Emulation.d.ts +21 -68
- package/lib/Emulation.js +94 -386
- package/lib/Feature.d.ts +137 -16
- package/lib/Feature.js +9 -1
- package/lib/Plan.d.ts +190 -0
- package/lib/Plan.js +555 -0
- package/lib/ReproducingSystem.d.ts +80 -0
- package/lib/RollCopy.d.ts +265 -24
- package/lib/RollCopy.js +276 -215
- package/lib/Symbol.d.ts +70 -37
- package/lib/Symbol.js +2 -27
- package/lib/TrackCalibration.d.ts +33 -0
- package/lib/TrackCalibration.js +14 -0
- package/lib/TrackerBar.d.ts +52 -5
- package/lib/TrackerBar.js +70 -49
- package/lib/Version.d.ts +32 -33
- package/lib/Version.js +3 -209
- package/lib/alignFeatures.d.ts +3 -2
- package/lib/alignFeatures.js +5 -4
- package/lib/asJsonLd.d.ts +1 -1
- package/lib/asJsonLd.js +13 -26
- package/lib/importJsonLd.d.ts +0 -1
- package/lib/importJsonLd.js +9 -72
- package/lib/index.d.ts +7 -3
- package/lib/index.js +7 -3
- package/lib/schema.json +1739 -0
- package/lib/spec/context.json +125 -144
- package/lib/systems/welteT100.d.ts +55 -0
- package/lib/systems/welteT100.js +191 -0
- package/lib/utils.d.ts +29 -0
- package/lib/validate.d.ts +3 -0
- package/lib/validate.js +10 -0
- package/package.json +41 -8
- package/lib/Condition.d.ts +0 -10
- package/lib/EditorialAssumption.d.ts +0 -67
- package/lib/EditorialAssumption.js +0 -26
- package/lib/Measurement.d.ts +0 -9
- package/lib/PlaceTimeConversion.d.ts +0 -65
- package/lib/PlaceTimeConversion.js +0 -175
- package/lib/RollEvent.d.ts +0 -76
- package/lib/RollEvent.js +0 -3
- package/lib/Stage.d.ts +0 -37
- package/lib/Stage.js +0 -165
- package/lib/Transcription.d.ts +0 -7
- package/lib/Transcription.js +0 -9
- package/lib/WithId.d.ts +0 -3
- package/lib/WithId.js +0 -1
- package/lib/alignRolls.d.ts +0 -7
- package/lib/alignRolls.js +0 -49
- package/lib/alignSymbols.d.ts +0 -7
- package/lib/alignSymbols.js +0 -49
- package/lib/aton/AtonParser.test.d.ts +0 -1
- package/lib/aton/AtonParser.test.js +0 -16
- package/lib/build-schema.cjs +0 -113
- /package/lib/{Condition.js → ReproducingSystem.js} +0 -0
- /package/lib/{Measurement.js → utils.js} +0 -0
package/package.json
CHANGED
|
@@ -1,25 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linked-rolls",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Digital editions of piano rolls: import, collation, editorial assumptions, JSON-LD export, and emulation through a reproducing system",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/pfefferniels/linked-rolls.git"
|
|
8
|
+
},
|
|
4
9
|
"type": "module",
|
|
5
10
|
"main": "lib/index.js",
|
|
6
11
|
"types": "lib/index.d.ts",
|
|
7
|
-
"
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
15
|
+
"default": "./lib/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./welte-t100": {
|
|
18
|
+
"types": "./lib/systems/welteT100.d.ts",
|
|
19
|
+
"default": "./lib/systems/welteT100.js"
|
|
20
|
+
},
|
|
21
|
+
"./lib/*": "./lib/*",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"lib",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
8
29
|
"scripts": {
|
|
9
|
-
"build": "tsc",
|
|
30
|
+
"build": "npm run build:schema && rm -rf lib && tsc",
|
|
31
|
+
"prepublishOnly": "npm run build && vitest run",
|
|
10
32
|
"test": "vitest",
|
|
11
|
-
"
|
|
12
|
-
"build:schema": "npm run compile:schema && node lib/build-schema.cjs"
|
|
33
|
+
"build:schema": "npx ts-json-schema-generator --additional-properties --validation-keywords see --path 'src/**/*.ts' --type 'Edition' > schema_.json && node schema/postprocess.js && rm schema_.json && mv schema.json src/schema.json"
|
|
13
34
|
},
|
|
14
35
|
"devDependencies": {
|
|
36
|
+
"@types/node": "^24.13.3",
|
|
15
37
|
"typescript": "^5.6.0-dev.20240809",
|
|
16
|
-
"vite": "^5.
|
|
17
|
-
"vitest": "^1.2.0"
|
|
38
|
+
"vite": "^5.4.20",
|
|
39
|
+
"vitest": "^1.2.0",
|
|
40
|
+
"welte-t100-emulator": "file:../roll-nuance-tracer/emulator"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"welte-t100-emulator": "*"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"welte-t100-emulator": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
18
49
|
},
|
|
19
50
|
"dependencies": {
|
|
20
51
|
"@types/uuid": "^10.0.0",
|
|
52
|
+
"ajv": "^8.17.1",
|
|
21
53
|
"aton": "^0.0.4",
|
|
22
|
-
"fast-xml-parser": "^4.4
|
|
54
|
+
"fast-xml-parser": "^4.5.4",
|
|
55
|
+
"immer": "^10.1.3",
|
|
23
56
|
"midifile-ts": "^1.5.1",
|
|
24
57
|
"ts-json-schema-generator": "^2.4.0",
|
|
25
58
|
"uuid": "^10.0.0"
|
package/lib/Condition.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WithId } from "./WithId";
|
|
2
|
-
/**
|
|
3
|
-
* Describes the physical condition of a roll or
|
|
4
|
-
* of a feature on the roll (e.g. a damaged
|
|
5
|
-
* or unsuccessful perforation).
|
|
6
|
-
*/
|
|
7
|
-
export interface ConditionState<T extends string> extends WithId {
|
|
8
|
-
type: T;
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { WithId } from "./WithId";
|
|
2
|
-
import { Person } from "./Edition";
|
|
3
|
-
export declare const certainties: readonly ["true", "likely", "possible", "unlikely", "false"];
|
|
4
|
-
export type Certainty = typeof certainties[number];
|
|
5
|
-
export type WithActor = {
|
|
6
|
-
actor?: Person;
|
|
7
|
-
};
|
|
8
|
-
export type WithNote = {
|
|
9
|
-
note?: string;
|
|
10
|
-
};
|
|
11
|
-
export interface Argumentation<T extends string = 'simpleArgumentation'> extends WithActor, WithNote {
|
|
12
|
-
type: T;
|
|
13
|
-
}
|
|
14
|
-
export interface MeaningComprehension<T> extends Argumentation<'meaningComprehension'> {
|
|
15
|
-
comprehends: T[];
|
|
16
|
-
}
|
|
17
|
-
export interface Inference extends Argumentation<'inference'> {
|
|
18
|
-
premises: Belief[];
|
|
19
|
-
}
|
|
20
|
-
export interface BeliefAdoption extends Argumentation<'beliefAdoption'> {
|
|
21
|
-
note: string;
|
|
22
|
-
}
|
|
23
|
-
export type AnyArgumentation = MeaningComprehension<any> | Inference | BeliefAdoption | Argumentation;
|
|
24
|
-
export declare function isMeaningComprehension<AboutT>(object: AnyArgumentation, aboutGuard: (x: any) => x is AboutT): object is MeaningComprehension<AboutT>;
|
|
25
|
-
export interface Belief extends WithId {
|
|
26
|
-
type: 'belief';
|
|
27
|
-
certainty: Certainty;
|
|
28
|
-
reasons: AnyArgumentation[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* An editorial assumpton is always a One-Proposition Set.
|
|
32
|
-
*/
|
|
33
|
-
export interface EditorialAssumption<Name, AssignedType> extends WithId {
|
|
34
|
-
type: Name;
|
|
35
|
-
assigned: AssignedType;
|
|
36
|
-
belief?: Belief;
|
|
37
|
-
}
|
|
38
|
-
export declare function flat<Name, Type>(assumption: EditorialAssumption<Name, Type>): Type;
|
|
39
|
-
export declare function flat<Name, Type>(assumption: EditorialAssumption<Name, Type>[]): Type[];
|
|
40
|
-
export declare function assign<Type extends string, T>(type: Type, object: T): EditorialAssumption<Type, T>;
|
|
41
|
-
export type DimensionMarker = {
|
|
42
|
-
point: 'start' | 'end';
|
|
43
|
-
of: Symbol;
|
|
44
|
-
};
|
|
45
|
-
type PlacementType = 'after' | 'before' | 'with';
|
|
46
|
-
export interface Constraint {
|
|
47
|
-
placed: DimensionMarker;
|
|
48
|
-
placement: PlacementType;
|
|
49
|
-
relativeTo: DimensionMarker | {
|
|
50
|
-
number: number;
|
|
51
|
-
unit: string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface Motivation<MotivationT> extends EditorialAssumption<'motivationAssignment', MotivationT> {
|
|
55
|
-
}
|
|
56
|
-
export declare const isMotivation: (object: any) => object is Motivation<any>;
|
|
57
|
-
export interface QuestionMaking extends WithActor {
|
|
58
|
-
premises: (Belief | Question)[];
|
|
59
|
-
raise: Question;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Modelled on IAM's Question, cf. M. Doerr et al., p. 12
|
|
63
|
-
*/
|
|
64
|
-
export interface Question {
|
|
65
|
-
question: string;
|
|
66
|
-
}
|
|
67
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { v4 } from "uuid";
|
|
2
|
-
export const certainties = [
|
|
3
|
-
'true',
|
|
4
|
-
'likely',
|
|
5
|
-
'possible',
|
|
6
|
-
'unlikely',
|
|
7
|
-
'false'
|
|
8
|
-
];
|
|
9
|
-
export function isMeaningComprehension(object, aboutGuard) {
|
|
10
|
-
return object.type === 'meaningComprehension' && object.comprehends.every(aboutGuard);
|
|
11
|
-
}
|
|
12
|
-
export function flat(assumption) {
|
|
13
|
-
return Array.isArray(assumption)
|
|
14
|
-
? assumption.map(a => a.assigned)
|
|
15
|
-
: assumption.assigned;
|
|
16
|
-
}
|
|
17
|
-
export function assign(type, object) {
|
|
18
|
-
return {
|
|
19
|
-
type,
|
|
20
|
-
id: v4(),
|
|
21
|
-
assigned: object
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export const isMotivation = (object) => {
|
|
25
|
-
return 'type' in object && object.type === 'motivationAssignment';
|
|
26
|
-
};
|
package/lib/Measurement.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export declare abstract class PlaceTimeConversion {
|
|
2
|
-
abstract get summary(): string;
|
|
3
|
-
abstract placeToTime(x1: number): number;
|
|
4
|
-
abstract timeToPlace(t1: number): number;
|
|
5
|
-
}
|
|
6
|
-
export declare class NoAccelerationConversion implements PlaceTimeConversion {
|
|
7
|
-
get summary(): string;
|
|
8
|
-
metersPerMinute: number;
|
|
9
|
-
/**
|
|
10
|
-
* Converts physical place (in cm) to time (in seconds).
|
|
11
|
-
* @param x1 - The distance in mm.
|
|
12
|
-
* @returns Time in seconds.
|
|
13
|
-
*/
|
|
14
|
-
placeToTime(cm: number): number;
|
|
15
|
-
/**
|
|
16
|
-
* Converts time (in seconds) to physical place (in cm).
|
|
17
|
-
* @param t1 - The time in seconds.
|
|
18
|
-
* @returns Distance in cm.
|
|
19
|
-
*/
|
|
20
|
-
timeToPlace(t1: number): number;
|
|
21
|
-
}
|
|
22
|
-
declare enum SpeedUnit {
|
|
23
|
-
MetersPerMinute = 0,
|
|
24
|
-
FeetPerMinute = 1
|
|
25
|
-
}
|
|
26
|
-
declare enum AccelerationUnit {
|
|
27
|
-
MillimetersPerSecondSquared = 0,
|
|
28
|
-
FeetPerMinuteSquared = 1
|
|
29
|
-
}
|
|
30
|
-
export declare class KinematicConversion implements PlaceTimeConversion {
|
|
31
|
-
get summary(): string;
|
|
32
|
-
static readonly slowSpeed = 9.46;
|
|
33
|
-
static readonly normalSpeed = 9.85;
|
|
34
|
-
static readonly stanfordAcceleration = 0.3147;
|
|
35
|
-
static readonly baertschAcceleration = 0.1772;
|
|
36
|
-
private feetPerMinute;
|
|
37
|
-
private acceleration;
|
|
38
|
-
constructor(feetPerMinute?: number, acceleration?: number);
|
|
39
|
-
setSpeed(speed: number, unit: SpeedUnit): void;
|
|
40
|
-
setAcceleration(acceleration: number, unit: AccelerationUnit): void;
|
|
41
|
-
/**
|
|
42
|
-
* Converts physical place (in cm) to time (in seconds).
|
|
43
|
-
* @param x1 - The distance in mm.
|
|
44
|
-
* @returns Time in seconds.
|
|
45
|
-
*/
|
|
46
|
-
placeToTime(cm: number): number;
|
|
47
|
-
/**
|
|
48
|
-
* Converts time (in seconds) to physical place (in cm).
|
|
49
|
-
* @param t1 - The time in seconds.
|
|
50
|
-
* @returns Distance in cm.
|
|
51
|
-
*/
|
|
52
|
-
timeToPlace(t1: number): number;
|
|
53
|
-
}
|
|
54
|
-
export declare class GottschewskiConversion implements PlaceTimeConversion {
|
|
55
|
-
get summary(): string;
|
|
56
|
-
paperThickness: number;
|
|
57
|
-
initialCircumference: number;
|
|
58
|
-
secondsPerTurn: number;
|
|
59
|
-
/**
|
|
60
|
-
* @param x1 in centimeters
|
|
61
|
-
*/
|
|
62
|
-
placeToTime(x1: number): number;
|
|
63
|
-
timeToPlace(t1: number): number;
|
|
64
|
-
}
|
|
65
|
-
export {};
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
export class PlaceTimeConversion {
|
|
2
|
-
}
|
|
3
|
-
export class NoAccelerationConversion {
|
|
4
|
-
constructor() {
|
|
5
|
-
Object.defineProperty(this, "metersPerMinute", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 3
|
|
10
|
-
}); // according to most sources
|
|
11
|
-
}
|
|
12
|
-
get summary() {
|
|
13
|
-
return `no aceleration (${this.metersPerMinute} m/min)`;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Converts physical place (in cm) to time (in seconds).
|
|
17
|
-
* @param x1 - The distance in mm.
|
|
18
|
-
* @returns Time in seconds.
|
|
19
|
-
*/
|
|
20
|
-
placeToTime(cm) {
|
|
21
|
-
const meters = cm / 100; // convert to m
|
|
22
|
-
const t = meters / this.metersPerMinute;
|
|
23
|
-
return t * 60;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Converts time (in seconds) to physical place (in cm).
|
|
27
|
-
* @param t1 - The time in seconds.
|
|
28
|
-
* @returns Distance in cm.
|
|
29
|
-
*/
|
|
30
|
-
timeToPlace(t1) {
|
|
31
|
-
return (this.metersPerMinute * (t1 / 60)) * 100;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
var SpeedUnit;
|
|
35
|
-
(function (SpeedUnit) {
|
|
36
|
-
SpeedUnit[SpeedUnit["MetersPerMinute"] = 0] = "MetersPerMinute";
|
|
37
|
-
SpeedUnit[SpeedUnit["FeetPerMinute"] = 1] = "FeetPerMinute";
|
|
38
|
-
})(SpeedUnit || (SpeedUnit = {}));
|
|
39
|
-
var AccelerationUnit;
|
|
40
|
-
(function (AccelerationUnit) {
|
|
41
|
-
AccelerationUnit[AccelerationUnit["MillimetersPerSecondSquared"] = 0] = "MillimetersPerSecondSquared";
|
|
42
|
-
AccelerationUnit[AccelerationUnit["FeetPerMinuteSquared"] = 1] = "FeetPerMinuteSquared";
|
|
43
|
-
})(AccelerationUnit || (AccelerationUnit = {}));
|
|
44
|
-
export class KinematicConversion {
|
|
45
|
-
get summary() {
|
|
46
|
-
return `kinematic (acceleration: ${this.acceleration} ft/s², speed: ${this.feetPerMinute} ft/min)`;
|
|
47
|
-
}
|
|
48
|
-
constructor(feetPerMinute = KinematicConversion.normalSpeed, acceleration = KinematicConversion.baertschAcceleration) {
|
|
49
|
-
Object.defineProperty(this, "feetPerMinute", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true,
|
|
53
|
-
value: void 0
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(this, "acceleration", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
configurable: true,
|
|
58
|
-
writable: true,
|
|
59
|
-
value: void 0
|
|
60
|
-
});
|
|
61
|
-
this.feetPerMinute = feetPerMinute;
|
|
62
|
-
this.acceleration = acceleration;
|
|
63
|
-
}
|
|
64
|
-
setSpeed(speed, unit) {
|
|
65
|
-
if (unit === SpeedUnit.FeetPerMinute) {
|
|
66
|
-
this.feetPerMinute = speed;
|
|
67
|
-
}
|
|
68
|
-
else if (unit === SpeedUnit.MetersPerMinute) {
|
|
69
|
-
this.feetPerMinute = speed * 3.2808399;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
throw new Error('Unsupported unit');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
setAcceleration(acceleration, unit) {
|
|
76
|
-
if (unit === AccelerationUnit.FeetPerMinuteSquared) {
|
|
77
|
-
this.acceleration = acceleration;
|
|
78
|
-
}
|
|
79
|
-
else if (unit === AccelerationUnit.MillimetersPerSecondSquared) {
|
|
80
|
-
this.acceleration = acceleration * 0.0032808399 * 3600;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
throw new Error('Unsupported unit');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Converts physical place (in cm) to time (in seconds).
|
|
88
|
-
* @param x1 - The distance in mm.
|
|
89
|
-
* @returns Time in seconds.
|
|
90
|
-
*/
|
|
91
|
-
placeToTime(cm) {
|
|
92
|
-
const x1 = cm / 30.48;
|
|
93
|
-
const v = this.feetPerMinute;
|
|
94
|
-
const a = this.acceleration;
|
|
95
|
-
const t = (Math.sqrt(2 * a * x1 + Math.pow(v, 2)) - v) / a;
|
|
96
|
-
return t * 60;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Converts time (in seconds) to physical place (in cm).
|
|
100
|
-
* @param t1 - The time in seconds.
|
|
101
|
-
* @returns Distance in cm.
|
|
102
|
-
*/
|
|
103
|
-
timeToPlace(t1) {
|
|
104
|
-
// Convert seconds -> minutes
|
|
105
|
-
const T = t1 / 60;
|
|
106
|
-
const xFeet = this.feetPerMinute * T + 0.5 * this.acceleration * Math.pow(T, 2);
|
|
107
|
-
// Convert feet -> millimeters
|
|
108
|
-
const xMM = xFeet * 304.8;
|
|
109
|
-
return xMM / 10;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
Object.defineProperty(KinematicConversion, "slowSpeed", {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
configurable: true,
|
|
115
|
-
writable: true,
|
|
116
|
-
value: 9.46
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(KinematicConversion, "normalSpeed", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
configurable: true,
|
|
121
|
-
writable: true,
|
|
122
|
-
value: 9.85
|
|
123
|
-
});
|
|
124
|
-
Object.defineProperty(KinematicConversion, "stanfordAcceleration", {
|
|
125
|
-
enumerable: true,
|
|
126
|
-
configurable: true,
|
|
127
|
-
writable: true,
|
|
128
|
-
value: 0.3147
|
|
129
|
-
}); // cf. https://github.com/pianoroll/midi2exp/commit/6a29060
|
|
130
|
-
Object.defineProperty(KinematicConversion, "baertschAcceleration", {
|
|
131
|
-
enumerable: true,
|
|
132
|
-
configurable: true,
|
|
133
|
-
writable: true,
|
|
134
|
-
value: 0.1772
|
|
135
|
-
}); // = 0.015 mm/s^2, cf. Baertsch p. 33
|
|
136
|
-
export class GottschewskiConversion {
|
|
137
|
-
constructor() {
|
|
138
|
-
Object.defineProperty(this, "paperThickness", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
configurable: true,
|
|
141
|
-
writable: true,
|
|
142
|
-
value: 0.0075
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(this, "initialCircumference", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
configurable: true,
|
|
147
|
-
writable: true,
|
|
148
|
-
value: 22.25
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(this, "secondsPerTurn", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
configurable: true,
|
|
153
|
-
writable: true,
|
|
154
|
-
value: 4.64
|
|
155
|
-
}); // is that correct? Philips says 120 RPM (p. 113)
|
|
156
|
-
}
|
|
157
|
-
get summary() {
|
|
158
|
-
return `Gottschewski (assuming paper thickness: ${this.paperThickness}, initial circumference: ${this.initialCircumference}, seconds per turn: ${this.secondsPerTurn})`;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @param x1 in centimeters
|
|
162
|
-
*/
|
|
163
|
-
placeToTime(x1) {
|
|
164
|
-
const Q0 = Math.pow(this.initialCircumference, 2) / (4 * Math.PI);
|
|
165
|
-
const v0 = this.initialCircumference / this.secondsPerTurn;
|
|
166
|
-
const d = Q0 / this.paperThickness;
|
|
167
|
-
return Math.pow(d, 0.5) * (1 / v0) * 2 * (Math.pow(d + x1, 0.5) - Math.pow(d, 0.5));
|
|
168
|
-
}
|
|
169
|
-
timeToPlace(t1) {
|
|
170
|
-
const Q0 = Math.pow(this.initialCircumference, 2) / (4 * Math.PI);
|
|
171
|
-
const v0 = this.initialCircumference / this.secondsPerTurn;
|
|
172
|
-
const d = Q0 / this.paperThickness;
|
|
173
|
-
return Math.pow((t1 * v0) / (2 * Math.pow(d, 0.5)) + Math.pow(d, 0.5), 2) - d;
|
|
174
|
-
}
|
|
175
|
-
}
|
package/lib/RollEvent.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { RollMeasurement } from "./Measurement";
|
|
2
|
-
import { WithId } from "./WithId";
|
|
3
|
-
export interface HorizontalSpan {
|
|
4
|
-
unit: 'mm';
|
|
5
|
-
from: number;
|
|
6
|
-
to: number;
|
|
7
|
-
}
|
|
8
|
-
export interface VerticalSpan {
|
|
9
|
-
unit: 'track';
|
|
10
|
-
from: number;
|
|
11
|
-
to?: number;
|
|
12
|
-
}
|
|
13
|
-
export interface RollFeature<T> extends WithId {
|
|
14
|
-
type: T;
|
|
15
|
-
/**
|
|
16
|
-
* IIIF region in string form.
|
|
17
|
-
*/
|
|
18
|
-
annotates?: string;
|
|
19
|
-
horizontal: HorizontalSpan;
|
|
20
|
-
vertical: VerticalSpan;
|
|
21
|
-
/**
|
|
22
|
-
* Describes whether the event takes place
|
|
23
|
-
* on the verso or recto side of the roll.
|
|
24
|
-
* Since the same perforation is present on both
|
|
25
|
-
* sides, this property is left optional for now.
|
|
26
|
-
*/
|
|
27
|
-
side?: 'verso' | 'recto';
|
|
28
|
-
measurement: RollMeasurement;
|
|
29
|
-
}
|
|
30
|
-
export interface Note extends RollFeature<'note'> {
|
|
31
|
-
pitch: number;
|
|
32
|
-
}
|
|
33
|
-
export type ExpressionScope = 'bass' | 'treble';
|
|
34
|
-
export type ExpressionType = 'SustainPedalOn' | 'SustainPedalOff' | 'SoftPedalOn' | 'SoftPedalOff' | 'MezzoforteOff' | 'MezzoforteOn' | 'SlowCrescendoOn' | 'SlowCrescendoOff' | 'ForzandoOn' | 'ForzandoOff' | 'MotorOff' | 'MotorOn' | 'Rewind' | 'ElectricCutOff';
|
|
35
|
-
export interface Expression extends RollFeature<'expression'> {
|
|
36
|
-
scope: ExpressionScope;
|
|
37
|
-
expressionType: ExpressionType;
|
|
38
|
-
}
|
|
39
|
-
export declare const isRollEvent: (e: any) => e is AnyRollEvent;
|
|
40
|
-
export interface Perforation extends RollFeature<'perforation'> {
|
|
41
|
-
accelerating?: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* This denotes perforations that are covered by an editor.
|
|
45
|
-
* The covered perforation is not considered to be part
|
|
46
|
-
* of the original note or expression hole anymore.
|
|
47
|
-
*/
|
|
48
|
-
export interface Cover extends RollFeature<'cover'> {
|
|
49
|
-
/**
|
|
50
|
-
* This property can be used to indicate e.g. the
|
|
51
|
-
* color or material of the cover.
|
|
52
|
-
*/
|
|
53
|
-
note?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* For handwritten insertions like e. g. the
|
|
57
|
-
* perforation date in the end of a roll.
|
|
58
|
-
*/
|
|
59
|
-
export interface HandwrittenText extends RollFeature<'handwrittenText'> {
|
|
60
|
-
text: string;
|
|
61
|
-
rotation?: number;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* This type can be used to indicate stamps like e. g. the
|
|
65
|
-
* "controlliert" stamp in the beginning of rolls or the
|
|
66
|
-
* date at the end of (later) Welte rolls.
|
|
67
|
-
*/
|
|
68
|
-
export interface Stamp extends RollFeature<'stamp'> {
|
|
69
|
-
text: string;
|
|
70
|
-
rotation?: number;
|
|
71
|
-
}
|
|
72
|
-
export interface RollLabel extends RollFeature<'rollLabel'> {
|
|
73
|
-
text: string;
|
|
74
|
-
signed: boolean;
|
|
75
|
-
}
|
|
76
|
-
export type AnyRollEvent = Note | Expression | HandwrittenText | Stamp | Cover | RollLabel;
|
package/lib/RollEvent.js
DELETED
package/lib/Stage.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ActorAssignment, Edit } from "./Edit";
|
|
2
|
-
import { EditorialAssumption, Motivation } from "./EditorialAssumption";
|
|
3
|
-
import { AnySymbol } from "./Symbol";
|
|
4
|
-
export interface Derivation extends EditorialAssumption<'derivation', Stage> {
|
|
5
|
-
}
|
|
6
|
-
declare const versionType: readonly ["edition", "authorised-revision", "unauthorised-revision", "gloss"];
|
|
7
|
-
export type VersionType = typeof versionType[number];
|
|
8
|
-
/**
|
|
9
|
-
* Stage + Stage Creation
|
|
10
|
-
*/
|
|
11
|
-
export interface Stage {
|
|
12
|
-
id: string;
|
|
13
|
-
siglum: string;
|
|
14
|
-
actor?: ActorAssignment;
|
|
15
|
-
basedOn?: Derivation;
|
|
16
|
-
edits: Edit[];
|
|
17
|
-
motivations: Motivation<string>[];
|
|
18
|
-
type: VersionType;
|
|
19
|
-
}
|
|
20
|
-
export declare const traverseStages: (stage: Stage, callback: (stage: Stage) => void) => void;
|
|
21
|
-
export declare const getSnapshot: (stage: Stage) => AnySymbol[];
|
|
22
|
-
/**
|
|
23
|
-
* Walks through the stages. If it finds a symbol that is still
|
|
24
|
-
* part of the tradition (i.e. it is included in the current snapshot)
|
|
25
|
-
* and is equivalent with the given symbol, it will add the feature
|
|
26
|
-
* carrying the symbol to the collated symbol. Otherwise, the
|
|
27
|
-
* given symbol will be added to the current stage's insertions.
|
|
28
|
-
*
|
|
29
|
-
* All symbols of the tradition that are not included in the given
|
|
30
|
-
* symbols are considered to be deleted.
|
|
31
|
-
*
|
|
32
|
-
* @param creation
|
|
33
|
-
* @param symbols
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
export declare function fillEdits(currentStage: Stage, symbols: AnySymbol[]): void;
|
|
37
|
-
export {};
|