@opendaw/studio-core 0.0.81 → 0.0.83
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/capture/RecordAudio.d.ts.map +1 -1
- package/dist/capture/RecordAudio.js +1 -0
- package/dist/capture/RecordMidi.d.ts.map +1 -1
- package/dist/capture/RecordMidi.js +23 -13
- package/dist/dawproject/DawProjectImporter.d.ts.map +1 -1
- package/dist/dawproject/DawProjectImporter.js +23 -20
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordAudio.d.ts","sourceRoot":"","sources":["../../src/capture/RecordAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAGvG,OAAO,EAAa,mBAAmB,EAAY,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,WAAW,CAAC;IACzB,KAAK,kBAAkB,GAAG;QACtB,gBAAgB,EAAE,gBAAgB,CAAA;QAClC,WAAW,EAAE,WAAW,CAAA;QACxB,aAAa,EAAE,mBAAmB,CAAA;QAClC,YAAY,EAAE,YAAY,CAAA;QAC1B,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACjB,CAAA;IAED,MAAM,CAAC,MAAM,KAAK,GACd,0FAAwF,kBAAkB,KACxG,
|
|
1
|
+
{"version":3,"file":"RecordAudio.d.ts","sourceRoot":"","sources":["../../src/capture/RecordAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAGvG,OAAO,EAAa,mBAAmB,EAAY,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,WAAW,CAAC;IACzB,KAAK,kBAAkB,GAAG;QACtB,gBAAgB,EAAE,gBAAgB,CAAA;QAClC,WAAW,EAAE,WAAW,CAAA;QACxB,aAAa,EAAE,mBAAmB,CAAA;QAClC,YAAY,EAAE,YAAY,CAAA;QAC1B,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACjB,CAAA;IAED,MAAM,CAAC,MAAM,KAAK,GACd,0FAAwF,kBAAkB,KACxG,UAyEL,CAAA;;CACJ"}
|
|
@@ -39,6 +39,7 @@ export var RecordAudio;
|
|
|
39
39
|
box.hue.setValue(ColorCodes.forTrackType(TrackType.Audio));
|
|
40
40
|
box.label.setValue("Recording");
|
|
41
41
|
});
|
|
42
|
+
project.selection.select(regionBox);
|
|
42
43
|
return { fileBox, regionBox };
|
|
43
44
|
});
|
|
44
45
|
const { tempoMap, env: { audioContext: { sampleRate } } } = project;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordMidi.d.ts","sourceRoot":"","sources":["../../src/capture/RecordMidi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAuC,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAGlH,OAAO,EAAa,UAAU,EAAY,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,UAAU,CAAC;IACxB,KAAK,iBAAiB,GAAG;QACrB,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAA;IAID,MAAM,CAAC,MAAM,KAAK,GAAI,gCAA8B,iBAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"RecordMidi.d.ts","sourceRoot":"","sources":["../../src/capture/RecordMidi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAuC,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAGlH,OAAO,EAAa,UAAU,EAAY,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,UAAU,CAAC;IACxB,KAAK,iBAAiB,GAAG;QACrB,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAA;IAID,MAAM,CAAC,MAAM,KAAK,GAAI,gCAA8B,iBAAiB,KAAG,UAwEvE,CAAA;;CACJ"}
|
|
@@ -9,15 +9,35 @@ export var RecordMidi;
|
|
|
9
9
|
RecordMidi.start = ({ notifier, project, capture }) => {
|
|
10
10
|
const beats = PPQN.fromSignature(1, project.timelineBox.signature.denominator.getValue());
|
|
11
11
|
const { editing, boxGraph, engine, env: { audioContext }, timelineBox: { bpm } } = project;
|
|
12
|
-
const { position } = engine;
|
|
12
|
+
const { position, isRecording } = engine;
|
|
13
13
|
const trackBox = RecordTrack.findOrCreate(editing, capture.audioUnitBox, TrackType.Notes);
|
|
14
14
|
const terminator = new Terminator();
|
|
15
15
|
const activeNotes = new Map();
|
|
16
16
|
const latency = PPQN.secondsToPulses(audioContext.outputLatency ?? 10.0, bpm.getValue());
|
|
17
17
|
let writing = Option.None;
|
|
18
|
+
const createRegion = () => {
|
|
19
|
+
const writePosition = position.getValue() + latency;
|
|
20
|
+
editing.modify(() => {
|
|
21
|
+
const collection = NoteEventCollectionBox.create(boxGraph, UUID.generate());
|
|
22
|
+
const regionBox = NoteRegionBox.create(boxGraph, UUID.generate(), box => {
|
|
23
|
+
box.regions.refer(trackBox.regions);
|
|
24
|
+
box.events.refer(collection.owners);
|
|
25
|
+
box.position.setValue(Math.max(quantizeRound(writePosition, beats), 0));
|
|
26
|
+
box.hue.setValue(ColorCodes.forTrackType(TrackType.Notes));
|
|
27
|
+
});
|
|
28
|
+
project.selection.select(regionBox);
|
|
29
|
+
engine.ignoreNoteRegion(regionBox.address.uuid);
|
|
30
|
+
writing = Option.wrap({ region: regionBox, collection });
|
|
31
|
+
}, false);
|
|
32
|
+
};
|
|
18
33
|
terminator.own(position.catchupAndSubscribe(owner => {
|
|
19
34
|
if (writing.isEmpty()) {
|
|
20
|
-
|
|
35
|
+
if (isRecording.getValue()) {
|
|
36
|
+
createRegion();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
21
41
|
}
|
|
22
42
|
const writePosition = owner.getValue() + latency;
|
|
23
43
|
const { region, collection } = writing.unwrap();
|
|
@@ -47,17 +67,7 @@ export var RecordMidi;
|
|
|
47
67
|
if (NoteSignal.isOn(signal)) {
|
|
48
68
|
const { pitch, velocity } = signal;
|
|
49
69
|
if (writing.isEmpty()) {
|
|
50
|
-
|
|
51
|
-
const collection = NoteEventCollectionBox.create(boxGraph, UUID.generate());
|
|
52
|
-
const region = NoteRegionBox.create(boxGraph, UUID.generate(), box => {
|
|
53
|
-
box.regions.refer(trackBox.regions);
|
|
54
|
-
box.events.refer(collection.owners);
|
|
55
|
-
box.position.setValue(Math.max(quantizeRound(writePosition, beats), 0));
|
|
56
|
-
box.hue.setValue(ColorCodes.forTrackType(TrackType.Notes));
|
|
57
|
-
});
|
|
58
|
-
engine.ignoreNoteRegion(region.address.uuid);
|
|
59
|
-
writing = Option.wrap({ region, collection });
|
|
60
|
-
}, false);
|
|
70
|
+
createRegion();
|
|
61
71
|
}
|
|
62
72
|
const { region, collection } = writing.unwrap();
|
|
63
73
|
editing.modify(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DawProjectImporter.d.ts","sourceRoot":"","sources":["../../src/dawproject/DawProjectImporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAiBH,IAAI,EAEP,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAcH,aAAa,EAOhB,MAAM,yBAAyB,CAAA;AAyBhC,OAAO,
|
|
1
|
+
{"version":3,"file":"DawProjectImporter.d.ts","sourceRoot":"","sources":["../../src/dawproject/DawProjectImporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAiBH,IAAI,EAEP,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAcH,aAAa,EAOhB,MAAM,yBAAyB,CAAA;AAyBhC,OAAO,EAMH,eAAe,EAElB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAIvC,yBAAiB,gBAAgB,CAAC;IAW9B,KAAY,MAAM,GAAG;QACjB,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,QAAQ,EAAE,eAAe,CAAA;KAC5B,CAAA;IAOM,MAAM,IAAI,GAAU,QAAQ,aAAa,EAAE,WAAW,UAAU,CAAC,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAyYxG,CAAA;CAaJ"}
|
|
@@ -4,8 +4,7 @@ import { gainToDb, PPQN } from "@opendaw/lib-dsp";
|
|
|
4
4
|
import { ChannelRole, ClipsSchema, DeviceRole, EqualizerSchema, LanesSchema, NotesSchema, PointsSchema, SendType, TrackSchema, WarpsSchema } from "@opendaw/lib-dawproject";
|
|
5
5
|
import { AudioSendRouting, AudioUnitType, IconSymbol } from "@opendaw/studio-enums";
|
|
6
6
|
import { AudioBusBox, AudioFileBox, AudioPitchStretchBox, AudioRegionBox, AudioUnitBox, AuxSendBox, BoxIO, CaptureAudioBox, CaptureMidiBox, GrooveShuffleBox, NoteEventBox, NoteEventCollectionBox, NoteRegionBox, RootBox, TimelineBox, TrackBox, UnknownAudioEffectDeviceBox, UnknownMidiEffectDeviceBox, UserInterfaceBox, ValueEventCollectionBox } from "@opendaw/studio-boxes";
|
|
7
|
-
import { AudioUnitOrdering, ColorCodes,
|
|
8
|
-
import { DeviceIO } from "./DeviceIO";
|
|
7
|
+
import { AudioUnitOrdering, ColorCodes, InstrumentFactories, TrackType } from "@opendaw/studio-adapters";
|
|
9
8
|
import { BuiltinDevices } from "./BuiltinDevices";
|
|
10
9
|
import { AudioContentHelpers } from "../project/audio/AudioContentHelpers";
|
|
11
10
|
export var DawProjectImport;
|
|
@@ -61,17 +60,19 @@ export var DawProjectImport;
|
|
|
61
60
|
const createEffect = (device, field, index) => {
|
|
62
61
|
const { deviceRole, deviceVendor, deviceID, deviceName, state } = device;
|
|
63
62
|
assert(deviceRole === DeviceRole.NOTE_FX || deviceRole === DeviceRole.AUDIO_FX, "Device is not an effect");
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
/*
|
|
64
|
+
TODO There is a bug in this if branch, which results in an invalid host pointer
|
|
65
|
+
if (deviceVendor === "openDAW") {
|
|
66
|
+
console.debug(`Recreate openDAW effect device '${deviceName}' with id '${deviceID}'`)
|
|
67
|
+
const resource = ifDefined(state?.path, path => resources.fromPath(path))
|
|
67
68
|
if (isDefined(resource)) {
|
|
68
|
-
const device = DeviceIO.importDevice(boxGraph, resource.buffer)
|
|
69
|
-
device.host.refer(field)
|
|
70
|
-
device.label.setValue(deviceName ?? "")
|
|
71
|
-
DeviceBoxUtils.lookupIndexField(device).setValue(index)
|
|
72
|
-
return
|
|
69
|
+
const device = DeviceIO.importDevice(boxGraph, resource.buffer)
|
|
70
|
+
device.host.refer(field)
|
|
71
|
+
device.label.setValue(deviceName ?? "")
|
|
72
|
+
DeviceBoxUtils.lookupIndexField(device).setValue(index)
|
|
73
|
+
return
|
|
73
74
|
}
|
|
74
|
-
}
|
|
75
|
+
}*/
|
|
75
76
|
if (isInstanceOf(device, EqualizerSchema)) {
|
|
76
77
|
return BuiltinDevices.equalizer(boxGraph, device, field, index);
|
|
77
78
|
}
|
|
@@ -112,20 +113,22 @@ export var DawProjectImport;
|
|
|
112
113
|
});
|
|
113
114
|
};
|
|
114
115
|
const createInstrumentBox = (audioUnitBox, track, device) => {
|
|
116
|
+
/*
|
|
117
|
+
TODO There is a bug in this if branch, which results in an invalid host pointer
|
|
115
118
|
if (isDefined(device)) {
|
|
116
|
-
const {
|
|
119
|
+
const {deviceName, deviceVendor, deviceID, state} = device
|
|
117
120
|
if (deviceVendor === "openDAW") {
|
|
118
|
-
console.debug(`Recreate openDAW instrument device '${deviceName}' with id '${deviceID}'`)
|
|
119
|
-
const resource = ifDefined(state?.path, path => resources.fromPath(path))
|
|
121
|
+
console.debug(`Recreate openDAW instrument device '${deviceName}' with id '${deviceID}'`)
|
|
122
|
+
const resource = ifDefined(state?.path, path => resources.fromPath(path))
|
|
120
123
|
if (isDefined(resource)) {
|
|
121
|
-
const device = DeviceIO.importDevice(boxGraph, resource.buffer)
|
|
122
|
-
device.host.refer(audioUnitBox.input)
|
|
123
|
-
device.label.setValue(deviceName ?? "")
|
|
124
|
-
assert(DeviceBoxUtils.isInstrumentDeviceBox(device), `${device.name} is not an instrument`)
|
|
125
|
-
return device
|
|
124
|
+
const device = DeviceIO.importDevice(boxGraph, resource.buffer)
|
|
125
|
+
device.host.refer(audioUnitBox.input)
|
|
126
|
+
device.label.setValue(deviceName ?? "")
|
|
127
|
+
assert(DeviceBoxUtils.isInstrumentDeviceBox(device), `${device.name} is not an instrument`)
|
|
128
|
+
return device as InstrumentBox
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
|
-
}
|
|
131
|
+
}*/
|
|
129
132
|
if (track.contentType === "notes") {
|
|
130
133
|
return InstrumentFactories.Vaporisateur
|
|
131
134
|
.create(boxGraph, audioUnitBox.input, track.name ?? "", IconSymbol.Piano);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendaw/studio-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
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.62",
|
|
60
60
|
"@opendaw/typescript-config": "^0.0.27"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "31251a9a212593b9eea6112f4f54a9a0a93ef69e"
|
|
63
63
|
}
|