bmc0 / dsp

An audio processing program with an interactive mode.
ISC License
219 stars 31 forks source link

Add support for Channel command in Room EQ Wizard conversion script #30

Closed seanbow closed 6 years ago

seanbow commented 6 years ago

Simple modification to support the Channel: x specification when converting from EqualizerAPO / Room EQ Wizard scripts.

bmc0 commented 6 years ago

Good idea. I can see a few problems though:

  1. Does not allow specifying multiple channels.
  2. Channels are numbered from 1 in Equalizer APO and from 0 in my program.
  3. Equalizer APO supports non-numeric identifiers (such as L and SUB), which my program does not.

1 and 2 can be fixed pretty easily:

--- a/scripts/rew_to_dsp.sh
+++ b/scripts/rew_to_dsp.sh
@@ -12,6 +12,12 @@ AWK_SCRIPT='
    if ($1=="Preamp:" && $2!=0) {
        print "gain", $2
    }
+   else if ($1=="Channel:") {
+       printf(":%s", $2-1)
+       for (i=3; i<=NF; ++i)
+           printf(",%s", $i-1)
+       print ""
+   }
    else if ($1=="Filter" && $3=="ON") {
        if ($4=="PK" && $9!=0) {
            gsub(",", "", $6)

3 is not so easy to fix, though maybe it doesn't really matter.