This commit is contained in:
Jade (Rose) Rowland 2025-05-07 11:25:34 -04:00
parent 59bdfd2cb8
commit 099d321dbd
2 changed files with 16 additions and 10 deletions

View File

@ -441,6 +441,11 @@ export function resetGlobalEffects() {
} }
let activeSoundSources = new Map(); let activeSoundSources = new Map();
//music programs/audio gear usually increments inputs/outputs from 1, we need to subtract 1 from the input because the webaudio API channels start at 0
function mapChannelNumbers(channels) {
return (Array.isArray(channels) ? channels : [value.channels]).map((ch) => ch - 1);
}
export const superdough = async (value, t, hapDuration) => { export const superdough = async (value, t, hapDuration) => {
const ac = getAudioContext(); const ac = getAudioContext();
@ -539,14 +544,10 @@ export const superdough = async (value, t, hapDuration) => {
compressorRelease, compressorRelease,
} = value; } = value;
//music programs/audio gear usually increments inputs/outputs from 1, we need to subtract 1 from the input because the webaudio API channels start at 0 const orbitChannels = mapChannelNumbers(
const orbitChannels = ( multiChannelOrbits && orbit > 0 ? [orbit * 2 - 1, orbit * 2] : getDefaultValue('channels'),
multiChannelOrbits && orbit > 0 ? [orbit * 2 - 1, orbit * 2] : getDefaultValue('channels') );
).map((ch) => ch - 1); const channels = value.channels != null ? mapChannelNumbers(value.channels) : orbitChannels;
const channels =
value.channels != null
? (Array.isArray(value.channels) ? value.channels : [value.channels]).map((ch) => ch - 1)
: orbitChannels;
gain = applyGainCurve(nanFallback(gain, 1)); gain = applyGainCurve(nanFallback(gain, 1));
postgain = applyGainCurve(postgain); postgain = applyGainCurve(postgain);

View File

@ -168,8 +168,13 @@ export function SettingsTab({ started }) {
label="Multi Channel Orbits" label="Multi Channel Orbits"
onChange={(cbEvent) => { onChange={(cbEvent) => {
const val = cbEvent.target.checked; const val = cbEvent.target.checked;
settingsMap.setKey('multiChannelOrbits', val); confirmDialog(RELOAD_MSG).then((r) => {
setMultiChannelOrbits(val); if (r == true) {
settingsMap.setKey('multiChannelOrbits', val);
setMultiChannelOrbits(val);
return window.location.reload();
}
});
}} }}
value={multiChannelOrbits} value={multiChannelOrbits}
/> />