OcRam - Audio_EX plugin (for MV)

I could be wrong, but I think fade plugin command is only for BGS. Perhaps you could fool the engine by playing a song as a BGS?

The way I fade in and out my BGS (rain in my case, music in yours) is like this:

To fade in, I start the BGS with volume of 1
1612979825074.png


Then I fade it in manually:
1612979886784.png



To fade it down, it's just the same. I've added a fail-safe so that the volume doesn't go in the negative:

Screenshot 2021-02-10 130026.jpg



Note 1: Weather Wanted is the type of weather in my game (0 is clear, 1 is rain, 2 is storm, etc).
Note 2: V[126] is the value of the variable 126 (Weather sound volume). I'm using a plugin that allows me to get the value of a variable instead of hard-coding the value.
Note 3: OcRam is pretty smart and you can see in his code that instead of reloading a sound every time you call it, he checks if it's already playing. If it is the case, then he's adjusting the parameters of the sound (volume, pitch, pan).
@Moon_Haven I slightly edited my post, it should dynamically fade out when in range of an emitter and fade in again when outside the range. I don't think that's possible with the standard command?
Thank you for the message,

You can see the disco ball at the start of my demo map. I just saved BGM as BGS and used it like I would use normal BGS.

Edit: Just realized this was MV thread ...um well it should be same thing in MV also (though no disco ball in demo project...)
@OcRam Thanks for you answer, could you maybe snap a quick screenshot of the disco ball event? I don't have MZ 🙂

Found the fabled disco ball in your video:

Does it automatically change BGS when in the scope of the event and change back to the original BGS when outside the scope of the event again?
@OcRam Thanks for you answer, could you maybe snap a quick screenshot of the disco ball event? I don't have MZ 🙂

Found the fabled disco ball in your video:

Does it automatically change BGS when in the scope of the event and change back to the original BGS when outside the scope of the event again?

Thank you for the message,

BGM there is handled as BGS and will fade out when player goes away from it and fade in when moving towards (it doesn't alter other sounds so there's no cross-fade what so ever).

Spoiler: Disco event
disco.png
Hi OcRam, I'm pretty new to using plugins and have RPG Maker MZ. I can see you have a version for MZ thanks very much. Unfortunately I cannot get extra BGS to work by adding comments to events.

Currently for example I'm adding <fire2> in a comment so using the defaults (forced is on) and nothing plays from any distance?

Am I doing anything wrong?
Hi OcRam, I'm pretty new to using plugins and have RPG Maker MZ. I can see you have a version for MZ thanks very much. Unfortunately I cannot get extra BGS to work by adding comments to events.

Currently for example I'm adding <fire2> in a comment so using the defaults (forced is on) and nothing plays from any distance?

Am I doing anything wrong?
Thank you for the message,

Example for very simple "fire" bgs.
*Comment* <audio:d:15>
*Play BGS* Fire2 (90, 100, 0)
Thank you for the message,

Example for very simple "fire" bgs.
*Comment* <audio:d:15>
*Play BGS* Fire2 (90, 100, 0)
Hi OcRam,

Thanks for the quick reply and trying to help. Unfortuntely following yor exact instructions the fire noise won't play passively in the background.

I've attached a couple of screenshots in case you can spot anything i've done wrong?

Thanks for taking time to help.

OCRAm audio 1.png

OCRAm audio 2.png
Hi OcRam,

Thanks for the quick reply and trying to help. Unfortuntely following yor exact instructions the fire noise won't play passively in the background.

I've attached a couple of screenshots in case you can spot anything i've done wrong?

Thanks for taking time to help.

View attachment 184214
View attachment 184215
Screenshot
audio_support.png
Hi OcRam, thanks I knew I'd feel like an idiot. I was so close as I'd tried this arrangement before, but put the name of the sound file instead of audio. Thanks ever so much!
I noticed any BGS and SE stops playing on map transfer once I activate this plugin. Is this intentional? If yes: can I turn it off?
I noticed any BGS and SE stops playing on map transfer once I activate this plugin. Is this intentional? If yes: can I turn it off?
Thank you for the message,

All dynamic sounds are cleared on map transfer and currently it's not possible to prevent this.

