@opendaw/studio-core 0.0.69 → 0.0.71
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.
|
@@ -11,7 +11,9 @@ export declare namespace AudioContentFactory {
|
|
|
11
11
|
targetTrack: TrackBox;
|
|
12
12
|
audioFileBox: AudioFileBox;
|
|
13
13
|
sample: Sample;
|
|
14
|
+
duration?: ppqn | number;
|
|
14
15
|
warpMarkers?: ReadonlyArray<WarpMarkerTemplate>;
|
|
16
|
+
waveformOffset?: number;
|
|
15
17
|
gainInDb?: number;
|
|
16
18
|
};
|
|
17
19
|
type Clip = Props & {
|
|
@@ -19,7 +21,6 @@ export declare namespace AudioContentFactory {
|
|
|
19
21
|
};
|
|
20
22
|
type Region = Props & {
|
|
21
23
|
position: ppqn;
|
|
22
|
-
duration?: ppqn;
|
|
23
24
|
name?: string;
|
|
24
25
|
};
|
|
25
26
|
type TimeStretchedProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioContentFactory.d.ts","sourceRoot":"","sources":["../../../src/project/audio/AudioContentFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAiB,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAa,MAAM,EAAY,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAC,GAAG,EAAwC,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EACH,YAAY,EACZ,YAAY,EAEZ,cAAc,EAEd,QAAQ,EAEX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAEvD,yBAAiB,mBAAmB,CAAC;IACjC,KAAY,KAAK,GAAG;QAChB,QAAQ,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"AudioContentFactory.d.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G,EAA0C,GAAG,KAAK,CAAA;IAI3E,MAAM,yBAAyB,GAAI,OAAO,kBAAkB,GAAG,MAAM,KAAG,cAM9E,CAAA;IAEM,MAAM,0BAA0B,GAAI,OAAO,mBAAmB,GAAG,MAAM,KAAG,cAEhF,CAAA;IAEM,MAAM,wBAAwB,GAAI,OAAO,iBAAiB,GAAG,MAAM,KAAG,cAgB5E,CAAA;IAIM,MAAM,uBAAuB,GAAI,OAAO,kBAAkB,GAAG,IAAI,KAAG,YAM1E,CAAA;IAEM,MAAM,wBAAwB,GAAI,OAAO,mBAAmB,GAAG,IAAI,KAAG,YAG5E,CAAA;IAEM,MAAM,sBAAsB,GAAI,OAAO,iBAAiB,GAAG,IAAI,KAAG,YAcxE,CAAA;CA6DJ"}
|
|
@@ -31,6 +31,7 @@ export var AudioContentFactory;
|
|
|
31
31
|
box.events.refer(collectionBox.owners);
|
|
32
32
|
box.timeBase.setValue(TimeBase.Seconds);
|
|
33
33
|
box.gain.setValue(props.gainInDb ?? 0.0);
|
|
34
|
+
box.waveformOffset.setValue(props.waveformOffset ?? 0.0);
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
37
|
// --- Clip Creation --- //
|
|
@@ -52,6 +53,7 @@ export var AudioContentFactory;
|
|
|
52
53
|
box.duration.setValue(durationInSeconds);
|
|
53
54
|
box.clips.refer(targetTrack.clips);
|
|
54
55
|
box.hue.setValue(ColorCodes.forTrackType(targetTrack.type.getValue()));
|
|
56
|
+
box.waveformOffset.setValue(props.waveformOffset ?? 0.0);
|
|
55
57
|
box.label.setValue(name);
|
|
56
58
|
box.file.refer(audioFileBox);
|
|
57
59
|
box.events.refer(collectionBox.owners);
|
|
@@ -66,7 +68,7 @@ export var AudioContentFactory;
|
|
|
66
68
|
return panic("Cannot create audio-region on non-audio track");
|
|
67
69
|
}
|
|
68
70
|
const { name, duration: durationInSeconds, bpm } = sample;
|
|
69
|
-
const durationInPPQN = quantizeRound(PPQN.secondsToPulses(durationInSeconds, bpm), PPQN.SemiQuaver);
|
|
71
|
+
const durationInPPQN = props.duration ?? quantizeRound(PPQN.secondsToPulses(durationInSeconds, bpm), PPQN.SemiQuaver);
|
|
70
72
|
if (isDefined(props.warpMarkers)) {
|
|
71
73
|
AudioContentHelpers.addWarpMarkers(boxGraph, playMode, props.warpMarkers);
|
|
72
74
|
}
|
|
@@ -76,9 +78,10 @@ export var AudioContentFactory;
|
|
|
76
78
|
const collectionBox = ValueEventCollectionBox.create(boxGraph, UUID.generate());
|
|
77
79
|
return AudioRegionBox.create(boxGraph, UUID.generate(), box => {
|
|
78
80
|
box.position.setValue(position);
|
|
79
|
-
box.duration.setValue(
|
|
81
|
+
box.duration.setValue(durationInPPQN);
|
|
80
82
|
box.loopDuration.setValue(durationInPPQN);
|
|
81
83
|
box.regions.refer(targetTrack.regions);
|
|
84
|
+
box.waveformOffset.setValue(props.waveformOffset ?? 0.0);
|
|
82
85
|
box.hue.setValue(ColorCodes.forTrackType(targetTrack.type.getValue()));
|
|
83
86
|
box.label.setValue(name);
|
|
84
87
|
box.file.refer(audioFileBox);
|
|
@@ -94,7 +97,7 @@ export var AudioContentFactory;
|
|
|
94
97
|
return panic("Cannot create audio-region on non-audio track");
|
|
95
98
|
}
|
|
96
99
|
const { name, duration: durationInSeconds, bpm } = sample;
|
|
97
|
-
const durationInPPQN = quantizeRound(PPQN.secondsToPulses(durationInSeconds, bpm), PPQN.SemiQuaver);
|
|
100
|
+
const durationInPPQN = props.duration ?? quantizeRound(PPQN.secondsToPulses(durationInSeconds, bpm), PPQN.SemiQuaver);
|
|
98
101
|
if (isDefined(props.warpMarkers)) {
|
|
99
102
|
AudioContentHelpers.addWarpMarkers(boxGraph, playMode, props.warpMarkers);
|
|
100
103
|
}
|
|
@@ -106,6 +109,7 @@ export var AudioContentFactory;
|
|
|
106
109
|
box.duration.setValue(durationInPPQN);
|
|
107
110
|
box.clips.refer(targetTrack.clips);
|
|
108
111
|
box.hue.setValue(ColorCodes.forTrackType(targetTrack.type.getValue()));
|
|
112
|
+
box.waveformOffset.setValue(props.waveformOffset ?? 0.0);
|
|
109
113
|
box.label.setValue(name);
|
|
110
114
|
box.file.refer(audioFileBox);
|
|
111
115
|
box.events.refer(collectionBox.owners);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendaw/studio-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"@opendaw/studio-forge-boxes": "^0.0.56",
|
|
60
60
|
"@opendaw/typescript-config": "^0.0.22"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "a0b81560a705608a348e969dcc5c1a13a90d888b"
|
|
63
63
|
}
|