Skip to content

Commit

Permalink
Fix: channel - fader abstractions was not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
testmacPro authored and testmacPro committed Sep 2, 2019
1 parent 3034537 commit 5145b43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/yamahaQL1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const YamahaQL1: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: [{ mixerMessage: "1", value: 0, type: 'controlchange', min: 0, max: 127, zero: 100}], //PgmChange 0 - ignores this command
CHANNEL_FADER_LEVEL: [emptyMixerMessage()], //PgmChange 0 - ignores this command
CHANNEL_OUT_GAIN: [{ mixerMessage: "1", value: 0, type: 'controlchange', min: 0, max: 127, zero: 100}], //PgmChange 0 - ignores this command
CHANNEL_VU: [{ mixerMessage: "0", value: 0, type: 'f', min: 0, max: 127, zero: 100}], //PgmChange 0 - ignores this command
CHANNEL_NAME: [emptyMixerMessage()],
Expand Down
13 changes: 8 additions & 5 deletions src/utils/MidiMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export class MidiMixerConnection {
if (message.data[1] >= parseInt(this.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_OUT_GAIN[0].mixerMessage)
&& message.data[1] <= parseInt(this.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_OUT_GAIN[0].mixerMessage) + 24) {
let ch = 1 + message.data[1] - parseInt(this.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_OUT_GAIN[0].mixerMessage)
let faderChannel = this.store.channels[0].channel[ch - 1].assignedFader
let faderChannel = 1 + this.store.channels[0].channel[ch - 1].assignedFader
window.storeRedux.dispatch({
type:'SET_FADER_LEVEL',
type:'SET_CHANNEL_LEVEL',
channel: faderChannel -1,
level: message.data[2]
});
if (this.store.faders[0].fader[faderChannel - 1].pgmOn && this.mixerProtocol.mode === 'master')
if (this.store.faders[0].fader[faderChannel - 1].pgmOn || false && this.mixerProtocol.mode === 'master')
{
this.updateOutLevel(faderChannel-1);
}
Expand Down Expand Up @@ -120,23 +120,26 @@ return true;
}

updateOutLevel(channelIndex: number) {
if (this.mixerProtocol.mode === "master" && this.store.faders[0].fader[channelIndex].pgmOn) {
let faderIndex = this.store.channels[0].channel[channelIndex].assignedFader;
if (this.mixerProtocol.mode === "master" && this.store.faders[0].fader[faderIndex].pgmOn) {
window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: this.store.faders[0].fader[channelIndex].faderLevel
level: this.store.faders[0].fader[faderIndex].faderLevel
});
}
this.sendOutMessage(
this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_OUT_GAIN[0].mixerMessage,
channelIndex+1,
this.store.channels[0].channel[channelIndex].outputLevel
);
/* Client mode is disabled
this.sendOutMessage(
this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_FADER_LEVEL[0].mixerMessage,
channelIndex+1,
this.store.faders[0].fader[channelIndex].faderLevel
);
*/
}

updatePflState(channelIndex: number) {
Expand Down

0 comments on commit 5145b43

Please sign in to comment.