Skip to content

Commit ba4dbfe

Browse files
committed
Barrido largo, con sus tamaños de FFT y su retardo
Acción Settings: Long Sweep on / off y variable settings_long_sweep. Al cambiarlo se releen settings y generator, porque RiTA mueve el tamaño de FFT al apagarlo y sube la duración del barrido al encenderlo. El desplegable de FFT ya trae 128 FPPO y 65536, en el orden de RiTA, y el aviso de un tamaño rechazado da las tres razones posibles: Long Sweep, Spectrum o un find puesto. El retardo de canal llega a 1360 ms. La ayuda cuenta también que Sum y AVG son excluyentes desde la 2.8.1. Sin comprobar, porque el doble no puede encender Long Sweep (le faltan measureValues, measureSuma y DialogOptions): que se acepten los dos tamaños nuevos y el retardo por encima de 680 ms. Las pruebas lo dicen.
1 parent 5fadbfd commit ba4dbfe

5 files changed

Lines changed: 62 additions & 7 deletions

File tree

‎companion/HELP.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Requires **RiTA 2.8.0 or later**. With an older RiTA the module still connects a
1414
### Actions
1515

1616
- **Generator**: Spectrum on/off, signal, gain, duration, outputs.
17-
- **Settings**: FFT size, window, smoothing, spectrum averages, averaging, sum, plot style, coherence threshold, DSP type, DSP model, DSP mode, reference mode, measurement mode.
17+
- **Settings**: FFT size, window, smoothing, spectrum averages, averaging, sum, plot style, coherence threshold, Long Sweep, DSP type, DSP model, DSP mode, reference mode, measurement mode.
1818
- **Measurement**: capture, activate engine, find delay, set delay, set inputs, rename, sync all, clear find, clear delays, clear everything, export all.
1919
- **Memory**: store the trace of an engine, show/hide, rename, delete.
2020
- **AVG**: on/off, export impulse.
@@ -30,7 +30,11 @@ When RiTA would have shown a message box, it answers anyway and puts the text in
3030

3131
**Spectrum on/off** selects Spectrum if needed and measures it on the chosen engine; off stops it. It can run on several engines: deactivate one with **Measurement: activate engine**.
3232

33-
From RiTA 2.8.1 the **Spectrum** signal has no `64 FPPO` FFT size: choosing Spectrum moves the size to 32768 on its own, writing `64 FPPO` while it is selected is refused, and leaving Spectrum brings the size back. The module reads the settings again after every change of signal, so what the buttons show is what RiTA has.
33+
From RiTA 2.8.1 the **Spectrum** signal has no `64 FPPO` FFT size, nor `128 FPPO` or `65536`: choosing Spectrum moves the size to 32768 on its own, writing one of those while it is selected is refused, and leaving Spectrum brings the size back. The module reads the settings again after every change of signal, so what the buttons show is what RiTA has.
34+
35+
**Settings: Long Sweep on / off** is the Normal / Long Sweep switch of Preferences, off by default. On, each engine keeps 65536 samples instead of 32768, the FFT size list gains `128 FPPO` and `65536`, the sweep goes up to at least 2 s (1 s at 96 kHz) and the delay of a DSP channel reaches 1360 ms instead of 680. Off, the measurements are cut back to 32768 and a delay above 680 ms stays at 680. RiTA says in the log what it had to change, and the module reads the settings and the generator again afterwards, because switching it moves the FFT size and can raise the sweep duration. `$(rita:settings_long_sweep)` says whether it is on.
36+
37+
The FFT size dropdown offers every size RiTA can have, so it also lists the two that need Long Sweep. Asking for one RiTA is not offering at that moment is refused and the module says in the log which of the three reasons it is.
3438

3539
**Live TF** is not offered by RiTA 2.8.0: it is not in the signal list and the generator has no pink noise switch.
3640

@@ -64,7 +68,7 @@ The mode decides how much of the channel there is: how many EQ filters, which cr
6468

6569
**Mute groups** are the 4 assignable mute buttons of the external processor (DAP0408F, GALAXY, Marani…). Which channels belong to each group is set in RiTA, not from here, and a group can mix channels of several processors. *Toggle* does what the button does: it unmutes the group when every channel is muted, and mutes it otherwise. Feedbacks: **Mute group is muted** (red) and **Mute group has channels**; the name given in RiTA is in `$(rita:mute_group_N_name)`, so it can be the button text. A group with no channels on a connected processor answers "no channels", and a channel the processor did not take is written to the log.
6670

