Skip to content

Instantly share code, notes, and snippets.

@PaulWieland
Last active May 5, 2021 19:57
Show Gist options
  • Save PaulWieland/a20d47102fc62c9fbe17c9d65396ca0b to your computer and use it in GitHub Desktop.
Save PaulWieland/a20d47102fc62c9fbe17c9d65396ca0b to your computer and use it in GitHub Desktop.
Convert Room EQ Wizard Filters to LADSPA ACDf asoundrc format
var i = 0;
/* Paste in equalizer setting from Room EQ Wizard */
var x = `
Filter 4: ON PK Fc 86.7 Hz Gain -7.4 dB Q 4.165
Filter 7: ON PK Fc 112 Hz Gain 18.0 dB Q 5.692
Filter 8: ON PK Fc 126 Hz Gain -14.5 dB Q 9.308
Filter 9: ON PK Fc 154 Hz Gain -12.8 dB Q 4.865
Filter 10: ON PK Fc 210 Hz Gain -13.0 dB Q 3.347
Filter 11: ON PK Fc 285 Hz Gain -3.3 dB Q 5.000
Filter 12: ON PK Fc 390 Hz Gain -18.3 dB Q 4.312
Filter 13: ON PK Fc 547 Hz Gain -13.7 dB Q 5.000
Filter 14: ON PK Fc 675 Hz Gain -5.2 dB Q 5.000
Filter 15: ON PK Fc 825 Hz Gain -9.7 dB Q 5.000
Filter 16: ON PK Fc 1040 Hz Gain -2.4 dB Q 4.976
Filter 19: ON PK Fc 2514 Hz Gain -4.0 dB Q 1.000
Filter 20: ON PK Fc 4682 Hz Gain -2.6 dB Q 5.000`
/* convert the filter string to an array of arrays structure */
var arr = x.trim().replace(/ +/g,"\t").split("\n").map(e => e.split("\t"));
var str = `pcm.!default {
type plug
slave.pcm equalizer
}
pcm.equalizer {
type ladspa
path "/usr/lib/ladspa"
channels 2
slave {
pcm "plughw:0"
}
plugins {
`;
arr.forEach(e => {
var db = e[8];
var freq = e[5];
var q = e[11];
for(var j=0; j<=1; j++){
str +=
` ${i} {
label ACDf
policy none
input.bindings.${j} "Input"
output.bindings.${j} "Output"
input { controls [26 1 ${db} ${freq} ${q} 1 1]}
}
`;
i++;
}
});
str += `
}
}
`;
/* put the asoundrc file into the clipboard */
copy(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment