fix: make Q optional in EQ import regex for shelf filters
This commit is contained in:
parent
eae8655877
commit
0cfff0b0b2
2 changed files with 4 additions and 4 deletions
|
|
@ -1014,13 +1014,13 @@ class AudioContextManager {
|
|||
|
||||
// Parse filter lines (handle "Filter:" and "Filter X:" formats)
|
||||
const filterMatch = line.match(
|
||||
/^Filter\s*\d*:\s*ON\s+(\w+)\s+Fc\s+(\d+)\s+Hz\s+Gain\s*([+-]?\d+\.?\d*)\s*dB\s+Q\s+(\d+\.?\d*)/i
|
||||
/^Filter\s*\d*:\s*ON\s+(\w+)\s+Fc\s+(\d+)\s+Hz\s+Gain\s*([+-]?\d+\.?\d*)\s*dB(?:\s+Q\s+(\d+\.?\d*))?/i
|
||||
);
|
||||
if (filterMatch) {
|
||||
const type = filterMatch[1].toUpperCase();
|
||||
const freq = parseInt(filterMatch[2], 10);
|
||||
const gain = parseFloat(filterMatch[3]);
|
||||
const q = parseFloat(filterMatch[4]);
|
||||
const q = filterMatch[4] ? parseFloat(filterMatch[4]) : Math.SQRT1_2;
|
||||
filters.push({ type, freq, gain, q });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -661,13 +661,13 @@ export class Equalizer {
|
|||
|
||||
// Parse filter lines (handle "Filter:" and "Filter X:" formats)
|
||||
const filterMatch = line.match(
|
||||
/^Filter\s*\d*:\s*ON\s+(\w+)\s+Fc\s+(\d+)\s+Hz\s+Gain\s*([+-]?\d+\.?\d*)\s*dB\s+Q\s+(\d+\.?\d*)/i
|
||||
/^Filter\s*\d*:\s*ON\s+(\w+)\s+Fc\s+(\d+)\s+Hz\s+Gain\s*([+-]?\d+\.?\d*)\s*dB(?:\s+Q\s+(\d+\.?\d*))?/i
|
||||
);
|
||||
if (filterMatch) {
|
||||
const type = filterMatch[1].toUpperCase();
|
||||
const freq = parseInt(filterMatch[2], 10);
|
||||
const gain = parseFloat(filterMatch[3]);
|
||||
const q = parseFloat(filterMatch[4]);
|
||||
const q = filterMatch[4] ? parseFloat(filterMatch[4]) : Math.SQRT1_2;
|
||||
filters.push({ type, freq, gain, q });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue