From 73dbc824110da1436f471bb54f8da29710bf06e3 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 14 Nov 2017 14:36:34 -0500 Subject: [PATCH] Get number of drums from drum info array --- src/extensions/scratch3_music/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/extensions/scratch3_music/index.js b/src/extensions/scratch3_music/index.js index e0b2ca262..84bd46798 100644 --- a/src/extensions/scratch3_music/index.js +++ b/src/extensions/scratch3_music/index.js @@ -425,8 +425,7 @@ class Scratch3MusicBlocks { let drum = Cast.toNumber(args.DRUM); drum = Math.round(drum); drum -= 1; // drums are one-indexed - if (typeof this.runtime.audioEngine === 'undefined') return; - drum = MathUtil.wrapClamp(drum, 0, this.runtime.audioEngine.numDrums - 1); + drum = MathUtil.wrapClamp(drum, 0, this.DRUM_INFO.length - 1); let beats = Cast.toNumber(args.BEATS); beats = this._clampBeats(beats); if (util.target.audioPlayer !== null) {