67-
**AVG** is RiTA's average of the **selected** engines (not the active ones). **AVG: on / off** is the same control as *Settings: averaging on/off*. **AVG: export impulse** writes the impulse response of the average to the Memory Bank folder, in the format chosen in RiTA; the export runs in the background and its result (or error, such as no export folder or AVG off) is written to the log.
71+
**AVG** is RiTA's average of the **selected** engines (not the active ones). **AVG: on / off** is the same control as *Settings: averaging on/off*. From RiTA 2.8.1 **AVG and Sum exclude each other**, like their buttons in RiTA: switching one on switches the other off, and the module follows both. **AVG: export impulse** writes the impulse response of the average to the Memory Bank folder, in the format chosen in RiTA; the export runs in the background and its result (or error, such as no export folder or AVG off) is written to the log.
6872

6973
**Measurement: sync all** is RiTA's Sync All (button and Y shortcut): it aligns with each other the engines that already have a measurement, without touching AVG. The new delays show up on the buttons at once and are written to the log. With no measured engine it answers "no active measurements".
7074

@@ -95,7 +99,7 @@ Connected, Mute group is muted, Mute group has channels, Sync All is set, Sync A
9599
### Variables
96100

97101
- `$(rita:generator_running)`, `generator_signal`, `generator_gain`, `generator_duration`, `generator_output1`, `generator_output2`
98-
- `$(rita:settings_fft_size)`, `settings_window`, `settings_smoothing`, `settings_spectrum_averages`, `settings_averaging`, `settings_sum`, `settings_coherence_threshold`, `settings_dsp_type`, `settings_dsp_model`, `settings_dsp_mode`, `settings_reference_mode`, `settings_measurement_mode`
102+
- `$(rita:settings_fft_size)`, `settings_window`, `settings_smoothing`, `settings_spectrum_averages`, `settings_averaging`, `settings_sum`, `settings_coherence_threshold`, `settings_dsp_type`, `settings_dsp_model`, `settings_dsp_mode`, `settings_long_sweep`, `settings_reference_mode`, `settings_measurement_mode`
99103
- `$(rita:sync_active)`, `sync_count`, `sync_possible`
100104
- `$(rita:mute_group_N_name)`, `mute_group_N_muted`, `mute_group_N_available` for N = 1..4
101105
- `$(rita:average_active)`, `average_has_data`, `average_count`, `average_engines`, `average_mode`, `average_name`

