From 40afcc55d826c0f731f4c64e1f5698b167f0b4aa Mon Sep 17 00:00:00 2001 From: Olzzon Date: Thu, 23 Jan 2020 11:11:09 +0100 Subject: [PATCH] fix: Recived Midas Ratio has value from 0 to 11 and not 0 to 1 --- server/constants/mixerProtocols/midasMaster.ts | 2 +- server/utils/mixerConnections/OscMixerConnection.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/constants/mixerProtocols/midasMaster.ts b/server/constants/mixerProtocols/midasMaster.ts index bb08659c..e1c77b17 100644 --- a/server/constants/mixerProtocols/midasMaster.ts +++ b/server/constants/mixerProtocols/midasMaster.ts @@ -117,7 +117,7 @@ export const MidasMaster: IMixerProtocol = { PFL: [emptyMixerMessage()], NEXT_SEND: [emptyMixerMessage()], THRESHOLD: [{ mixerMessage: '/ch/{channel}/dyn/thr', value: 0, type: 'f', min: 0, max: 1, zero: 0}], - RATIO: [{ mixerMessage: '/ch/{channel}/dyn/ratio', value: 0, type: 'f', min: 0, max: 1, zero: 0}], + RATIO: [{ mixerMessage: '/ch/{channel}/dyn/ratio', value: 0, type: 'f', min: 0, max: 11, zero: 0}], LOW: [{ mixerMessage: '/ch/{channel}/eq/1/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}], LO_MID: [{ mixerMessage: '/ch/{channel}/eq/2/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}], MID: [{ mixerMessage: '/ch/{channel}/eq/3/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}], diff --git a/server/utils/mixerConnections/OscMixerConnection.ts b/server/utils/mixerConnections/OscMixerConnection.ts index 770eee96..1405a362 100644 --- a/server/utils/mixerConnections/OscMixerConnection.ts +++ b/server/utils/mixerConnections/OscMixerConnection.ts @@ -194,12 +194,14 @@ export class OscMixerConnection { global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader) } else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer .RATIO[0].mixerMessage)) { - let ch = message.address.split("/")[this.cmdChannelIndex]; + let ch = message.address.split("/")[this.cmdChannelIndex] + let ratio = this.mixerProtocol.channelTypes[0].fromMixer.RATIO[0] + let level = message.args[0] / ((ratio.max-ratio.min) + ratio.min) store.dispatch({ type: SET_FADER_RATIO, channel: state.channels[0].channel[ch - 1].assignedFader, - level: message.args[0] - }); + level: level + }) global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader) } else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer .LOW[0].mixerMessage)) {