I'd like to know if there is a way of changing the pitch of a current BGM without reproducing it again, just like how the volume works. Is there a quick script call for it?
It occurred to me something like:
$bgm.pitch = nor
Audio.bgm_play(fName, volume, new_pitch, $bgm.pos)But I dunno the 'Audio' class variables/methods to tell 🙁
Thanks!
It seems like it's part of the inner workings of the engine... One of those hidden things.
Audio.bgm_play(filename[, volume[, pitch[, pos]]])
and
Audio.bgm_pos
So I am thinking it would be something like this Audio.bgm_play(filename[, volume[, pitch[, Audio.bgm_pos]]]).
Haven't tested it though check the Help for more information by searching Audio.
Oh, I didn't know there was documentations for the hidden Ruby classes! I'd try to fiddle around it a bit 😀
They do have, just there's not much info though specially on some other topics. Like we don't know if bgm_play calls some other high level commands or if it's already calling something on the lower level.
Been working with the audio class for a while now, never thought of doing that... XD
Audio.bgm_play("Airship", 80, 60, Audio.bgm_pos) isn't working :/ I wonder why? It says 'File Airship couldn't be found' 🙁
Audio.bgm_play("Audio/BGM/Airship", 80, 60, Audio.bgm_pos)
Here you are 🙂
@Yuuta - hidden in a sense that they're not on the script editor, and also that we don't know what other methods those methods call.
Yea I'm not quite certain how to increment it for smoother transition as you would need to have access to the current pitch. Maybe do something like this:
i = 100 #the default pitch that the bgm is played ato = 60 #the pitch you wantwhile i > oAudio.bgm_play("Audio/BGM/Airship", 80, i, Audio.bgm_pos)i -= 1 #increase this number for quicker transitions or keep small for slow transitionsendEdit just tried it and wont work in an event maybe a script though (freezes the player).
@Sarlecc: Thanks for trying anyway 😛 !
Of note, you can set pitch to anything between 0-255 by this method. Not sure what happens if you try values outside this range. So, if you want slower and deeper than 50, or faster and lighter than 150, this is the only way I know of. 0 just won't play anything, and numbers around 20 are a deep bass.
EDIT: >450 just equals 100, as does 0 and below. So, it won't crash. I think the fastest you can go is 450 and the slowest is 1. That's still much more capability, and for those using Audacity, they can speed the songs up even more for file size savings, and just run pitch near one at all times. 1 sounds like it doesn't work, but listen carefully... it sounds more like rumbles of thunder or a monster at that low.
Numbers 20 and below are GREAT for a Metroid-type or deep dungeon or horror game. Imagine the battle music going up with Haste, and down with Slow. Endless possibilities...