Play Sound Effect when character joins/leaves party

Hi!
I was wondering if its possibly to autoplay a sound or music effect when a character joins or leaves. Right now I have it set up as a common event that I have to add to the events, but adding it everywhere is quite cumbersome and I would rather automate the process.
Yeah, one would need to alias Game_Party's add_actor and remove_actor methods and then add the SE there.
Aliasing add/remove actors would be too chaotic. Because the add/remove actor function could be used anywhere. The actor joining and leaving the party usually comes from an event, it is safer to add the play SE function in the Game_Interpreter instead.

EDIT:
Here, this might work. Please change the SE name on the code. Too lazy to parameterize it lol
Ruby:
class Game_Interpreter
  def command_129
    actor = $game_actors[@params[0]]
    if actor
      if @params[1] == 0    # Add
        if @params[2] == 1  # Initialize
          $game_actors[@params[0]].setup(@params[0])
        end
        RPG::SE.new("SE Name on actor add").play
        $game_party.add_actor(@params[0])
      else                  # Remove
        RPG::SE.new("SE name on actor remove").play
        $game_party.remove_actor(@params[0])
      end
    end
  end
end
At least ask @BCj if that's what the game actually needs. What if it should sound even if the actor gets removed via a menu?
Yes that works 😀 Thanks!
So far characters only join/leave in events.
The only option I have in the menu is to swap them, but they don't leave.
The first search from the keyword "add_actor" shows up that it is also used to initialize the battle test actors. You wouldn't want to play SE on battle test 😀

Besides, they clearly stated about doing tedious things in the event.

Original thread: https://forums.rpgmakerweb.com/threads/play-sound-effect-when-character-joins-leaves-party.160667/