@onjmin/dtm 0.1.72 → 0.1.73
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -957,6 +957,8 @@ type PlayMmlOptions = {
|
|
|
957
957
|
onStop?: () => void;
|
|
958
958
|
/** 再生中のステップ更新(1/192小節ごと)時のコールバック */
|
|
959
959
|
onTick?: (step: number) => void;
|
|
960
|
+
/** 再生開始位置(ステップ単位)。指定すると途中から再生する。 */
|
|
961
|
+
startStep?: number;
|
|
960
962
|
};
|
|
961
963
|
type MmlPlayback = {
|
|
962
964
|
/** 再生を止める(ループ中でも停止)。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -957,6 +957,8 @@ type PlayMmlOptions = {
|
|
|
957
957
|
onStop?: () => void;
|
|
958
958
|
/** 再生中のステップ更新(1/192小節ごと)時のコールバック */
|
|
959
959
|
onTick?: (step: number) => void;
|
|
960
|
+
/** 再生開始位置(ステップ単位)。指定すると途中から再生する。 */
|
|
961
|
+
startStep?: number;
|
|
960
962
|
};
|
|
961
963
|
type MmlPlayback = {
|
|
962
964
|
/** 再生を止める(ループ中でも停止)。 */
|
package/dist/index.js
CHANGED
|
@@ -3548,7 +3548,7 @@ var playPlacements = (placements, options) => {
|
|
|
3548
3548
|
const seq = createSequencer({
|
|
3549
3549
|
getTracks: () => seqTracks,
|
|
3550
3550
|
getBpm: () => bpm,
|
|
3551
|
-
getPlayStartStep: () => 0,
|
|
3551
|
+
getPlayStartStep: () => options.startStep ?? 0,
|
|
3552
3552
|
getDrumPattern: () => drumPattern,
|
|
3553
3553
|
getSoloTrackId: () => null,
|
|
3554
3554
|
getLoop: () => options.loop ?? false,
|
|
@@ -3594,7 +3594,7 @@ var playPlacements = (placements, options) => {
|
|
|
3594
3594
|
if (ctx.state === "suspended") resumes.push(ctx.resume());
|
|
3595
3595
|
if (resumes.length > 0) await Promise.all(resumes);
|
|
3596
3596
|
if (!playing) return;
|
|
3597
|
-
seq.start(0);
|
|
3597
|
+
seq.start(options.startStep ?? 0);
|
|
3598
3598
|
})();
|
|
3599
3599
|
const stop = () => {
|
|
3600
3600
|
if (!playing) return;
|
|
@@ -13242,7 +13242,7 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13242
13242
|
const seq = createSequencer({
|
|
13243
13243
|
getTracks: () => seqTracks,
|
|
13244
13244
|
getBpm: () => bpm,
|
|
13245
|
-
getPlayStartStep: () => 0,
|
|
13245
|
+
getPlayStartStep: () => options.startStep ?? 0,
|
|
13246
13246
|
getDrumPattern: () => drumPattern,
|
|
13247
13247
|
getSoloTrackId: () => null,
|
|
13248
13248
|
getLoop: () => options.loop ?? false,
|
|
@@ -13343,7 +13343,7 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13343
13343
|
Object.fromEntries([...customVocalByKey].map(([k, d]) => [k, d.url]))
|
|
13344
13344
|
);
|
|
13345
13345
|
}
|
|
13346
|
-
const streamTracks = buildStreamTracks(0);
|
|
13346
|
+
const streamTracks = buildStreamTracks(options.startStep ?? 0);
|
|
13347
13347
|
await voices.loadModels(streamTracks.map((t) => t.model));
|
|
13348
13348
|
if (!playing || destroyed) {
|
|
13349
13349
|
return playback;
|
|
@@ -13383,14 +13383,14 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13383
13383
|
loopStartSec = loopStartStep * secondsPerStep;
|
|
13384
13384
|
loopLengthSec = (loopEndStep - loopStartStep) * secondsPerStep;
|
|
13385
13385
|
}
|
|
13386
|
-
seq.start(0);
|
|
13386
|
+
seq.start(options.startStep ?? 0);
|
|
13387
13387
|
voices.setVolume(trackVolume / 100 * (masterVolume / 100));
|
|
13388
13388
|
voices.startStream(streamTracks, seq.getStartTime(), {
|
|
13389
13389
|
loopLengthSec,
|
|
13390
13390
|
loopStartSec
|
|
13391
13391
|
});
|
|
13392
13392
|
} else {
|
|
13393
|
-
seq.start(0);
|
|
13393
|
+
seq.start(options.startStep ?? 0);
|
|
13394
13394
|
}
|
|
13395
13395
|
} catch (err2) {
|
|
13396
13396
|
stop();
|
package/dist/index.mjs
CHANGED
|
@@ -3425,7 +3425,7 @@ var playPlacements = (placements, options) => {
|
|
|
3425
3425
|
const seq = createSequencer({
|
|
3426
3426
|
getTracks: () => seqTracks,
|
|
3427
3427
|
getBpm: () => bpm,
|
|
3428
|
-
getPlayStartStep: () => 0,
|
|
3428
|
+
getPlayStartStep: () => options.startStep ?? 0,
|
|
3429
3429
|
getDrumPattern: () => drumPattern,
|
|
3430
3430
|
getSoloTrackId: () => null,
|
|
3431
3431
|
getLoop: () => options.loop ?? false,
|
|
@@ -3471,7 +3471,7 @@ var playPlacements = (placements, options) => {
|
|
|
3471
3471
|
if (ctx.state === "suspended") resumes.push(ctx.resume());
|
|
3472
3472
|
if (resumes.length > 0) await Promise.all(resumes);
|
|
3473
3473
|
if (!playing) return;
|
|
3474
|
-
seq.start(0);
|
|
3474
|
+
seq.start(options.startStep ?? 0);
|
|
3475
3475
|
})();
|
|
3476
3476
|
const stop = () => {
|
|
3477
3477
|
if (!playing) return;
|
|
@@ -13119,7 +13119,7 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13119
13119
|
const seq = createSequencer({
|
|
13120
13120
|
getTracks: () => seqTracks,
|
|
13121
13121
|
getBpm: () => bpm,
|
|
13122
|
-
getPlayStartStep: () => 0,
|
|
13122
|
+
getPlayStartStep: () => options.startStep ?? 0,
|
|
13123
13123
|
getDrumPattern: () => drumPattern,
|
|
13124
13124
|
getSoloTrackId: () => null,
|
|
13125
13125
|
getLoop: () => options.loop ?? false,
|
|
@@ -13220,7 +13220,7 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13220
13220
|
Object.fromEntries([...customVocalByKey].map(([k, d]) => [k, d.url]))
|
|
13221
13221
|
);
|
|
13222
13222
|
}
|
|
13223
|
-
const streamTracks = buildStreamTracks(0);
|
|
13223
|
+
const streamTracks = buildStreamTracks(options.startStep ?? 0);
|
|
13224
13224
|
await voices.loadModels(streamTracks.map((t) => t.model));
|
|
13225
13225
|
if (!playing || destroyed) {
|
|
13226
13226
|
return playback;
|
|
@@ -13260,14 +13260,14 @@ var playSingingMML = async (mml, options = {}) => {
|
|
|
13260
13260
|
loopStartSec = loopStartStep * secondsPerStep;
|
|
13261
13261
|
loopLengthSec = (loopEndStep - loopStartStep) * secondsPerStep;
|
|
13262
13262
|
}
|
|
13263
|
-
seq.start(0);
|
|
13263
|
+
seq.start(options.startStep ?? 0);
|
|
13264
13264
|
voices.setVolume(trackVolume / 100 * (masterVolume / 100));
|
|
13265
13265
|
voices.startStream(streamTracks, seq.getStartTime(), {
|
|
13266
13266
|
loopLengthSec,
|
|
13267
13267
|
loopStartSec
|
|
13268
13268
|
});
|
|
13269
13269
|
} else {
|
|
13270
|
-
seq.start(0);
|
|
13270
|
+
seq.start(options.startStep ?? 0);
|
|
13271
13271
|
}
|
|
13272
13272
|
} catch (err2) {
|
|
13273
13273
|
stop();
|
package/package.json
CHANGED