This is to keep buffers 100% cleared because in long play session if theres trash in buffers, audio lag will be the problem.

It is in my never ending todo list to check if I can make it SAFE to allow dynamic sounds playing during map transfers.
@OcRam thanks for the reply! This also happens with what I thought to be standard SE and BGS. Or are all sounds considered dynamic with this plugin?
@OcRam thanks for the reply! This also happens with what I thought to be standard SE and BGS. Or are all sounds considered dynamic with this plugin?
They should play normally - it's a bug which will fixed in the next patch.
They should play normally - it's a bug which will fixed in the next patch.
Okay, looking forward to that! (Take your time, no pressure from me, but you have an eta when that update could go live?)
Okay, looking forward to that! (Take your time, no pressure from me, but you have an eta when that update could go live?)
If it's an easy fix then I will release it this week, but if not then release might be even few weeks from now.
Hello OcRam i found a little Bug when i manually adjust the volume for the BGM in the optionmenu.
The Bgm becomes a little bit quiter even when i put it louder and when i play the Bgm again via Event
then it becomes louder.

The bug itself is a bit difficult to notice but you can reproduce him when you make a Map and put an Event (trigger action button) that Play a bgm with the following settings:
Name of the BGM, Volume 10 or 20 %, pitch 100, Pan 0

Start the game and adjust the BGM volume to 40%.
Make then a new game in this Map and start the event.
Now adjust the BGM Volume in the Optionmenu to lets say 50% and you will notice that the bgm becomes quiter.
Then exit the menu and when you trigger the Event on the Map again the BGM will be louder and when you now adjust the BGM volume via the Optionmenu it runs as desired.
But when you Changes the BGM trough another BGM it all happens again!

I hope i explained it understandable, my English is not very well...
Hello OcRam i found a little Bug when i manually adjust the volume for the BGM in the optionmenu.
The Bgm becomes a little bit quiter even when i put it louder and when i play the Bgm again via Event
then it becomes louder.

The bug itself is a bit difficult to notice but you can reproduce him when you make a Map and put an Event (trigger action button) that Play a bgm with the following settings:
Name of the BGM, Volume 10 or 20 %, pitch 100, Pan 0

Start the game and adjust the BGM volume to 40%.
Make then a new game in this Map and start the event.
Now adjust the BGM Volume in the Optionmenu to lets say 50% and you will notice that the bgm becomes quiter.
Then exit the menu and when you trigger the Event on the Map again the BGM will be louder and when you now adjust the BGM volume via the Optionmenu it runs as desired.
But when you Changes the BGM trough another BGM it all happens again!

I hope i explained it understandable, my English is not very well...
Thank you for the report!

OcRam_Audio_EX.js v2.09 is now available where this issue has been fixed.

Happy RPG making!
A couple of questions:
1. The fade plugin command simply doesn't work for me.
Am I doing something wrong?
1618300594042.png


2.Also is it possible to create alternative BGM channels? It's not a big thing, but would be nice if there's such a feature.
A couple of questions:
1. The fade plugin command simply doesn't work for me.
Am I doing something wrong?
View attachment 185997

2.Also is it possible to create alternative BGM channels? It's not a big thing, but would be nice if there's such a feature.
Thank you for the message,

BGS, BGS2 and BGS3 are "static" channels. BGS is example for ambient. BGS2 and 3 is example for weather and will also play in battle scene. Only 1 BGS can be played for each static channel.

"fadeout_bgs2" isn't valid command. There's also dynamic channel (enabled via <aex> event comment notation) where you can have as many BGS as you like - even with auto panning and distance. And "fadeout_bgs a__21 4" will fadeout all DYNAMIC BGS with a__21 name.

JavaScript calls: AudioManager.fadeOutBgs2(duration) and AudioManager.fadeOutBgs3(duration) can be used to fade out BGS2 and 3. "Vanilla" BGS is faded as it would without this plugin.

Extra BGM channels is good idea, but unfortunately I've got no time to do this.
I get this bug when ever I use the standard fade bgs command (The one that is provided by rpgm).
Is there a way to fix that?
Bug.png

Original thread: https://forums.rpgmakerweb.com/threads/ocram-audio_ex-plugin-for-mv.108209/