mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Get number of drums from drum info array
This commit is contained in:
parent
14e2ca8d99
commit
73dbc82411
1 changed files with 1 additions and 2 deletions
|
@ -425,8 +425,7 @@ class Scratch3MusicBlocks {
|
||||||
let drum = Cast.toNumber(args.DRUM);
|
let drum = Cast.toNumber(args.DRUM);
|
||||||
drum = Math.round(drum);
|
drum = Math.round(drum);
|
||||||
drum -= 1; // drums are one-indexed
|
drum -= 1; // drums are one-indexed
|
||||||
if (typeof this.runtime.audioEngine === 'undefined') return;
|
drum = MathUtil.wrapClamp(drum, 0, this.DRUM_INFO.length - 1);
|
||||||
drum = MathUtil.wrapClamp(drum, 0, this.runtime.audioEngine.numDrums - 1);
|
|
||||||
let beats = Cast.toNumber(args.BEATS);
|
let beats = Cast.toNumber(args.BEATS);
|
||||||
beats = this._clampBeats(beats);
|
beats = this._clampBeats(beats);
|
||||||
if (util.target.audioPlayer !== null) {
|
if (util.target.audioPlayer !== null) {
|
||||||
|
|
Loading…
Reference in a new issue