audio-mixer-engine 1.3.8 → 1.3.9
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.
|
@@ -2666,7 +2666,7 @@ class FU {
|
|
|
2666
2666
|
U = c.straight ? null : c;
|
|
2667
2667
|
}
|
|
2668
2668
|
if (!U) return l;
|
|
2669
|
-
const { first: F, second: Z, swingType: d } = U, Q = d === "sixteenth" ? this.ticksPerBeat / 2 : this.ticksPerBeat, R = Q / 2, W = Q * F / (F + Z), n = Math.floor(l / Q), m = l - n * Q;
|
|
2669
|
+
const { first: F, second: Z, swingType: d } = U, Q = d === "sixteenth" || d === "16th" ? this.ticksPerBeat / 2 : this.ticksPerBeat, R = Q / 2, W = Q * F / (F + Z), n = Math.floor(l / Q), m = l - n * Q;
|
|
2670
2670
|
let t;
|
|
2671
2671
|
return m <= R ? t = m * W / R : t = W + (m - R) * (Q - W) / R, Math.round(n * Q + t);
|
|
2672
2672
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audio-mixer-engine",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "Audio engine library for audio mixer applications with MIDI parsing, playback, and synthesis",
|
|
5
5
|
"main": "dist/audio-mixer-engine.cjs.js",
|
|
6
6
|
"module": "dist/audio-mixer-engine.es.js",
|
|
@@ -129,8 +129,8 @@ export class TimingEngine {
|
|
|
129
129
|
const { first, second, swingType } = active;
|
|
130
130
|
|
|
131
131
|
// Swing unit: the note-pair duration that gets swung
|
|
132
|
-
// 'eighth' → quarter note = ticksPerBeat; 'sixteenth' → eighth note = ticksPerBeat/2
|
|
133
|
-
const swingUnit = swingType === 'sixteenth'
|
|
132
|
+
// 'eighth' → quarter note = ticksPerBeat; 'sixteenth'/'16th' → eighth note = ticksPerBeat/2
|
|
133
|
+
const swingUnit = (swingType === 'sixteenth' || swingType === '16th')
|
|
134
134
|
? this.ticksPerBeat / 2
|
|
135
135
|
: this.ticksPerBeat;
|
|
136
136
|
|