-- Generated by EQ'ing DT-770 frequency response to the Harman Linear Bass
-- curve on squig.link.
-- luacheck: ignore 111 113
local args = {
  ["node.description"] = "DT770 Equalizer Sink",
  ["media.name"]       = "DT770 Equalizer Sink",
  ["audio.position"]   = Json.Array { "FL", "FR" },
  ["audio.channels"]   = 2,
}

args["filter.graph"] = Json.Object {
  nodes = Json.Array {
    Json.Object {
      type    = "builtin",
      name    = "eq_band_1",
      label   = "bq_highshelf",
      control = Json.Object { Freq = 0, Gain = -4.7, Q = 1.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_2",
      label   = "bq_peaking",
      control = Json.Object { Freq = 45, Gain = -5.6, Q = 0.9 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_3",
      label   = "bq_peaking",
      control = Json.Object { Freq = 85, Gain = 2.6, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_4",
      label   = "bq_lowshelf",
      control = Json.Object { Freq = 120, Gain = -2.1, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_5",
      label   = "bq_peaking",
      control = Json.Object { Freq = 200, Gain = 5.3, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_6",
      label   = "bq_peaking",
      control = Json.Object { Freq = 1800, Gain = 1.4, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_7",
      label   = "bq_peaking",
      control = Json.Object { Freq = 2700, Gain = -4.1, Q = 1.7 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_8",
      label   = "bq_peaking",
      control = Json.Object { Freq = 3700, Gain = 10.6, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_9",
      label   = "bq_peaking",
      control = Json.Object { Freq = 4300, Gain = -3.8, Q = 2.0 },
    },
    Json.Object {
      type    = "builtin",
      name    = "eq_band_10",
      label   = "bq_peaking",
      control = Json.Object { Freq = 5300, Gain = -3.7, Q = 1.2 },
    },
  },
  links = Json.Array {
    Json.Object { output = "eq_band_1:Out" , input = "eq_band_2:In"  },
    Json.Object { output = "eq_band_2:Out" , input = "eq_band_3:In"  },
    Json.Object { output = "eq_band_3:Out" , input = "eq_band_4:In"  },
    Json.Object { output = "eq_band_4:Out" , input = "eq_band_5:In"  },
    Json.Object { output = "eq_band_5:Out" , input = "eq_band_6:In"  },
    Json.Object { output = "eq_band_6:Out" , input = "eq_band_7:In"  },
    Json.Object { output = "eq_band_7:Out" , input = "eq_band_8:In"  },
    Json.Object { output = "eq_band_8:Out" , input = "eq_band_9:In"  },
    Json.Object { output = "eq_band_9:Out" , input = "eq_band_10:In" },
  },
}

args["capture.props"] = Json.Object {
  ["node.name"]   = "dt770_effect_input.eq10",
  ["media.class"] = "Audio/Sink",
}

args["playback.props"] = Json.Object {
  ["node.name"]    = "dt770_effect_output.eq10",
  ["node.passive"] = true,
}

local args_json   = Json.Object(args)
local args_string = args_json:get_data()
local properties  = {}

print("Loading DT770 Equalizer Sink with arguments = ")
print(args_string)

filter_chain = LocalModule("libpipewire-module-filter-chain", args_string, properties)
