Skip to content

Commit

Permalink
fix: Update gain level in redux store so a change of volume while fad…
Browse files Browse the repository at this point in the history
…ing doesn´t jump back to gain from before last fade start

feat: Reaper Master mode (mainly for testing)
  • Loading branch information
olzzon committed Jun 3, 2019
1 parent ed855c0 commit 68ae069
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/constants/MixerProtocolPresets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ArdourMaster } from './mixerProtocols/ardourMaster';
import { Reaper } from './mixerProtocols/reaper';
import { ReaperMaster } from './mixerProtocols/reaperMaster';
import { BehringerXrMaster } from './mixerProtocols/behringerXrMaster';
import { BehringerXrClient } from './mixerProtocols/behringerXrClient';
import { MidasMaster } from './mixerProtocols/midasMaster';
Expand Down Expand Up @@ -55,6 +56,7 @@ interface IMessageProtocol {
export const MixerProtocolPresets: { [key: string]: IMixerProtocol } = {
ardourMaster: ArdourMaster,
reaper: Reaper,
reaperMaster: ReaperMaster,
behringerxrmaster: BehringerXrMaster,
behringerxrclient: BehringerXrClient,
midasMaster: MidasMaster,
Expand Down
62 changes: 62 additions & 0 deletions src/constants/mixerProtocols/reaperMaster.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { IMixerProtocol } from '../MixerProtocolPresets';

export const ReaperMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Reaper DAW Master mode(reaper.fm)',
mode: "master", //master (ignores mixers faderlevel, and use faderlevel as gain preset),
//client (use feedback from mixers fader level)
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [
{
oscMessage: "/note_in_use",
value: 0,
type: "f"
}
],
pingTime: 0, //Bypass ping when pingTime is zero
initializeCommands: [
{
oscMessage: "/note_in_use",
value: 0,
type: "f"
}
],
fromMixer: {
CHANNEL_FADER_LEVEL: 'none',
CHANNEL_OUT_GAIN: '/track/{channel}/volume',
CHANNEL_VU: '/track/{channel}/vu',
CHANNEL_NAME: '/track/{channel}/name',
GRP_OUT_GAIN: '/dca/{channel}/fader',
GRP_VU: 'none',
GRP_NAME: '/dca/{channel}/config/name',
PFL: 'todo'
},
toMixer: {
CHANNEL_FADER_LEVEL: 'none',
CHANNEL_OUT_GAIN: '/track/{channel}/volume',
GRP_OUT_GAIN: '/dca/{channel}/fader',
PFL_ON: {
oscMessage: "/track/{channel}/solo",
value: 1,
type: "i"
},
PFL_OFF: {
oscMessage: "/track/{channel}/solo",
value: 0,
type: "i"
}
},
fader: {
min: 0,
max: 1,
zero: 0.75,
step: 0.01,
fadeTime: 40, //Total time for a fade in ms.
},
meter: {
min: 0,
max: 1,
zero: 0.75,
test: 0.6,
},
}
18 changes: 18 additions & 0 deletions src/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ export class MixerConnection {
outputLevel += step;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);

window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});

if ( outputLevel <= targetVal){
outputLevel = targetVal;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);
Expand All @@ -124,6 +130,12 @@ export class MixerConnection {
outputLevel += step;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);

window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});

if ( outputLevel >= targetVal ) {
outputLevel = targetVal;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);
Expand Down Expand Up @@ -155,6 +167,12 @@ export class MixerConnection {
outputLevel -= step;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);

window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});

if ( outputLevel <= min ){
outputLevel=min;
this.mixerConnection.updateFadeIOLevel(channelIndex, outputLevel);
Expand Down

0 comments on commit 68ae069

Please sign in to comment.