This repository was archived by the owner on Dec 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,12 @@ export class ControllerMidi extends EventEmitter {
223
223
224
224
updateButtonsViaStateInstant ( buttonStates ) {
225
225
buttonStates . forEach ( ( btn ) => {
226
- this . send ( btn . state || 'noteoff' , {
226
+ let state = ( btn . state || 'noteoff' ) . toLowerCase ( )
227
+ if ( [ 'flashingon' , 'flashingoff' ] . includes ( state ) ) {
228
+ btn . state = ( state === 'flashingon' ) ? 'flashingoff' : 'flashingon'
229
+ state = ( state === 'flashingon' ) ? 'noteoff' : 'noteon'
230
+ }
231
+ this . send ( state , {
227
232
note : btn . note ,
228
233
velocity : btn . value || btn . defaultValue || 0 ,
229
234
channel : btn . channel || this . config ?. midi ?. outputChannel || 10 ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { ControllerKeyboard } from './ControllerKeyboard.js'
13
13
14
14
import { asArray , map , getEnumByValue } from './utils.js'
15
15
16
- const MIDI_RESEND_INTERVAL = 1000 // ms
16
+ const MIDI_RESEND_INTERVAL = 500 // ms
17
17
18
18
export class ControlThemAll {
19
19
constructor ( ) {
@@ -590,6 +590,13 @@ export class ControlThemAll {
590
590
this . updateButtonState ( btns , { state : 'noteon' , value : 127 } , 'note' )
591
591
}
592
592
593
+ switchButtonLightFlashing ( btns ) {
594
+ btns = asArray ( btns )
595
+ // console.log(`switchButtonLightFlashing:`, btns)
596
+ btns = btns . map ( ( btn ) => { return { note : btn } } )
597
+ this . updateButtonState ( btns , { state : 'flashingon' , value : 127 } , 'note' )
598
+ }
599
+
593
600
switchButtonLightOff ( btns ) {
594
601
btns = asArray ( btns )
595
602
// console.log(`switchButtonLightOff:`, btns)
@@ -730,7 +737,7 @@ export class ControlThemAll {
730
737
this . updateDveButtons ( )
731
738
732
739
if ( state . video . mixEffects [ me ] . fadeToBlack . isFullyBlack ) {
733
- this . switchButtonLightOn ( this . getButtonsByAction ( 'FadeToBlack' ) )
740
+ this . switchButtonLightFlashing ( this . getButtonsByAction ( 'FadeToBlack' ) )
734
741
} else {
735
742
this . switchButtonLightOff ( this . getButtonsByAction ( 'FadeToBlack' ) )
736
743
}
You can’t perform that action at this time.
0 commit comments