diff --git a/scripts/test_rta_profile.mjs b/scripts/test_rta_profile.mjs index 8ff4df3..c62b202 100644 --- a/scripts/test_rta_profile.mjs +++ b/scripts/test_rta_profile.mjs @@ -8,7 +8,9 @@ assert.ok(functionSource, 'buildRtaRuntimeConfig must remain testable'); const context = vm.createContext({ Number, getRtwCenters(mode) { - return mode === '1_3' ? new Array(31).fill(0) : []; + if (mode === '1_12') return new Array(121).fill(0); + if (mode === '1_6') return new Array(61).fill(0); + return new Array(31).fill(0); }, }); vm.runInContext(functionSource.replace('export function', 'function'), context); @@ -24,10 +26,10 @@ const forced = context.buildRtaRuntimeConfig({ XY_POINTS: 256, }); assert.equal(forced.engine, 'iir'); -assert.equal(forced.bpo, '1_3'); +assert.equal(forced.bpo, '1_12'); assert.equal(forced.freqRange, 'norm'); assert.equal(forced.order, 6); -assert.equal(forced.rtwCenters.length, 31); +assert.equal(forced.rtwCenters.length, 121); assert.equal(forced.correlationResponseS, 2.5); assert.equal(forced.correlationResetToken, 7); assert.equal(forced.xyPoints, 256); @@ -54,8 +56,7 @@ const selectionContext = vm.createContext({ vm.runInContext(selectionSource, selectionContext); assert.equal(selectionContext.applyRtaBpoSelection('1_6'), '1_6'); assert.equal(selectionContext.CONFIG.RTA_BPO_MODE, '1_6'); -assert.equal(selectionContext.CONFIG.RTA_BAR_LAYOUT, 'iec'); -selectionContext.CONFIG.RTA_BAR_LAYOUT = 'rtw'; +assert.equal(selectionContext.CONFIG.RTA_BAR_LAYOUT, 'rtw'); assert.equal(selectionContext.applyRtaBpoSelection('1_3'), '1_3'); assert.equal(selectionContext.CONFIG.RTA_BAR_LAYOUT, 'rtw'); diff --git a/src/state.rs b/src/state.rs index 815ee23..fc3f1ff 100644 --- a/src/state.rs +++ b/src/state.rs @@ -368,7 +368,6 @@ fn normalize_rta_config(mut config: PhoenixRtaConfig) -> PhoenixRtaConfig { } if config.layout == "rtw" { config.engine = "iir".to_string(); - config.bpo = "1_3".to_string(); config.order = 6; config.freq_range = "norm".to_string(); } @@ -663,9 +662,6 @@ fn apply_global_to_rta( ) -> PhoenixRtaConfig { config.fft_size = global.fft_size; config.bpo = global.rta_bpo_mode.clone(); - if config.bpo != "1_3" && config.layout == "rtw" { - config.layout = "iec".to_string(); - } config.input_offset_db_l = global.input_offset_db_l; config.input_offset_db_r = global.input_offset_db_r; config.mono_input = global.mono_input; @@ -715,7 +711,7 @@ mod tests { use super::*; #[test] - fn rtw_profile_is_always_iir_third_octave() { + fn rtw_profile_is_iir_and_retains_selected_resolution() { let config = normalize_rta_config(PhoenixRtaConfig { engine: "fft".to_string(), bpo: "1_12".to_string(), @@ -725,7 +721,7 @@ mod tests { ..PhoenixRtaConfig::default() }); assert_eq!(config.engine, "iir"); - assert_eq!(config.bpo, "1_3"); + assert_eq!(config.bpo, "1_12"); assert_eq!(config.order, 6); assert_eq!(config.freq_range, "norm"); } @@ -749,11 +745,11 @@ mod tests { } #[test] - fn non_third_octave_global_selection_leaves_locked_rtw_profile() { + fn non_third_octave_global_selection_retains_rtw_profile() { let mut global = PhoenixGlobalConfig::default(); global.rta_bpo_mode = "1_12".to_string(); let config = apply_global_to_rta(PhoenixRtaConfig::default(), &global); - assert_eq!(config.layout, "iec"); + assert_eq!(config.layout, "rtw"); assert_eq!(config.bpo, "1_12"); assert_eq!(config.engine, "iir"); } diff --git a/www/core/audio.js b/www/core/audio.js index fede1e3..13fceff 100644 --- a/www/core/audio.js +++ b/www/core/audio.js @@ -868,7 +868,7 @@ export function buildRtaRuntimeConfig(CONFIG = {}) { const bpoMode = CONFIG.RTA_BPO_MODE || '1_3'; const layout = CONFIG.RTA_BAR_LAYOUT === 'rtw' ? 'rtw' : 'iec'; const rtwProfile = layout === 'rtw'; - const runtimeBpoMode = rtwProfile ? '1_3' : bpoMode; + const runtimeBpoMode = bpoMode; return { engine: rtwProfile ? 'iir' : (CONFIG.RTA_ENGINE || 'iir'), fftSize: CONFIG.FFT_SIZE || 4096, diff --git a/www/core/config.js b/www/core/config.js index 3289a81..6bad79c 100644 --- a/www/core/config.js +++ b/www/core/config.js @@ -285,11 +285,6 @@ const CONFIG_DEFAULTS = JSON.parse(JSON.stringify(CONFIG)); function applyRtaBpoSelection(value) { const mode = ['1_3', '1_6', '1_12'].includes(String(value)) ? String(value) : '1_3'; CONFIG.RTA_BPO_MODE = mode; - // RTW remains the original 31-band third-octave reference profile. Finer - // resolutions are Phoenix extensions and switch visibly to the IEC profile. - if (mode !== '1_3' && CONFIG.RTA_BAR_LAYOUT === 'rtw') { - CONFIG.RTA_BAR_LAYOUT = 'iec'; - } return mode; } const SOFTWARE_PRESET_IDS = Object.freeze(['default', 'claus', 'michael']); @@ -789,12 +784,8 @@ function loadConfig(opts = {}) { if (typeof saved.PPM_DIN_DECAY_DB_PER_S === 'number') CONFIG.PPM_DIN_DECAY_DB_PER_S = saved.PPM_DIN_DECAY_DB_PER_S; if (typeof saved.PPM_DIN_HOLD_MS === 'number') CONFIG.PPM_DIN_HOLD_MS = saved.PPM_DIN_HOLD_MS; if (CONFIG.RTA_BAR_LAYOUT === 'classic') CONFIG.RTA_BAR_LAYOUT = 'rtw'; - if (CONFIG.RTA_BAR_LAYOUT === 'rtw' && CONFIG.RTA_BPO_MODE !== '1_3') { - CONFIG.RTA_BAR_LAYOUT = 'iec'; - } if (CONFIG.RTA_BAR_LAYOUT === 'rtw') { CONFIG.RTA_ENGINE = 'iir'; - CONFIG.RTA_BPO_MODE = '1_3'; CONFIG.RTA_IIR_ORDER = 6; CONFIG.RTA_FREQ_RANGE = 'norm'; const hold = Number(CONFIG.RTA_PEAK_HOLD_SEC); @@ -1126,7 +1117,6 @@ function applyPhoenixGlobalConfig(payload = {}) { } if (CONFIG.RTA_BAR_LAYOUT === 'rtw') { CONFIG.RTA_ENGINE = 'iir'; - CONFIG.RTA_BPO_MODE = '1_3'; CONFIG.RTA_IIR_ORDER = 6; CONFIG.RTA_FREQ_RANGE = 'norm'; } diff --git a/www/index.html b/www/index.html index 0c9d15a..6e38890 100644 --- a/www/index.html +++ b/www/index.html @@ -310,7 +310,7 @@ - RTW verwendet fest 1/3; 1/6 und 1/12 wechseln automatisch zum IEC-/Phoenix-Profil. + Im RTW-Profil stehen 1/3, 1/6 und 1/12 Oktave mit der IIR-Filterbank zur Verfügung.