Do you ever plan to add palette audio to this?
MUSH Audio Engine - Spatial Audio/Voice Acting/New Channels/etc.
JS Plugin Releases (RMMZ)Hello! 😂
I'm sorry if this has been reported, but I think there's a bug with the BGS?
When tested in an isolated event, everything runs smoothly, but when the autorun event plays after a transfer ( from another event scene ), all the BGS volumes get amplified? OvO)
I'm sorry if this has been reported, but I think there's a bug with the BGS?
When tested in an isolated event, everything runs smoothly, but when the autorun event plays after a transfer ( from another event scene ), all the BGS volumes get amplified? OvO)
Are you erasing the auto event after it runs once? First time hearing this.
Okay, it is actually pretty simple, you just have to set the symbol name to Mush's corresponding name, Here's the UIS volume option made by myself. You can copy paste it or analyze it yourself.
JSON:
{"Symbol:str":"uisVolume","Icon:num":"80","TextStr:str":"","TextJS:func":"\"return Mush.parameters.mushAudioEngine.menuOptions.uisVolumeText;\"","Accessibility":"","ShowJS:func":"\"// Return Boolean\\nreturn true;\"","EnableJS:func":"\"// Return Boolean\\nreturn true;\"","ExtJS:func":"\"// Return Value\\nreturn 0;\"","Functions":"","DrawJS:func":"\"// Declare Constants\\nconst symbol = arguments[0];\\nconst index = arguments[1];\\nconst title = this.commandName(index);\\nconst rect = this.itemLineRect(index);\\nconst halfWidth = rect.width / 2;\\nconst value = this.getConfigValue(symbol);\\n\\n// Draw Command Name\\nthis.resetFontSettings();\\nthis.changePaintOpacity(true);\\nthis.drawTextEx(title, rect.x, rect.y, halfWidth, \\\"left\\\");\\n\\n// Draw Gauge\\nconst rate = (value / 100).clamp(0, 1);\\nconst gx = rect.x + halfWidth;\\nconst gy = rect.y + rect.height - 14;\\nconst fillW = Math.floor((halfWidth - 2) * rate);\\nconst color0 = ColorManager.gaugeBackColor();\\nconst color1 = ColorManager.textColor(26);\\nconst color2 = ColorManager.textColor(27);\\nthis.contents.fillRect(gx, gy, halfWidth, 12, color0);\\nthis.contents.gradientFillRect(gx + 1, gy + 1, fillW, 10, color1, color2);\\n\\n// Draw Value\\nconst text = '%1%'.format(value);\\nthis.drawText(text, rect.x + halfWidth, rect.y, halfWidth, \\\"center\\\");\"","ProcessOkJS:func":"\"// Declare Constants\\nconst symbol = arguments[0];\\nlet value = this.getConfigValue(symbol);\\nconst lastValue = value;\\n\\n// Perform Actions\\nif (value >= 100 && (Input.isTriggered(\\\"ok\\\") || TouchInput.isClicked())) {\\n value = 0;\\n} else {\\n value += Input.isPressed(\\\"shift\\\") ? 1 : 10;\\n value = value.clamp(0, 100);\\n}\\nthis.setConfigValue(symbol, value);\\nthis.redrawItem(this.findSymbol(symbol));\\nif (lastValue !== value) {\\n this.playCursorSound();\\n}\"","CursorRightJS:func":"\"// Declare Constants\\nconst symbol = arguments[0];\\nlet value = this.getConfigValue(symbol);\\nconst lastValue = value;\\n\\n// Perform Actions\\nvalue += Input.isPressed(\\\"shift\\\") ? 1 : 10;\\nvalue = value.clamp(0, 100);\\nthis.setConfigValue(symbol, value);\\nthis.redrawItem(this.findSymbol(symbol));\\nif (lastValue !== value) {\\n this.playCursorSound();\\n}\"","CursorLeftJS:func":"\"// Declare Constants\\nconst symbol = arguments[0];\\nlet value = this.getConfigValue(symbol);\\nconst lastValue = value;\\n\\n// Perform Actions\\nvalue -= Input.isPressed(\\\"shift\\\") ? 1 : 10;\\nvalue = value.clamp(0, 100);\\nthis.setConfigValue(symbol, value);\\nthis.redrawItem(this.findSymbol(symbol));\\nif (lastValue !== value) {\\n this.playCursorSound();\\n}\"","Data":"","DefaultJS:func":"\"// Declare Constants\\nconst config = arguments[0];\\nconst symbol = arguments[1];\\n\\n// Perform Actions\\nConfigManager[symbol] = 100;\"","SaveJS:func":"\"// Declare Constants\\nconst config = arguments[0];\\nconst symbol = arguments[1];\\n\\n// Return Value\\nconfig[symbol] = ConfigManager[symbol].clamp(0, 100);\"","LoadJS:func":"\"// Declare Constants\\nconst config = arguments[0];\\nconst symbol = arguments[1];\\n\\n// Return Value\\nConfigManager[symbol] = config[symbol].clamp(0, 100);\""}
Does anyone know how to implement the "Master, UIS and VSC Section" from this plugin into the Visustella Options core?
I like to make this options available there.
Thanks 🙂 !
I like to make this options available there.
Thanks 🙂 !
I literally wrote the solution to that in the post above yours.
I think that needs to be stickied!
I just incorporated it in my opening post and linked it back to Nerine's post. Should help.
Thank you both
Does this still work with 1.7.0? Anything seems to work except for spatial bgm and spatial se. Getting no sound at all using spacial.
this is a test event, triggered with action button. With autorun I have to use windows task manager to kill the process, otherwise I stuck with error popups that the channel is already used.
I'm missing something? There is also no third video about spacial sound.
this is a test event, triggered with action button. With autorun I have to use windows task manager to kill the process, otherwise I stuck with error popups that the channel is already used.
I'm missing something? There is also no third video about spacial sound.
I have not tested with 1.7.0. The autorun problem you are describing happens because you aren't erasing the event. You have to add an erase event command after the two plugin command in the pic. Also, if it's not giving you an error after that and there's just no sound, it might be working but there's no sound source in the map. Double check that you added audio sources with the correct channel and that there's no spelling mistake when adding them.
Thanks for the reply, so I can confirm it still works with 1.7.0, and the issue was the missing note tag <bgs_source: 1>.
This runs fine with spacial in one event:
Just FYI, the notetag is used to identify the audio sources (there can be more than one) tied to a particular channel. You should use different events to create the spatial audio (the plugin command) and for audio sources. I'd recommend having an autorun event with the plugin commands and erasing it, and making a new event with the note tag.
Hi, and thanks for this wonderful plug-in! I downloaded the plugin today, but I am experiencing the same "Cannot read property name of 'null'" issue that others reported with spatial BGM when teleporting within a map. I'm not using any saves, so I know it isn't an old save issue in my case.
I took a look at the code and the error is occurring in AudioManager.stopMushBgm while trying to read AudioManager._currentBgm.name. I am most definitely not a javascript expert, but while I see AudioManager._currentBgm being referenced in a few places in your code, I can't find where you're actually setting it to anything--hence it can't read the property of a null object.
As a workaround for others who are/were having this problem: the affected code only runs if your sound source is set to "Cross Fade = true" (which is the default). Setting Cross Fade to false should prevent this crash until there's (hopefully!) a fix. This might also explain why only some people were seeing the issue--if they had Cross Fade turned off (or maybe it was off by default in an earlier version of the plugin?) it wouldn't crash.
EDIT: Also, just wanted to add that this isn't an issue with teleporting, it's an issue with the BGM automatically stopping because of the teleportation. I get the same crash if I create a manually triggered event to "Stop All Mush BGMs," too.
EDIT2: I may have found the solution. The original AudioManager.playBgm method contains the line this.updateCurrentBgm(bgm,pos) which sets the _currentBgm object properties, but there's no equivalent in your .playMushBgm method. Including that command eliminates the error for me, even with Cross Fade enabled:
AudioManager.playMushBgm = function(bgm, channel, autoRemover, interrupt, pos) {
if (bgm.name) {
if (this.getBgmFromChannel(channel)) {
...
...
this._bgmBuffers.push(buffer);
buffer.play(true, pos || 0);
if (!this._meBuffer) {
buffer.play(true, pos || 0);
this.updateMushBgmParameters(buffer, bgm);
}
}
this.updateCurrentBgm(bgm, pos); // <<<<< sets _currentBgm object
}
};
Thanks for the detailed report, I've now been able to reproduce the issue. However, when I test it my game doesn't crash, but the BGM just doesn't work. I'll have a look at the code and make a permanent fix. I'm in my final exams period of the last semester of my Masters, so might not be soon, but now that I know exactly what the issue is I should be able to fix it pretty easily. Thanks a lot!
I appreciate you giving this the time when you can, but you clearly have higher priorities right now! Good luck on your exams.
You mentioned BGM not working, but I think it's "just" autorun events that don't work. Player Touch-triggered events still start BGM for me, but autorun is obviously required. I also noticed that the BGM from the main menu started carrying over to the map. I was able to work around that by adding "Play BGM: None" at the beginning of my MUSH Audio source event, but it's another sign that my slap-dash "patch" really needs a more professional eye. XD
Hmm, that's weird. That doesn't happen on my end, the title audio doesn't carry over. I'm using the default way to play the BGM in the title tho, so with the default audio engine.
Hello @MushroomCake28 , this plugin is amazing!
Is there a way to play spatial SE from movement route commands? (using the script option as there is no support for plugin commands there)
I have an event walking and opening some doors during the walk and I want to make that sound spatial.
I understand that the easiest way is to call
directly from route commands?
(having prefilled se and data before)
Maybe is there another easier way?
Thanks a lot!
----Edited later---
Nevermind, I found a way, I decided to make all movement route sounds spatial
Is there a way to play spatial SE from movement route commands? (using the script option as there is no support for plugin commands there)
I have an event walking and opening some doors during the walk and I want to make that sound spatial.
I understand that the easiest way is to call
JavaScript:
AudioManager.playSpatialSe(se, data);
(having prefilled se and data before)
Maybe is there another easier way?
Thanks a lot!
----Edited later---
Nevermind, I found a way, I decided to make all movement route sounds spatial
JavaScript:
//My function to transform regular audio into spatial audio using MUSH Audio Engine
myPlugin.playSpatialSe = function(sep,e){
var se = {
name: sep.name,
pitch: sep.pitch,
volume: 0
}
var data = {
pitchVar: "Default",
volumeVar: "Default",
maxVolume: sep.volume,
eventId: e._eventId,
radius: 15,
strength: 100,
panType: "Origin Expand",
panSt: 6,
panLd: 6
}
AudioManager.playSpatialSe(se, data);
}
//Catch audio play from route commands
Game_Character.prototype.oldProcessMoveCommand = Game_Character.prototype.processMoveCommand;
Game_Character.prototype.processMoveCommand = function(command) {
const gc = Game_Character;
const params = command.parameters;
if (command.code == gc.ROUTE_PLAY_SE) {
myPlugin.playSpatialSe(params[0], this);
} else {
this.oldProcessMoveCommand(command);
}
}
Hello !
First, thanks for the plugin, it really helps creating the ambience !
However, maybe I misunderstand how to use it, but it seems it's not possible to use the same sound file in multiple channels for spatial BGS ?
If it's normal behavior, how would I create multiple spatial sound sources which can be turned off individually ?
(Basically : that "sound source" can be gathered by the player 😀)
Joined, the error I get if same sound is used on multiple channels.
(I tested, it doesn't happen if I just don't use the same audio file twice)
Thank you !
First, thanks for the plugin, it really helps creating the ambience !
However, maybe I misunderstand how to use it, but it seems it's not possible to use the same sound file in multiple channels for spatial BGS ?
If it's normal behavior, how would I create multiple spatial sound sources which can be turned off individually ?
(Basically : that "sound source" can be gathered by the player 😀)
Joined, the error I get if same sound is used on multiple channels.
(I tested, it doesn't happen if I just don't use the same audio file twice)
Thank you !
@MushroomCake28 I found that if I teleport a player to a different position in the same map, all BGM and BGS stops
I think this change can solve it, does it makes sense? Thanks!!
I think this change can solve it, does it makes sense? Thanks!!
Code:
Mush.alias.Scene_Map_OnTransfer_002 = Scene_Map.prototype.onTransfer;
Scene_Map.prototype.onTransfer = function() {
if($gameMap.mapId()!=$gamePlayer.newMapId()){
AudioManager.generalClearMushBgms();
AudioManager.generalClearMushBgss();
}
Mush.alias.Scene_Map_OnTransfer_002.call(this);
};
Original thread: https://forums.rpgmakerweb.com/threads/mush-audio-engine-spatial-audio-voice-acting-new-channels-etc.128741/