diff --git a/v3/src/sound/WebAudioSoundManager.js b/v3/src/sound/WebAudioSoundManager.js index ab20cf440..d8c861e2b 100644 --- a/v3/src/sound/WebAudioSoundManager.js +++ b/v3/src/sound/WebAudioSoundManager.js @@ -101,4 +101,21 @@ Object.defineProperty(WebAudioSoundManager.prototype, 'rate', { }, this); } }); +/** + * Global detune. + * @property {number} detune + */ +Object.defineProperty(WebAudioSoundManager.prototype, 'detune', { + get: function () { + return this._detune; + }, + set: function (value) { + this._detune = value; + this.sounds.forEach(function (sound) { + // invoke sound's detune setter method to update + // value based on new global detune value + sound.detune = sound.detune; + }, this); + } +}); module.exports = WebAudioSoundManager;