@libraz/libsonare 1.4.0 → 1.4.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/dist/index.js +34 -18
- package/dist/index.js.map +1 -1
- package/dist/sonare-rt.wasm +0 -0
- package/dist/sonare.wasm +0 -0
- package/dist/worklet.d.ts +10 -2
- package/dist/worklet.js.map +1 -1
- package/package.json +1 -1
- package/src/effects_mastering.ts +16 -9
- package/src/feature_music.ts +13 -9
- package/src/project.ts +30 -6
- package/src/public_types.ts +4 -0
- package/src/quick_analysis.ts +18 -14
- package/src/realtime_voice_changer.ts +2 -1
- package/src/sonare.js.d.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -801,7 +801,7 @@ var RealtimeVoiceChanger = class {
|
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
803
|
function realtimeVoiceChangerPresetNames() {
|
|
804
|
-
return getSonareModule().realtimeVoiceChangerPresetNames();
|
|
804
|
+
return Array.from(getSonareModule().realtimeVoiceChangerPresetNames());
|
|
805
805
|
}
|
|
806
806
|
function realtimeVoiceChangerPresetJson(name) {
|
|
807
807
|
return getSonareModule().realtimeVoiceChangerPresetJson(name);
|
|
@@ -1190,17 +1190,22 @@ function mastering(samples, sampleRate = 22050, options = {}) {
|
|
|
1190
1190
|
sampleRate,
|
|
1191
1191
|
options.targetLufs ?? -14,
|
|
1192
1192
|
options.ceilingDb ?? -1,
|
|
1193
|
-
options.truePeakOversample ?? 4
|
|
1193
|
+
options.truePeakOversample ?? 4,
|
|
1194
|
+
options.releaseMs ?? 0,
|
|
1195
|
+
// 0 => library default (50 ms)
|
|
1196
|
+
options.applyGainAtInputRate ?? false
|
|
1194
1197
|
);
|
|
1195
1198
|
}
|
|
1196
1199
|
function masteringProcessorNames() {
|
|
1197
|
-
return requireModule().masteringProcessorNames();
|
|
1200
|
+
return Array.from(requireModule().masteringProcessorNames());
|
|
1198
1201
|
}
|
|
1199
1202
|
function masteringInsertNames() {
|
|
1200
1203
|
return requireModule().masteringInsertNames();
|
|
1201
1204
|
}
|
|
1202
1205
|
function masteringInsertParamNames(name) {
|
|
1203
|
-
return
|
|
1206
|
+
return Array.from(
|
|
1207
|
+
requireModule().masteringInsertParamNames(name)
|
|
1208
|
+
);
|
|
1204
1209
|
}
|
|
1205
1210
|
function masteringInsertParamInfo(name) {
|
|
1206
1211
|
const json = requireModule().masteringInsertParamInfo(name);
|
|
@@ -1211,13 +1216,13 @@ function masteringProcessorCatalog() {
|
|
|
1211
1216
|
return JSON.parse(json);
|
|
1212
1217
|
}
|
|
1213
1218
|
function masteringPairProcessorNames() {
|
|
1214
|
-
return requireModule().masteringPairProcessorNames();
|
|
1219
|
+
return Array.from(requireModule().masteringPairProcessorNames());
|
|
1215
1220
|
}
|
|
1216
1221
|
function masteringPairAnalysisNames() {
|
|
1217
|
-
return requireModule().masteringPairAnalysisNames();
|
|
1222
|
+
return Array.from(requireModule().masteringPairAnalysisNames());
|
|
1218
1223
|
}
|
|
1219
1224
|
function masteringStereoAnalysisNames() {
|
|
1220
|
-
return requireModule().masteringStereoAnalysisNames();
|
|
1225
|
+
return Array.from(requireModule().masteringStereoAnalysisNames());
|
|
1221
1226
|
}
|
|
1222
1227
|
function masteringProcess(processorName, samples, sampleRate = 22050, params = {}) {
|
|
1223
1228
|
return requireModule().masteringProcess(processorName, samples, sampleRate, params);
|
|
@@ -1324,7 +1329,7 @@ function masteringChainStereoWithProgress(left, right, sampleRate = 22050, confi
|
|
|
1324
1329
|
);
|
|
1325
1330
|
}
|
|
1326
1331
|
function masteringPresetNames() {
|
|
1327
|
-
return requireModule().masteringPresetNames();
|
|
1332
|
+
return Array.from(requireModule().masteringPresetNames());
|
|
1328
1333
|
}
|
|
1329
1334
|
function masterAudio(samples, sampleRate = 22050, presetName = "pop", overrides = {}) {
|
|
1330
1335
|
return requireModule().masterAudio(presetName, samples, sampleRate, overrides);
|
|
@@ -1358,7 +1363,7 @@ function masterAudioStereoWithProgress(left, right, sampleRate = 22050, presetNa
|
|
|
1358
1363
|
);
|
|
1359
1364
|
}
|
|
1360
1365
|
function mixingScenePresetNames() {
|
|
1361
|
-
return requireModule().mixingScenePresetNames();
|
|
1366
|
+
return Array.from(requireModule().mixingScenePresetNames());
|
|
1362
1367
|
}
|
|
1363
1368
|
function mixingScenePresetJson(presetName) {
|
|
1364
1369
|
return requireModule().mixingScenePresetJson(presetName);
|
|
@@ -1541,13 +1546,14 @@ function analyzeSections(samples, sampleRate = 22050, options = {}) {
|
|
|
1541
1546
|
if ((options.minSectionSec ?? 4) <= 0) {
|
|
1542
1547
|
throw new RangeError("analyzeSections: minSectionSec must be positive");
|
|
1543
1548
|
}
|
|
1544
|
-
|
|
1549
|
+
const sections = requireModule3().analyzeSections(
|
|
1545
1550
|
samples,
|
|
1546
1551
|
sampleRate,
|
|
1547
1552
|
options.nFft ?? 2048,
|
|
1548
1553
|
options.hopLength ?? 512,
|
|
1549
1554
|
options.minSectionSec ?? 4
|
|
1550
|
-
)
|
|
1555
|
+
);
|
|
1556
|
+
return Array.from(sections, (s) => ({ ...s, type: s.type }));
|
|
1551
1557
|
}
|
|
1552
1558
|
function analyzeMelody(samples, sampleRate = 22050, options = {}) {
|
|
1553
1559
|
validateMusicSamples("analyzeMelody", samples, sampleRate, options);
|
|
@@ -2115,7 +2121,7 @@ function detectKey(samples, sampleRate = 22050, options = {}) {
|
|
|
2115
2121
|
}
|
|
2116
2122
|
function detectKeyCandidates(samples, sampleRate = 22050, options = {}) {
|
|
2117
2123
|
validateAnalysisInput("detectKeyCandidates", samples, sampleRate, options);
|
|
2118
|
-
|
|
2124
|
+
const candidates = requireModule8()._detectKeyCandidates(
|
|
2119
2125
|
samples,
|
|
2120
2126
|
sampleRate,
|
|
2121
2127
|
options.nFft ?? 4096,
|
|
@@ -2126,7 +2132,8 @@ function detectKeyCandidates(samples, sampleRate = 22050, options = {}) {
|
|
|
2126
2132
|
keyModeValues(options.modes),
|
|
2127
2133
|
keyProfileValue(options.profile),
|
|
2128
2134
|
options.genreHint ?? ""
|
|
2129
|
-
)
|
|
2135
|
+
);
|
|
2136
|
+
return Array.from(candidates, convertKeyCandidate);
|
|
2130
2137
|
}
|
|
2131
2138
|
function detectOnsets(samples, sampleRate = 22050, options = {}) {
|
|
2132
2139
|
validateAnalysisInput("detectOnsets", samples, sampleRate, options);
|
|
@@ -3014,10 +3021,10 @@ function projectAbiVersion() {
|
|
|
3014
3021
|
return projectModule().projectAbiVersion();
|
|
3015
3022
|
}
|
|
3016
3023
|
function synthPresetNames() {
|
|
3017
|
-
return projectModule().synthPresetNames();
|
|
3024
|
+
return Array.from(projectModule().synthPresetNames());
|
|
3018
3025
|
}
|
|
3019
3026
|
function synthPresetPatch(name) {
|
|
3020
|
-
return projectModule().synthPresetPatch(name);
|
|
3027
|
+
return { ...projectModule().synthPresetPatch(name) };
|
|
3021
3028
|
}
|
|
3022
3029
|
function synthEnumTables() {
|
|
3023
3030
|
return projectModule()._synthEnumTables();
|
|
@@ -3453,9 +3460,18 @@ var Project = class _Project {
|
|
|
3453
3460
|
setClipCompSegments(clipId, segments) {
|
|
3454
3461
|
this.native.setClipCompSegments(clipId, segments);
|
|
3455
3462
|
}
|
|
3456
|
-
/**
|
|
3457
|
-
|
|
3458
|
-
|
|
3463
|
+
/**
|
|
3464
|
+
* Set a clip's loop mode + loop length in PPQ (undoable). `loopCrossfadePpq`
|
|
3465
|
+
* is an optional equal-power crossfade at the loop seam (PPQ, finite and >= 0;
|
|
3466
|
+
* 0 = hard loop); the engine clamps it to the clip's pre-roll and half the loop.
|
|
3467
|
+
*/
|
|
3468
|
+
setClipLoop(clipId, loopMode, loopLengthPpq = 0, loopCrossfadePpq = 0) {
|
|
3469
|
+
this.native.setClipLoop(
|
|
3470
|
+
clipId,
|
|
3471
|
+
projectLoopModeValue(loopMode),
|
|
3472
|
+
loopLengthPpq,
|
|
3473
|
+
loopCrossfadePpq
|
|
3474
|
+
);
|
|
3459
3475
|
}
|
|
3460
3476
|
/** Rebind a clip to a different (already-registered) source (undoable). */
|
|
3461
3477
|
setClipSource(clipId, sourceId) {
|