Well, if FRLG are anything like Emerald in terms of how they select the fanfare to play, there will be code which checks what type of item it is (by checking what pocket in the bag it goes into) and selecting a sensible one based on that. (Reason I know this is that I actually added a new fanfare to Emerald).
However, it probably doesn't work like that given that it uses only one fanfare. I may try to add a system in the same style as Emerald that handles all of this in the background.
ETA: Emerald checks what fanfare to play and then calls a script that actually takes care of playing the fanfare, by the looks, FR acts the same way.