¿Addon for "Advanced Animated Menu"?

I don't know if you are familiar with Blackmorning's Advanced Animated Menu, which is a new menu for your project, which adds the ability to put music in the menu.

Well, I've been wondering if it is possible to make an Addon for this script, that makes each character have its own menu BGM, and that sounds depending on who is the leader.

If it is possible to add that functionality, I will be reading.
I don't know it you still need but here is an addon I coded.
You just need to set in MUSIC[:actor_bgm] and MUSIC[:actor_bgs] what you want and it will work. (if you set no entry, then the DEFAULT_BGM/ DEFAULT_BGS will be used).

Ruby:
#==============================================================================
# Advanced Animated Menu - leader music addon
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 30/05/2025
# Requires: Blackmorning's Advanced Animated Menu
#==============================================================================
# This addon allows the main menu to have a BGM and BGS specific to the current
# leader. If the party formation changes the current leader, then the music will
# change too.
#
# To setup your actor music, add entries to MUSIC[:actor_bgm] and MUSIC[:actor_bgs]
# An entry will be:
# actor_id => [filename, volume, pitch]
# If actor x has no entry, then DEFAULT_BGM and DEFAULT_BGS will be used instead
#==============================================================================
# Terms of use: free for commercial and non-commercial project, crediting me
# is not required, follow Blackmorning's term of uses
#==============================================================================

$imported = {} if $imported.nil?
$imported["TIM-AAM-LEADER-MUSIC"] = true

#==============================================================================
# BM
#==============================================================================
module BM
  module MENU
                  #name, volume, pitch
    DEFAULT_BGM = ["Theme4",100,100]
    DEFAULT_BGS = ["", 100,100]
    
    MUSIC[:actor_bgm] = {
      #actor_id => [bgm, volume, pitch]
      1 => ["Theme2",100],
      2 => ["Battle2",100],
    }
    
    MUSIC[:actor_bgs] = {
      #actor_id => [bgs, volume, pitch]
      1 => ["",100],
    }
    
    #--------------------------------------------------------------------------
    # new method: get_bgm
    #--------------------------------------------------------------------------
    def self.get_bgm(actor_id)
      return MUSIC[:actor_bgm][actor_id] if MUSIC[:actor_bgm][actor_id]
      DEFAULT_BGM
    end
    
    #--------------------------------------------------------------------------
    # new method: get_bgs
    #--------------------------------------------------------------------------
    def self.get_bgs(actor_id)
      return MUSIC[:actor_bgs][actor_id] if MUSIC[:actor_bgs][actor_id]
      DEFAULT_BGS
    end
  end #MENU
end #BM

#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp 
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias tim_aamlm_menu_init initialize
  def initialize
    tim_aamlm_menu_init
    set_menu_music(nil)
  end
  #--------------------------------------------------------------------------
  # new method: set_menu_music
  #--------------------------------------------------------------------------
  def set_menu_music(actor)
    actor_id = 0
    actor_id = actor.id if actor
    @menu_bgm = RPG::BGM.new(*BM::MENU.get_bgm(actor_id))
    @menu_bgs = RPG::BGS.new(*BM::MENU.get_bgs(actor_id))
  end
end #Game_Temp

#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias tim_aamlm_start start
  def start
    $game_temp.set_menu_music($game_party.leader)
    tim_aamlm_start
  end
 
  #--------------------------------------------------------------------------
  # alias method: on_formation_ok
  #--------------------------------------------------------------------------
  alias tim_aamlm_on_formation_ok on_formation_ok
  def on_formation_ok
    former_leader = $game_party.leader
    tim_aamlm_on_formation_ok
    if former_leader != $game_party.leader
      $game_temp.set_menu_music($game_party.leader)
      play_menu_bgm
    end
  end
end #Scene_Menu
I don't know it you still need but here is an addon I coded.
You just need to set in MUSIC[:actor_bgm] and MUSIC[:actor_bgs] what you want and it will work. (if you set no entry, then the DEFAULT_BGM/ DEFAULT_BGS will be used).

Ruby:
#==============================================================================
# Advanced Animated Menu - leader music addon
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 30/05/2025
# Requires: Blackmorning's Advanced Animated Menu
#==============================================================================
# This addon allows the main menu to have a BGM and BGS specific to the current
# leader. If the party formation changes the current leader, then the music will
# change too.
#
# To setup your actor music, add entries to MUSIC[:actor_bgm] and MUSIC[:actor_bgs]
# An entry will be:
# actor_id => [filename, volume, pitch]
# If actor x has no entry, then DEFAULT_BGM and DEFAULT_BGS will be used instead
#==============================================================================
# Terms of use: free for commercial and non-commercial project, crediting me
# is not required, follow Blackmorning's term of uses
#==============================================================================

$imported = {} if $imported.nil?
$imported["TIM-AAM-LEADER-MUSIC"] = true

#==============================================================================
# BM
#==============================================================================
module BM
  module MENU
                  #name, volume, pitch
    DEFAULT_BGM = ["Theme4",100,100]
    DEFAULT_BGS = ["", 100,100]
   
    MUSIC[:actor_bgm] = {
      #actor_id => [bgm, volume, pitch]
      1 => ["Theme2",100],
      2 => ["Battle2",100],
    }
   
    MUSIC[:actor_bgs] = {
      #actor_id => [bgs, volume, pitch]
      1 => ["",100],
    }
   
    #--------------------------------------------------------------------------
    # new method: get_bgm
    #--------------------------------------------------------------------------
    def self.get_bgm(actor_id)
      return MUSIC[:actor_bgm][actor_id] if MUSIC[:actor_bgm][actor_id]
      DEFAULT_BGM
    end
   
    #--------------------------------------------------------------------------
    # new method: get_bgs
    #--------------------------------------------------------------------------
    def self.get_bgs(actor_id)
      return MUSIC[:actor_bgs][actor_id] if MUSIC[:actor_bgs][actor_id]
      DEFAULT_BGS
    end
  end #MENU
end #BM

#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias tim_aamlm_menu_init initialize
  def initialize
    tim_aamlm_menu_init
    set_menu_music(nil)
  end
  #--------------------------------------------------------------------------
  # new method: set_menu_music
  #--------------------------------------------------------------------------
  def set_menu_music(actor)
    actor_id = 0
    actor_id = actor.id if actor
    @menu_bgm = RPG::BGM.new(*BM::MENU.get_bgm(actor_id))
    @menu_bgs = RPG::BGS.new(*BM::MENU.get_bgs(actor_id))
  end
end #Game_Temp

#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias tim_aamlm_start start
  def start
    $game_temp.set_menu_music($game_party.leader)
    tim_aamlm_start
  end
 
  #--------------------------------------------------------------------------
  # alias method: on_formation_ok
  #--------------------------------------------------------------------------
  alias tim_aamlm_on_formation_ok on_formation_ok
  def on_formation_ok
    former_leader = $game_party.leader
    tim_aamlm_on_formation_ok
    if former_leader != $game_party.leader
      $game_temp.set_menu_music($game_party.leader)
      play_menu_bgm
    end
  end
end #Scene_Menu
Wow, Thank you! I'll test it when I have time, again, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/addon-for-advanced-animated-menu.177325/