I was experimenting with this before. It is possible, though i haven't tried replicating my results in the latest build yet.
What i did in the normal XP, (without essentials) Is i cropped the music tune into two parts, namely the gym leader battle music.
The intro piece i put into the ME audio folder, and then the rest of the music into the BGM folder.
When a battle would come out, i told XP to play the ME effect for the battle, then i changed the battle BGM for the trainer fight as well (if nessesary) I worked very well in the standard build, but i haven't had a chance to replicate it in the current build of essentials.
Trying to replicate the results for wild pokemon has been less than successful. still trying to figure that out.