Skip to content

Commit

Permalink
fix: skaarhoj rotary enc handle fast rotary
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed May 6, 2020
1 parent 2534b89 commit e554b8a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions server/utils/remoteConnections/SkaarhojRemoteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,26 @@ export class SkaarhojRemoteConnection {
command.slice(command.indexOf('#') + 1, command.indexOf('='))
)
let event = command.slice(command.indexOf('=') + 1)
let level = 0
if (btnNumber > 6 && btnNumber < 11) {
let channel = btnNumber - 7
let level = state.faders[0].fader[channel].faderLevel
if (event === 'Enc:1') {
level = state.faders[0].fader[channel].faderLevel + 0.01
level += 0.01
if (level > 1) {
level = 1
}
} else if (event === 'Enc:2') {
level += 0.1
if (level < 0) {
level = 0
}
} else if (event === 'Enc:-1') {
level = state.faders[0].fader[channel].faderLevel - 0.01
level -= 0.01
if (level < 0) {
level = 0
}
} else if (event === 'Enc:-2') {
level -= 0.1
if (level < 0) {
level = 0
}
Expand Down

0 comments on commit e554b8a

Please sign in to comment.