@hum2music/core 0.0.0-stage → 0.1.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/package.json +14 -4
- package/src/index.ts +1 -0
- package/src/types.ts +73 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hum2music/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared pipeline types for Hum2Music (NoteEvent, Composition, ChordEvent, TempoCandidate, etc.).",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/hum2music/hum2music",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/hum2music/hum2music.git",
|
|
10
|
+
"directory": "packages/core"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./src/index.ts",
|
|
14
|
+
"types": "./src/index.ts",
|
|
15
|
+
"files": ["src"]
|
|
16
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types";
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface PitchFrame {
|
|
2
|
+
timeMs: number;
|
|
3
|
+
f0Hz: number | null;
|
|
4
|
+
confidence: number;
|
|
5
|
+
voiced: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface NoteCandidate {
|
|
9
|
+
startMs: number;
|
|
10
|
+
durationMs: number;
|
|
11
|
+
rawPitch: number;
|
|
12
|
+
pitchTrajectory: PitchFrame[];
|
|
13
|
+
onsetConfidence: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** One sample of a note's pitch deviation from its nominal pitch, in cents, at a time offset from note-on. */
|
|
17
|
+
export interface PitchCurveSample {
|
|
18
|
+
offsetMs: number;
|
|
19
|
+
cents: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface NoteEvent {
|
|
23
|
+
pitch: number;
|
|
24
|
+
startBeat: number;
|
|
25
|
+
durationBeats: number;
|
|
26
|
+
velocity: number;
|
|
27
|
+
expression?: {
|
|
28
|
+
pitchCurve?: PitchCurveSample[];
|
|
29
|
+
timingOffsetMs?: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface TempoCandidate {
|
|
34
|
+
bpm: number;
|
|
35
|
+
confidence: number;
|
|
36
|
+
isHalfOrDoubleOf?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface KeyCandidate {
|
|
40
|
+
tonic: string;
|
|
41
|
+
mode: "major" | "minor";
|
|
42
|
+
confidence: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ChordEvent {
|
|
46
|
+
symbol: string;
|
|
47
|
+
startBeat: number;
|
|
48
|
+
durationBeats: number;
|
|
49
|
+
confidence: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** One labeled span of bars in a bar-level repetition analysis (e.g. A/A/B for a repeated 4-bar cycle). */
|
|
53
|
+
export interface SongSection {
|
|
54
|
+
label: string;
|
|
55
|
+
startBarIndex: number;
|
|
56
|
+
barCount: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface InstrumentTrack {
|
|
60
|
+
instrument: string;
|
|
61
|
+
notes: NoteEvent[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface Composition {
|
|
65
|
+
metadata: {
|
|
66
|
+
bpm: number;
|
|
67
|
+
timeSignature: [number, number];
|
|
68
|
+
key?: string;
|
|
69
|
+
};
|
|
70
|
+
melody: NoteEvent[];
|
|
71
|
+
chords: ChordEvent[];
|
|
72
|
+
tracks: InstrumentTrack[];
|
|
73
|
+
}
|
package/README.md
DELETED