@opendaw/studio-core 0.0.55 → 0.0.56
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/dist/InstrumentFactories.d.ts +10 -3
- package/dist/InstrumentFactories.d.ts.map +1 -1
- package/dist/InstrumentFactories.js +13 -22
- package/dist/processors.js +8 -8
- package/dist/processors.js.map +4 -4
- package/dist/project/ProjectMigration.d.ts.map +1 -1
- package/dist/project/ProjectMigration.js +20 -1
- package/package.json +15 -15
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { UUID } from "@opendaw/lib-std";
|
|
1
|
+
import { byte, UUID } from "@opendaw/lib-std";
|
|
2
2
|
import { InstrumentFactory } from "./InstrumentFactory";
|
|
3
3
|
export declare namespace InstrumentFactories {
|
|
4
4
|
const Tape: InstrumentFactory;
|
|
5
5
|
const Nano: InstrumentFactory;
|
|
6
|
-
|
|
6
|
+
type PlayfieldAttachment = ReadonlyArray<{
|
|
7
|
+
note: byte;
|
|
8
|
+
uuid: UUID.Bytes;
|
|
9
|
+
name: string;
|
|
10
|
+
durationInSeconds: number;
|
|
11
|
+
exclude: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
const Playfield: InstrumentFactory<PlayfieldAttachment>;
|
|
7
14
|
const Vaporisateur: InstrumentFactory;
|
|
8
15
|
const MIDIOutput: InstrumentFactory;
|
|
9
16
|
const Soundfont: InstrumentFactory<{
|
|
@@ -12,7 +19,7 @@ export declare namespace InstrumentFactories {
|
|
|
12
19
|
}>;
|
|
13
20
|
const Named: {
|
|
14
21
|
Vaporisateur: InstrumentFactory<never>;
|
|
15
|
-
Playfield: InstrumentFactory<
|
|
22
|
+
Playfield: InstrumentFactory<PlayfieldAttachment>;
|
|
16
23
|
Nano: InstrumentFactory<never>;
|
|
17
24
|
Tape: InstrumentFactory<never>;
|
|
18
25
|
Soundfont: InstrumentFactory<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentFactories.d.ts","sourceRoot":"","sources":["../src/InstrumentFactories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"InstrumentFactories.d.ts","sourceRoot":"","sources":["../src/InstrumentFactories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,IAAI,EAAa,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAKtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAGrD,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,IAAI,EAAE,iBAmBlB,CAAA;IAEM,MAAM,IAAI,EAAE,iBAwBlB,CAAA;IAED,KAAY,mBAAmB,GAAG,aAAa,CAAC;QAC5C,IAAI,EAAE,IAAI,CAAA;QACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,iBAAiB,EAAE,MAAM,CAAA;QACzB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAC,CAAA;IAEK,MAAM,SAAS,EAAE,iBAAiB,CAAC,mBAAmB,CA4B5D,CAAA;IAEM,MAAM,YAAY,EAAE,iBAqB1B,CAAA;IAEM,MAAM,UAAU,EAAE,iBAexB,CAAA;IAEM,MAAM,SAAS,EAAE,iBAAiB,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAqB5E,CAAA;IAEM,MAAM,KAAK;;;;;;kBAvBgC,IAAI,CAAC,MAAM;kBAAQ,MAAM;;;KAuBM,CAAA;IACjF,KAAY,IAAI,GAAG,MAAM,OAAO,KAAK,CAAA;CAYxC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AudioFileBox, MIDIOutputDeviceBox, NanoDeviceBox, PlayfieldDeviceBox, PlayfieldSampleBox, SoundfontDeviceBox, SoundfontFileBox, TapeDeviceBox, VaporisateurDeviceBox } from "@opendaw/studio-boxes";
|
|
2
|
-
import { UUID } from "@opendaw/lib-std";
|
|
2
|
+
import { isDefined, UUID } from "@opendaw/lib-std";
|
|
3
3
|
import { Waveform } from "@opendaw/lib-dsp";
|
|
4
4
|
import { IconSymbol, TrackType } from "@opendaw/studio-adapters";
|
|
5
5
|
export var InstrumentFactories;
|
|
@@ -45,32 +45,23 @@ export var InstrumentFactories;
|
|
|
45
45
|
defaultIcon: IconSymbol.Playfield,
|
|
46
46
|
description: "Drum computer",
|
|
47
47
|
trackType: TrackType.Notes,
|
|
48
|
-
create: (boxGraph, host, name, icon,
|
|
48
|
+
create: (boxGraph, host, name, icon, attachment) => {
|
|
49
49
|
const deviceBox = PlayfieldDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
50
50
|
box.label.setValue(name);
|
|
51
51
|
box.icon.setValue(IconSymbol.toName(icon));
|
|
52
52
|
box.host.refer(host);
|
|
53
53
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
useAudioFile(boxGraph, UUID.parse("87cde966-b799-4efc-a994-069e703478d3"), "909 Ride", 1.720)
|
|
66
|
-
];
|
|
67
|
-
const samples = files.map((file, index) => PlayfieldSampleBox.create(boxGraph, UUID.generate(), box => {
|
|
68
|
-
box.device.refer(deviceBox.samples);
|
|
69
|
-
box.file.refer(file);
|
|
70
|
-
box.index.setValue(60 + index);
|
|
71
|
-
}));
|
|
72
|
-
samples[7].exclude.setValue(true);
|
|
73
|
-
samples[8].exclude.setValue(true);
|
|
54
|
+
if (isDefined(attachment)) {
|
|
55
|
+
attachment.filter(({ note, uuid, name, durationInSeconds, exclude }) => {
|
|
56
|
+
const fileBox = useAudioFile(boxGraph, uuid, name, durationInSeconds);
|
|
57
|
+
PlayfieldSampleBox.create(boxGraph, UUID.generate(), box => {
|
|
58
|
+
box.device.refer(deviceBox.samples);
|
|
59
|
+
box.file.refer(fileBox);
|
|
60
|
+
box.index.setValue(note);
|
|
61
|
+
box.exclude.setValue(exclude);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
74
65
|
return deviceBox;
|
|
75
66
|
}
|
|
76
67
|
};
|