Skip to content

Commit a85bdc2

Browse files
committed
Remove unintended sampler.js changes
1 parent 7dc5697 commit a85bdc2

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

js/widgets/sampler.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ function SampleWidget() {
305305
* @returns {void}
306306
*/
307307
this.__save = function () {
308-
const that = this;
308+
var that = this;
309309
setTimeout(function () {
310310
that._addSample();
311311

312312
// Include the cent adjustment value in the sample block
313313
const centAdjustment = that.centAdjustmentValue || 0;
314314

315-
const newStack = [
315+
var newStack = [
316316
[0, "settimbre", 100, 100, [null, 1, null, 5]],
317317
[
318318
1,
@@ -493,16 +493,10 @@ function SampleWidget() {
493493
}
494494

495495
docById("wheelDivptm").style.display = "none";
496-
if (this._pitchWheel !== undefined) {
496+
if (!this.pitchWheel === undefined) {
497497
this._pitchWheel.removeWheel();
498-
}
499-
if (this._exitWheel !== undefined) {
500498
this._exitWheel.removeWheel();
501-
}
502-
if (this._accidentalsWheel !== undefined) {
503499
this._accidentalsWheel.removeWheel();
504-
}
505-
if (this._octavesWheel !== undefined) {
506500
this._octavesWheel.removeWheel();
507501
}
508502
this.pitchAnalysers = {};
@@ -1906,16 +1900,16 @@ function SampleWidget() {
19061900
// Set initial note display
19071901
const noteObj = TunerUtils.frequencyToPitch(
19081902
A0 *
1909-
Math.pow(
1910-
2,
1911-
(pitchToNumber(
1912-
SOLFEGENAMES[this.pitchCenter] +
1913-
EXPORTACCIDENTALNAMES[this.accidentalCenter],
1914-
this.octaveCenter
1915-
) -
1916-
57) /
1917-
12
1918-
)
1903+
Math.pow(
1904+
2,
1905+
(pitchToNumber(
1906+
SOLFEGENAMES[this.pitchCenter] +
1907+
EXPORTACCIDENTALNAMES[this.accidentalCenter],
1908+
this.octaveCenter
1909+
) -
1910+
57) /
1911+
12
1912+
)
19191913
);
19201914
this.tunerDisplay.update(noteObj[0], noteObj[1], this.centsValue);
19211915

@@ -2336,6 +2330,7 @@ function SampleWidget() {
23362330
instruments[0][instrumentName].playbackRate.value = playbackRate;
23372331
} else {
23382332
// If the instrument doesn't exist yet, we'll apply the adjustment when playing
2333+
console.log("Instrument not found, will apply cent adjustment during playback");
23392334
}
23402335
}
23412336

0 commit comments

Comments
 (0)