Surround Panning not panning 100% to the front
By Steve Bissinger @sbiss2021-09-24 17:29:30.257Z2021-09-24 21:23:05.301Z
I've been using this surround panning macro for a long time, but recently noticed this script is panning the front/rear to 95% instead of 100%. Can you identify why this is happening? Is there a better way to do it?
//Config
var howWide = 100;
//Reset pan first
if (sf.ui.proTools.selectedTrack.outputWindowButton.value.invalidate().value !== 'open')
sf.ui.proTools.selectedTrack.trackOutputToggleShow();
sf.ui.proTools.trackOutputWindowResetPan();
var win = sf.ui.proTools.mainTrackOutputWindow;
//Enable preview
sf.ui.proTools.automationPreview({ targetValue: 'Enable' });
//Get the two front pan knobs
var pans = win.children.whoseTitle.is("Front Pan Knob").allItems;
//Step through decrementing (turning left) Front Left pan, and incrementing (turning right) Front Right pan
//thus widening the pan (because we start at center)
var steps = Math.floor(howWide / 13);
for (var i = 0; i < steps; i++) {
pans[0].elementClick({ actionName: 'AXDecrement' });
pans[1].elementClick({ actionName: 'AXIncrement' });
}
//Get the two f/r pan knobs
var pan2 = win.children.whoseTitle.is("F/R Pan Knob").allItems;
//Step through decrementing (turning left) Left F/R pan, and incrementing (turning right) Right F/R pan
//thus widening the pan (because we start at center)
var steps = Math.floor(howWide / 100);
for (var i = 0; i < steps; i++) {
pan2[0].elementClick({ actionName: 'AXDecrement' });
pan2[1].elementClick({ actionName: 'AXDecrement' });
}
//Get the two rear pan knobs
var pan3 = win.children.whoseTitle.is("Rear Pan Knob").allItems;
//Step through decrementing (turning left) Left Rear pan, and incrementing (turning right) Right Rear pan
//thus widening the pan (because we start at center)
var steps = Math.floor(howWide / 13);
for (var i = 0; i < steps; i++) {
pan3[0].elementClick({ actionName: 'AXDecrement' });
pan3[1].elementClick({ actionName: 'AXIncrement' });
}
sf.ui.proTools.automationWriteAutoToSelectionAndCloseWindows({ autoConfirmation: true });
//Enable preview
sf.ui.proTools.automationPreview({ targetValue: 'Disable' });