smplr 0.13.2 → 0.13.3
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 +9 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1122,7 +1122,7 @@ function findFirstSampleInRegions(group, sample, seqNumber) {
|
|
|
1122
1122
|
return void 0;
|
|
1123
1123
|
}
|
|
1124
1124
|
function findSampleInRegion(midi, seqNum, sample, region, defaults) {
|
|
1125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
1125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
1126
1126
|
const matchMidi = midi >= ((_a = region.midiLow) != null ? _a : 0) && midi < ((_b = region.midiHigh) != null ? _b : 127) + 1;
|
|
1127
1127
|
if (!matchMidi)
|
|
1128
1128
|
return void 0;
|
|
@@ -1139,15 +1139,16 @@ function findSampleInRegion(midi, seqNum, sample, region, defaults) {
|
|
|
1139
1139
|
const velocity = (_f = sample.velocity) != null ? _f : defaults.velocity;
|
|
1140
1140
|
const regionGainOffset = region.volume ? dbToGain(region.volume) : 0;
|
|
1141
1141
|
const sampleGainOffset = (_h = (_g = sample.gainOffset) != null ? _g : defaults.gainOffset) != null ? _h : 0;
|
|
1142
|
+
const sampleDetune = (_i = sample.detune) != null ? _i : 0;
|
|
1142
1143
|
return {
|
|
1143
|
-
decayTime: (
|
|
1144
|
-
detune: 100 * (semitones + ((
|
|
1145
|
-
duration: (
|
|
1144
|
+
decayTime: (_l = (_k = sample == null ? void 0 : sample.decayTime) != null ? _k : (_j = region.sample) == null ? void 0 : _j.decayTime) != null ? _l : defaults.decayTime,
|
|
1145
|
+
detune: 100 * (semitones + ((_m = region.tune) != null ? _m : 0)) + sampleDetune,
|
|
1146
|
+
duration: (_p = (_o = sample == null ? void 0 : sample.duration) != null ? _o : (_n = region.sample) == null ? void 0 : _n.duration) != null ? _p : defaults.duration,
|
|
1146
1147
|
gainOffset: sampleGainOffset + regionGainOffset || void 0,
|
|
1147
|
-
loop: (
|
|
1148
|
-
loopEnd: (
|
|
1149
|
-
loopStart: (
|
|
1150
|
-
lpfCutoffHz: (
|
|
1148
|
+
loop: (_s = (_r = sample == null ? void 0 : sample.loop) != null ? _r : (_q = region.sample) == null ? void 0 : _q.loop) != null ? _s : defaults.loop,
|
|
1149
|
+
loopEnd: (_v = (_u = sample == null ? void 0 : sample.loopEnd) != null ? _u : (_t = region.sample) == null ? void 0 : _t.loopEnd) != null ? _v : defaults.loopEnd,
|
|
1150
|
+
loopStart: (_y = (_x = sample == null ? void 0 : sample.loopStart) != null ? _x : (_w = region.sample) == null ? void 0 : _w.loopStart) != null ? _y : defaults.loopStart,
|
|
1151
|
+
lpfCutoffHz: (_B = (_A = sample == null ? void 0 : sample.lpfCutoffHz) != null ? _A : (_z = region.sample) == null ? void 0 : _z.lpfCutoffHz) != null ? _B : defaults.lpfCutoffHz,
|
|
1151
1152
|
name: region.sampleName,
|
|
1152
1153
|
note: midi,
|
|
1153
1154
|
onEnded: sample.onEnded,
|