Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
134
Reaction score
284
First Language
English
Primarily Uses
RMMV
Original Plugin:


Now For MV!

Introduction

With permission and at the request of several others in the original thread, I am publicly releasing my quick-and-dirty MV conversion of @MushroomCake28's excellent MZ audio plugin, MUSH Audio Engine. It's not perfect, but should be better than nothing for those who want this plugin on MV!


Features:
From original thread:

  • New BGM/BGS system that allows multiple BGMs/BGSs to be played at the same time.
  • Added 2 optional extra channels to control volume separately: one channel for UI sound effects called UIS, and one channel for voice acting called VSC.
  • Added a master volume option.
  • Spatial Audio for BGM, BGS, and SE (volume and pan dynamically varies depending on player position to audio source(s)).
  • Pitch and Volume variance for SE/UIS on each play.
  • Ability to load the parent map's autoplay BGM if the current map doesn't have one.

Instructions:
See original thread. The only substantive difference in usage is the plugin commands. MZ uses a UI interface for plugin commands, but for MV, you enter the plugin commands as written text. Take note as some of the commands are rather long.

Every argument is required, in the exact order shown, or things will almost certainly break. Every argument is also case-sensitive. You can put 0 for fadeIn/fadeOut if not used.

For explanations of the individual arguments and what to put there, refer to the original thread. Follow the spelling and case setting described/shown in the photos. The ONLY meaningful difference is that for the PanType, you want to use either "LinearScaling" or "OriginExpand" (without the quotes, cap sensitive, and note the lack of a space). The space was removed for ease of processing the plugin commands.


MV Plugin Commands:

  • PlayBGM Filename Channel Pitch AutoRemover Volume Pan FadeIn Interrupt
  • PlayBGS Filename Channel Pitch AutoRemover Volume Pan FadeIn Interrupt
  • StopBGM Channel FadeOut
  • StopBGS Channel FadeOut
  • StopAllBGM FadeOut
  • StopAllBGS FadeOut
  • AddSpacialBGM Filename Channel Pitch Dynamic MaxVolume Radius Strength PanType PanStartDistance PanLengthDistance CrossFade
  • AddSpacialBGS Filename Channel Pitch Dynamic MaxVolume Radius Strength PanType PanStartDistance PanLengthDistance
  • PlaySpatialSE Filename Pitch PitchVariance VolumeVariance MaxVolume EventId Radius Strength PanType PanStartDistance PanLengthDistance
  • PlayVSC Filename Channel Pitch Volume Pan Interrupt

MushPluginComs.png

Plugin Command Examples:

PlayVSC AreYouReady 2 80 70 0 Ignore
- Plays the file "AreYouReady.ogg" from the /vsc folder on Vsc channel 2 with pitch 80, volume 70, pan 0, and "Ignore" interrupt setting

PlayBGM Town1 1 100 true 45 0 3 Pause
- Plays the file "Town1.ogg" from the /bgm folder using BGM channel 1 with pitch 100, AutoRemover "true", volume 45, pan 0, fadeIn of 3 secs, and "Pause" interrupt setting

AddSpacialBGS Sea 1001 100 false 70 8 100 OriginExpand 3 6
- Adds a spacial BGS playing file "Sea.ogg" from the /bgs folder using BGS channel 1001 with pitch 100, dynamic "false", max volume 70, radius 8, strength 100, pan type OriginExpand, pan start distance 3, pan length distance 6




Known Issues:
- Playing MEs does not mute/pause BGS or Mush BGM. Playing MEs is supposed to automatically stop any BGM or BGS (default or Mush) and resume them when the ME is finished. Unfortunately this behavior works only for RM's default BGM, but not for default BGS or for Mush BGM/BGS. I had to disable portions of the functions involved because it was causing a crash error I could not fix or trace. Therefore, any Mush BGM/BGS channels or default BGS will simply continue uninterrupted if an ME is played. I may or may not get around to fixing this, as I'm not only thoroughly vexed by it, I also don't personally care much about MEs or whether they mute BGM/BGS. Someone smarter than me is welcome to investigate! Otherwise, my advice: Manually mute/pause/resume any BGS or Mush BGMs as needed before or after using MEs.

Please report any other issues with this plugin conversion here. I cannot guarantee I will be able to address them, but I will at least take a look!



Terms of Use:

Same as MushroomCake28's original, which states:
  1. This plugin is free for commercial and non-commercial use.
  2. You may edit the plugin, but please contact me before sharing any edits of the plugin.
  3. You can repost this plugin as long as you link back to this thread.
  4. Please credit MushroomCake28 in your project if you use this plugin.
Additionally, you may optionally credit "FeatherBrain Studios" if you want.


DOWNLOAD PLUGIN:
See Attached Files
 

Attachments

  • MUSH_Audio_Engine.js
    81.5 KB · Views: 22
Last edited:

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
283
Reaction score
33
First Language
Spanish
Primarily Uses
RMMV
An awesome plugin for sure but... Is it possible to change the audio's pitch and volume afterward? Cause when I'm trying to do it using the same plugin command but it simply says that the channel is already occupied. Using stop isn't an option either since it then starts the whole thing from the beginning.
 

Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
134
Reaction score
284
First Language
English
Primarily Uses
RMMV
It seems that wasn't a functionality included in the original MZ plugin:

Is there a way to modify a volume of already running track?

Good question. There's no dedicated way, and I'm not sure calling the play Mush BGM to play the same track with the same channel will work (it might work, but it'll probably throw an error).

The original scope of this conversion was simply to convert what presently exists in the MZ plugin. I'm not sure I want to make a whole new fork with its own feature set. I'll look into it when I get a chance to see if it's an easy fix, but I may end up waiting to see if this gets patched into the original plugin before I try to make my own fix.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
283
Reaction score
33
First Language
Spanish
Primarily Uses
RMMV
Is there a way to change audio's values without restarting the whole thing? Maybe I'm doing something wrong?
StopBGS often takes a long time to process and creates stuttering.

UPD I need it for one of my game mechanics that ideally won't interrupt the main game score, which is why I can't use the default "audio engine" :(
 

Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
134
Reaction score
284
First Language
English
Primarily Uses
RMMV
Like I said, this ported plugin for MV can only do what the original plugin for MZ can do, and MushroomCake28 (the author of the MZ original) indicated that the current version of the original MZ plugin does not include a way to adjust the volume or parameters on audio that is already playing.

I will look into this problem when I get a chance to see if I can find a script call or patch a fix easily without drastic changes to the plugin logic. However, if adding this functionality would require rewriting any fundamental logic of the plugin, I will probably wait for an update to the original plugin, as I don't want to expand the scope of this project right now beyond a one-for-one translation of the original to MV.
 

Latest Threads

Latest Profile Posts

I feel so dumb I forgot to set parameters and thought the plugin wasn't working
I can come up with all of the magic skills in the world, but I can hardly think of creative physical weapon skills within the JRPG realm. One of those ones....
It's time for episode 19 of our Make a Cliff Map in RPG Maker MZ... I mean, Make a Game in RPG Maker MZ! Today we're working on our cliff map again. Let's see if we can finish it this time!

A side story is almost getting into the next stage. Almost everything in this game has real-life references.
unfinishedbuildingwip1.jpg
Everyday life is full of absurdity. This is just a reflection.

Forum statistics

Threads
111,413
Messages
1,060,932
Members
144,766
Latest member
O-NegativeMess
Top