diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-05-16 19:51:58 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-05-16 19:51:58 +0200 |
commit | 77ebfdaa99c3fa9a88362b5cc015d9d205a68510 (patch) | |
tree | 7e22d6af66876e42873e692d8670772972ef2b92 /res | |
parent | 31b62638cc7c9491548cbe0b70d38593d9aa5e5a (diff) |
Roland DJ-505: Improve VU meter / peak indicator LEDs
Diffstat (limited to 'res')
-rw-r--r-- | res/controllers/Roland_DJ-505-scripts.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/res/controllers/Roland_DJ-505-scripts.js b/res/controllers/Roland_DJ-505-scripts.js index 4a8eb9d859..96c89e875e 100644 --- a/res/controllers/Roland_DJ-505-scripts.js +++ b/res/controllers/Roland_DJ-505-scripts.js @@ -566,7 +566,17 @@ DJ505.Deck = function (deckNumbers, offset) { midi: [0xB0 + offset, 0x1F], group: "[Channel" + deckNumbers + "]", outKey: "VuMeter", - max: 0x2A, + output: function (value, group, control) { + // The red LEDs light up with MIDI values greater than 0x24. The + // maximum brightness is reached at value 0x28. Red LEDs should + // only be illuminated if the track is clipping. + if (engine.getValue(group, "PeakIndicator") === 1) { + value = 0x28; + } else { + value = Math.round(value * 0x24); + } + this.send(value); + }, }); }; |