MZ Adding a music box mode

Hey, I was wondering if there are any plugins that add a music box mode to the game where you can listen to the music used in the game.
I found some that were for MV, but now seeing as my project has moved over to MZ, I couldn't find any...
I think you'd need to provide a bit more information about what you're looking for. I don't know of any plugins that do anything like this, but it's also a bit unclear what you actually want from your post.

For example, I actually did something like this without any plugins. If interested, you can open the spoiler box. It adds an NPC in one of the town maps that lets you choose a different background track for that map.

Spoiler
I have collectible items representing each of the tracks that you can listen to. The main event looks something like this (I stripped out a few bits related to other plugins):

Code:
◆Script:$gameSystem.requestedMusicTracks = $gameSystem.requestedMusicTracks || {}
◆Save BGM
◆Fadeout BGM:1 second
◆Text:People4(2), Window, Bottom
:    :Yes, did you want something?
◆Show Choices:Change Track, No (Window, Right, #2, #2)
:When Change Track 
  ◆Control Variables:#0012 Random = PubTrack
  ◆Text:Actor1(0), Window, Bottom
  :    :I wondered if you could play a different
  :    :song.
  ◆Text:People4(2), Window, Bottom
  :    :Sure, what would you like?
  ◆Select Item:PubTrack, Hidden Item B
  ◆If:PubTrack > 0
    ◆Control Switches:#0171 PubTrack = OFF
    ◆Script:var track = $gameVariables.value(76); // PubTrack
    :      :$gameSystem.requestedMusicTracks[track] = true;
    ◆
  :Else
    ◆Control Variables:#0076 PubTrack = Random
    ◆Replay BGM
    ◆
  :End
  ◆
:When No 
  ◆Text:Actor1(0), Window, Bottom
  :    :Not really, just listening to the music.
  ◆Replay BGM
  ◆
:End

The script calls aren't strictly necessary – they just keep track of whether or not you've ever requested each track before. I used this to make an achievement for listening to all of them at least once, but I cut out the code to actually implement that for this example. This event is just set to Action Trigger. It just lets you select a track – it doesn't actually switch to it.

To make the track switching actually function, there's a second event set to Autorun that looks like this:

Code:
◆If:PubTrack = 0
  ◆Control Variables:#0076 PubTrack = 108
  ◆
:End
◆Script:var bgmItem = $gameVariables.value(76); // PubTrack
:      :var bgmTrack = $dataItems[bgmItem].meta.bgm;
:      :var bgm = {
:      :  "name": bgmTrack,
:      :  "pan": 0,
:      :  "pitch": 100,
:      :  "volume": 90
:      :};
:      :AudioManager.playBgm(bgm);
◆Control Switches:#0171 PubTrack = ON

Then it also has a second page that's activated if the PubTrack switch is on, which just does nothing. So, in other words, that event is triggered when the first event turns off the PubTrack switch.

The last step to make that work is to create items of type Hidden Item B and put a <bgm:Castle1> note tag in each one that specifies which track it represents. Also, if you want to use Exclude Unused files, you may want to add a plugin with the following:

JavaScript:
/*:
@noteParam bgm
@noteRequire 1
@noteDir audio/bgm/
@noteType file
@noteData items
*/

That just makes the Exclude Unused Files feature read the <bgm> note tag and make sure to include any files you reference from there. However, it's not needed if all those tracks are also used in other places.

Though I used this approach in MV, I'm pretty sure it'll work in MZ too. If needed, you could probably modify it to draw the list of tracks from something other than items.
I think you'd need to provide a bit more information about what you're looking for. I don't know of any plugins that do anything like this, but it's also a bit unclear what you actually want from your post.

For example, I actually did something like this without any plugins. If interested, you can open the spoiler box. It adds an NPC in one of the town maps that lets you choose a different background track for that map.

Spoiler
I have collectible items representing each of the tracks that you can listen to. The main event looks something like this (I stripped out a few bits related to other plugins):

Code:
◆Script:$gameSystem.requestedMusicTracks = $gameSystem.requestedMusicTracks || {}
◆Save BGM
◆Fadeout BGM:1 second
◆Text:People4(2), Window, Bottom
:    :Yes, did you want something?
◆Show Choices:Change Track, No (Window, Right, #2, #2)
:When Change Track
  ◆Control Variables:#0012 Random = PubTrack
  ◆Text:Actor1(0), Window, Bottom
  :    :I wondered if you could play a different
  :    :song.
  ◆Text:People4(2), Window, Bottom
  :    :Sure, what would you like?
  ◆Select Item:PubTrack, Hidden Item B
  ◆If:PubTrack > 0
    ◆Control Switches:#0171 PubTrack = OFF
    ◆Script:var track = $gameVariables.value(76); // PubTrack
    :      :$gameSystem.requestedMusicTracks[track] = true;
    ◆
  :Else
    ◆Control Variables:#0076 PubTrack = Random
    ◆Replay BGM
    ◆
  :End
  ◆
:When No
  ◆Text:Actor1(0), Window, Bottom
  :    :Not really, just listening to the music.
  ◆Replay BGM
  ◆
:End

The script calls aren't strictly necessary – they just keep track of whether or not you've ever requested each track before. I used this to make an achievement for listening to all of them at least once, but I cut out the code to actually implement that for this example. This event is just set to Action Trigger. It just lets you select a track – it doesn't actually switch to it.

To make the track switching actually function, there's a second event set to Autorun that looks like this:

Code:
◆If:PubTrack = 0
  ◆Control Variables:#0076 PubTrack = 108
  ◆
:End
◆Script:var bgmItem = $gameVariables.value(76); // PubTrack
:      :var bgmTrack = $dataItems[bgmItem].meta.bgm;
:      :var bgm = {
:      :  "name": bgmTrack,
:      :  "pan": 0,
:      :  "pitch": 100,
:      :  "volume": 90
:      :};
:      :AudioManager.playBgm(bgm);
◆Control Switches:#0171 PubTrack = ON

Then it also has a second page that's activated if the PubTrack switch is on, which just does nothing. So, in other words, that event is triggered when the first event turns off the PubTrack switch.

The last step to make that work is to create items of type Hidden Item B and put a <bgm:Castle1> note tag in each one that specifies which track it represents. Also, if you want to use Exclude Unused files, you may want to add a plugin with the following:

JavaScript:
/*:
@noteParam bgm
@noteRequire 1
@noteDir audio/bgm/
@noteType file
@noteData items
*/

That just makes the Exclude Unused Files feature read the <bgm> note tag and make sure to include any files you reference from there. However, it's not needed if all those tracks are also used in other places.

Though I used this approach in MV, I'm pretty sure it'll work in MZ too. If needed, you could probably modify it to draw the list of tracks from something other than items.
Well, I wanted it to look like the images below.
In a separate menu rather than just an event.
I edited the earlier state description scene I made to show and play music (with a BG pic). But you'd need to restore the help window functionality to show currently playing track name in separate window and add those play/pause buttons. Oh and add to the scene pop to start playing the saved BGM from when you open the scene. (Currently put 3 song names to the _data array)

Spoiler
function Scene_MusicBox() {
this.initialize(...arguments);
}

Scene_MusicBox.prototype = Object.create(Scene_ItemBase.prototype);
Scene_MusicBox.prototype.constructor = Scene_MusicBox;

Scene_MusicBox.prototype.initialize = function() {
Scene_ItemBase.prototype.initialize.call(this);
};

Scene_MusicBox.prototype.create = function() {
this.createBackground();
Scene_ItemBase.prototype.create.call(this);
this.createMusicBoxWindow();
this._MusicBoxWindow.activate();
this._MusicBoxWindow.selectLast();
this._MusicBoxWindow.refresh();
};

Scene_MusicBox.prototype.createBackground = function() {
this._backSprite = new Sprite();
this._backSprite.bitmap = ImageManager.loadSystem("Splash");
this.addChild(this._backSprite);
};

Scene_MusicBox.prototype.createMusicBoxWindow = function() {
const rect = this.MusicBoxWindowRect();
this._MusicBoxWindow = new Window_MusicBox(rect);
// this._MusicBoxWindow.setHelpWindow(this._helpWindow);
this._MusicBoxWindow.setHandler("cancel", this.popScene.bind(this));
this.addWindow(this._MusicBoxWindow);
};

Scene_MusicBox.prototype.MusicBoxWindowRect = function() {
const wx = 400;
const wy = 200;
const ww = 400;
const wh = 400;
return new Rectangle(wx, wy, ww, wh);
};


Scene_MusicBox.prototype.createButtonAssistWindow = function() {

};


function Window_MusicBox() {
this.initialize(...arguments);
}

Window_MusicBox.prototype = Object.create(Window_Selectable.prototype);
Window_MusicBox.prototype.constructor = Window_MusicBox;

Window_MusicBox.prototype.initialize = function(rect) {
Window_Selectable.prototype.initialize.call(this, rect);
this._data = ["Battle1", "Battle2", "Battle3"]
};

Window_MusicBox.prototype.maxCols = function() {
return 2;
};

Window_MusicBox.prototype.colSpacing = function() {
return 16;
};

Window_MusicBox.prototype.maxItems = function() {
return this._data ? this._data.length : 1;
};

Window_MusicBox.prototype.item = function() {
return this.itemAt(this.index());
};

Window_MusicBox.prototype.itemAt = function(index) {
return this._data && index >= 0 ? this._data[index] : null;
};

Window_MusicBox.prototype.selectLast = function() {
this.forceSelect(0);
};

Window_MusicBox.prototype.drawItem = function(index) {
const item = this.itemAt(index);
if (item) {
const rect = this.itemLineRect(index);
this.drawText(item, rect.x, rect.y, rect.width);
}
};

Window_MusicBox.prototype.refresh = function() {
Window_Selectable.prototype.refresh.call(this);
};

Window_MusicBox.prototype.processOk = function() {
if (this.isCurrentItemEnabled()) {
this.playOkSound();
const bgmName = this.item();
AudioManager.playBgm({ name: bgmName, volume: 100, pitch: 100 });
} else {
this.playBuzzerSound();
}
};

Window_MusicBox.prototype.drawItemName = function(item, x, y, width) {
if (item) {
const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
const textMargin = ImageManager.iconWidth + 4;
const itemWidth = Math.max(0, width - textMargin);
this.resetTextColor();
// this.drawIcon(item.iconIndex, x, iconY);
this.drawText(item, x + textMargin, y, itemWidth);
}
};

Window_MusicBox.prototype.updateHelp = function() {

};

Window_MusicBox.prototype.isOkEnabled = function() {
return true;
};

Scene_MusicBox.prototype.terminate = function() {
Scene_Base.prototype.terminate.call(this);
if (this._backgroundSprite) {
this._backgroundSprite.bitmap.destroy();
}
};

Original thread: https://forums.rpgmakerweb.com/threads/adding-a-music-box-mode.182249/