A script to show the current BGM playing?

So In my game I would love to show the current soundtrack playing...
I've found this script
but this script displays a blank box if no music is playing
which I don't want. Is there a modification
you could make to this script so that
you can cut it off via switch or variable.

Can someone also move this thread to the RGGS thread
I accidentally posted here.
Try changing this:

Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  self.open
end

to this:

Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  if $currentBGMName
    self.open
  else
    self.close
  end
end
Moved to: RGSSx Script Support
Try changing this:

Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  self.open
end

to this:

Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  if $currentBGMName
    self.open
  else
    self.close
  end
end
Sorry that didn't work... It's still showing blank
That part should be this:
Spoiler
Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  self.open if $currentBGMName && $currentBGMName != ""
end
At least I think, but I haven't tested it.
That part should be this:
Spoiler
Code:
if $currentBGMName != RPG::BGM.last.name
  $currentBGMName = RPG::BGM.last.name
  self.open if $currentBGMName && $currentBGMName != ""
end
At least I think, but I haven't tested it.
That works fine thanks dude!

Original thread: https://forums.rpgmakerweb.com/threads/a-script-to-show-the-current-bgm-playing.104681/