‎src/actions.ts‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const FIND_HINT = {
3535
// to 32768 by itself.
3636
const FFT_SIZE_HINT = {
3737
'unknown value':
38-
'RiTA refused the FFT size: with the Spectrum signal there is no 64 FPPO. And if a find is in place, a size that does not fit its delay is refused too: clear it with Measurement: clear find',
38+
'RiTA refused the FFT size. 128 FPPO and 65536 need Long Sweep on; the Spectrum signal has none of those three and no 64 FPPO either; and if a find is in place, a size that does not fit its delay is refused too: clear it with Measurement: clear find',
3939
}
4040

4141
// DSP Type reached the API after RiTA 2.8.0, and the list of processors can grow.
@@ -57,6 +57,11 @@ const XOVER_HINT = {
5757
'RiTA refused it. With a processor as DSP type, the crossover type and its order have to be ones that model and mode have; NXF only exists on some of them',
5858
}
5959

60+
// Long Sweep arrived with RiTA 2.8.1 as well.
61+
const LONG_SWEEP_HINT = {
62+
'unknown property': 'This RiTA has no Long Sweep (Preferences): it needs 2.8.1 or later',
63+
}
64+
6065
// The position of the exported files also arrived with 2.8.1, and before that it was a field
6166
// on RiTA's own screen that the API could not write.
6267
const POSITION_HINT = {
@@ -372,6 +377,22 @@ export function UpdateActions(self: ModuleInstance): void {
372377
await send('set', 'settings', { dspMode: mode }, DSP_MODEL_HINT)
373378
},
374379
},
380+
settings_long_sweep: {
381+
name: 'Settings: Long Sweep on / off',
382+
description:
383+
'The Normal / Long Sweep switch of Preferences. On, each engine keeps 65536 samples instead of 32768, the FFT ' +
384+
'size list gains 128 FPPO and 65536, the sweep goes up to at least 2 s (1 s at 96 kHz) and the channel delay ' +
385+
'reaches 1360 ms instead of 680. Off, the measurements are cut back to 32768. RiTA says in the log what it had ' +
386+
'to change. Needs RiTA 2.8.1 or later.',
387+
options: [modeOption],
388+
callback: async ({ options }) => {
389+
const wanted = resolveBool(options.mode, self.state.settings.longSweep)
390+
if (!(await send('set', 'settings', { longSweep: wanted }, LONG_SWEEP_HINT))) return
391+
// Switching it moves the FFT size and can raise the sweep duration, so both are read again.
392+
await self.refreshSettings()
393+
await self.refresh('generator')
394+
},
395+
},
375396
settings_export_position: {
376397
name: 'Settings: export position',
377398
description:
@@ -769,7 +790,15 @@ export function UpdateActions(self: ModuleInstance): void {
769790
name: 'DSP: set channel delay',
770791
options: [
771792
channelOption,
772-
{ type: 'number', id: 'delay', label: 'Delay (ms)', default: 0, min: 0, max: 680, step: 0.01 },
793+
{
794+
type: 'number',
795+
id: 'delay',
796+
label: 'Delay (ms). Over 680 needs Long Sweep',
797+
default: 0,
798+
min: 0,
799+
max: 1360,
800+
step: 0.01,
801+
},
773802
],
774803
callback: async ({ options }) => {
775804
await send('set', `dsp/out/${options.channel}`, { delay: Number(options.delay) })

‎src/choices.ts‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,23 @@ export const ON_OFF_TOGGLE_CHOICES: Choice[] = [
2222
export const SIGNAL_CHOICES = same(['Sweep', 'Multi Sweep', 'Pink', 'External', 'Spectrum'])
2323
export const DURATION_CHOICES: Choice[] = ['1', '2', '4', '8', '16'].map((v) => ({ id: v, label: `${v} s` }))
2424

25-
export const FFT_SIZE_CHOICES = same(['64 FPPO', '32768', '16384', '8192', '4096', '2048', '1024', '512', '256', '128'])
25+
// The sizes of RiTA's FFT dropdown, in its own order. 128 FPPO and 65536 are only there with
26+
// Long Sweep on, and the Spectrum signal has neither those nor 64 FPPO: anything RiTA is not
27+
// offering at that moment answers "unknown value".
28+
export const FFT_SIZE_CHOICES = same([
29+
'128 FPPO',
30+
'64 FPPO',
31+
'65536',
32+
'32768',
33+
'16384',
34+
'8192',
35+
'4096',
36+
'2048',
37+
'1024',
38+
'512',
39+
'256',
40+
'128',
41+
])
2642
export const WINDOW_CHOICES = same([
2743
'Rectangular',
2844
'Hamming',

‎src/state.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export interface SettingsState {
4949
measurementMode?: string
5050
// From RiTA 2.8.1 the position of the exported files lives only in the API.
5151
exportPosition?: string
52+
// Long Sweep: 65536 samples per engine instead of 32768.
53+
longSweep?: boolean
5254
fftSize?: string
5355
window?: string
5456
smoothing?: string
@@ -104,6 +106,7 @@ export const OPTIONAL_SETTINGS_PROPS = [
104106
'referenceMode',
105107
'measurementMode',
106108
'exportPosition',
109+
'longSweep',
107110
]
108111
export const OPTIONAL_SETTINGS_LABELS: Record<string, string> = {
109112
dspType: 'DSP Type',
@@ -112,6 +115,7 @@ export const OPTIONAL_SETTINGS_LABELS: Record<string, string> = {
112115
referenceMode: 'reference mode',
113116
measurementMode: 'measurement mode',
114117
exportPosition: 'export position',
118+
longSweep: 'Long Sweep',
115119
}
116120

117121
// RiTA changes fftSize on its own when Live TF starts with smoothing on, so it is followed, never restored.

‎src/variables.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export function UpdateVariableDefinitions(self: ModuleInstance): void {
2323
settings_dsp_model: { name: 'DSP model' },
2424
settings_dsp_mode: { name: 'DSP mode' },
2525
settings_export_position: { name: 'Export position' },
26+
settings_long_sweep: { name: 'Long Sweep on' },
2627
settings_reference_mode: { name: 'Reference mode' },
2728
settings_measurement_mode: { name: 'Measurement mode' },
2829
settings_fft_size: { name: 'FFT size' },
@@ -82,6 +83,7 @@ export function UpdateVariableValues(self: ModuleInstance): void {
8283
settings_dsp_model: self.state.settings.dspModel ?? '',
8384
settings_dsp_mode: self.state.settings.dspMode ?? '',
8485
settings_export_position: self.state.settings.exportPosition ?? '',
86+
settings_long_sweep: onOff(self.state.settings.longSweep, 'ON', 'OFF'),
8587
settings_reference_mode: self.state.settings.referenceMode ?? '',
8688
settings_measurement_mode: self.state.settings.measurementMode ?? '',
8789
settings_fft_size: self.state.settings.fftSize ?? '',

0 commit comments

Comments
 (0)