iTunes のイコライザ設定

明けましておめでとうございます。

どうも iTunes のイコライザには、どんなジャンルでもいい感じになるという Perfect という設定と、それを超える Eargasm Explosion というのがあるらしい。手でポチポチ設定するのもいいけど、せっかくこういう仕事しているんだからそれっぽいやり方をしよう。

for Windows (PowerShell)

$ITunes = New-Object -ComObject iTunes.Application

$Preset = $ITunes.EQPresets.ItemByName("Perfect")
if (-not $Preset) {
  $Preset = $ITunes.CreateEQPreset("Perfect")
  $Preset.Band1 = 3
  $Preset.Band2 = 6
  $Preset.Band3 = 9
  $Preset.Band4 = 7
  $Preset.Band5 = 6
  $Preset.Band6 = 5
  $Preset.Band7 = 7
  $Preset.Band8 = 9
  $Preset.Band9 = 11
  $Preset.Band10 = 8
}

$Preset = $ITunes.EQPresets.ItemByName("Eargasm Explosion")
if (-not $Preset) {
  $Preset = $ITunes.CreateEQPreset("Eargasm Explosion")
  $Preset.Band1 = 3
  $Preset.Band2 = 6
  $Preset.Band3 = 9
  $Preset.Band4 = 7
  $Preset.Band5 = 6
  $Preset.Band6 = 5
  $Preset.Band7 = 7
  $Preset.Band8 = 4
  $Preset.Band9 = 11
  $Preset.Band10 = 8
}

ちなみに VBScript でもいい

for macOS (AppleScript)

tell application "iTunes"
  set found_perfect to false
  set found_eargasm to false

  repeat with preset in EQ presets
    if name of preset is "Perfect" then
      set found_perfect to true
    else if name of preset is "Eargasm Explosion" then
      set found_eargasm to true
    end if
  end repeat

  if not found_perfect then
    set preset to make new EQ preset
    set name of preset to "Perfect"
    set band 1 of preset to 3
    set band 2 of preset to 6
    set band 3 of preset to 9
    set band 4 of preset to 7
    set band 5 of preset to 6
    set band 6 of preset to 5
    set band 7 of preset to 7
    set band 8 of preset to 9
    set band 9 of preset to 11
    set band 10 of preset to 8
  end if

  if not found_eargasm then
    set preset to make new EQ preset
    set name of preset to "Eargasm Explosion"
    set band 1 of preset to 3
    set band 2 of preset to 6
    set band 3 of preset to 9
    set band 4 of preset to 7
    set band 5 of preset to 6
    set band 6 of preset to 5
    set band 7 of preset to 7
    set band 8 of preset to 4
    set band 9 of preset to 11
    set band 10 of preset to 8
  end if
end tell

はじめて書いた