I have a mini game where I want the speed of the BGM to increase once or twice, then go back to normal/default speed after the mini game ends.
I've tried just Play BGM with a different pitch, which always makes it start over.
I've also tried a number of versions of the following:
Script: @bgm = RPG::BGM.last : @bgm.pitch = 110 : @bgm.replayIn this case I don't THINK it starts over, but it fades out and there's a brief pause before it starts playing at the higher pitch.Does anyone know what I need to do to eliminate the fade/pause?
Having trouble changing BGM pitch seamlessly
● ARCHIVED · READ-ONLY
-
-
Using ".replay" will start the BGM from the beginning I believe. Try using ".pos" to grab the song position/sample (i think) as a reference.
For example, my own project uses a BGM-changer script within battles (Dying Battle BGM by DiamondPlatinum3) when a party member dies or someone's HP gets low (to a fast tempo'd version of the same song I made in audacity) When it activates, the current normal BGM fades, and then starts the tempo version from the same ".pos" point (it's pretty accurate too)
So I do not know how to currently remove the fade (might be a ruby code dealing with music libraries or w/e) but yeah use .pos instead of .replay if you do not want it to restart. Look at the script how DP3 has it set up if you need a reference. -
Ho I don't remember who was the scripter but Mc tricky requested a script who allow to make some mix of song ( by using a new song)
maybe you can ask to mc tricky wich script and study a little this one for know what you can do? -
If it's faster, isn't the same 'pos' point going to be at a different part of the track though?
-
For a 125% tempo version, when the change happens it jumps a few samples ahead, so it's not too accurate. Never tried (or I don't remember trying) with a normal pitch version to see if it's perfect.
Let me see how a pitch version would be instead (for the sake of testing this, not like I want to use it)
Something I do remember researching long ago was on any way to modify the .pos position for more accuracy, but I couldn't find anything.
Edit: Yeah using Pitch is a lot more accurate cause I believe it's the same exact Sample size, unlike Tempo'd tracks. (I'm no music expert by a long shot) But too bad I need Tempo for what I want. -
Yeah, pity you can't just change tempo without changing pitch too. However, for my situation, the higher pitch is still good.
-
Pitch and tempo are different changes (but are related mathematically, but that's another story)
Tempo (time-stretch): Changes the sound to play at faster or slower speed than original, without affecting the sound pitch.
Pitch (key): Changes the sound pitch or key, without affecting the sound tempo or speed.
RPGMaker ruby music library does not support Tempo-changing, only volume and pitch (as far as I know)
Or read this:
TempoLet’s start with the easy one. The tempo of the track is the speed of the track. When you listen to music in different genres, you’ll notice that some are slow and some are fast. Music in the same genre tend to all be at a similar tempo.Recall from a previous tutorial that music is broken up into beats, bars and phrases. The tempo of a track is measured in the number of beats per minute, shortened down to BPM. You may have heard of hardware or software BPM counters, these simply measure the beats per minute of your track so you know the tempo it is playing at. Trance tends to be between 130-140 BPM.Why is this important? Well, if you’re going to mix 2 tracks together there will be a point when both tracks are being played to the public at the same time. If they aren’t at the same tempo (therefore the same BPM) then the beats won’t line up nicely with each other and it will sound awful.PitchIn music theory, pitch represents the perceived fundamental frequency of sound. In other words, the BFG would have had a low frequency voice and hence a low-pitched voice. Somebody who has inhaled a helium balloon will have a high frequency voice and hence a high-pitched voice.Basically in simplest terms, both making a song sound "sped up" but Tempo doesn't make your song sound chimpmunk-ish which is why I use it. -
What about saving the position of the track first, stopping the track right away without a fadeout, then play the current track at the higher tempo? I don't think you'd have a sudden fade after adding that step. I might be wrong though, it is only 9:50am where I'm at.
-
What about saving the position of the track first, stopping the track right away without a fadeout, then play the current track at the higher tempo? I don't think you'd have a sudden fade after adding that step. I might be wrong though, it is only 9:50am where I'm at.
RPG Maker does not naturally support Tempo change, and that change is a completely new music file with a different Sample size (music length/time) meaning (as I said before) it will not sound like a proper transition al all. The fade is also default in the way RPG Maker stops playing BGMs.
Back to the original subject, we need to find out how to prevent the fade. -
I'll give it a go this afternoon Nathan, but I kind of expect the same results. In the code I have above, there's nothing that specifies a fadeout, but it still happens. I also just tried BGM.play (as opposed to replay) and the fadeout/gap was there.
I thought RPG Maker's changing pitch also changed the speed? I AM happy with the pitch changing - it's meant to be a "time is running out, you better hurry up" prompt. Just need to get rid of that little gap.
I'll post back with results of that test. -
Didn't try it myself, but it looks like you can set the pitch here.
Not sure if "frequency" refers to tempo.
http://www.rpgmakervxace.net/topic/5259-audio-pump-up-fmod-ex-14/ -
Not to drive this off topic, but this is one of the things I've always felt the maker needs in the next editor:
1. The ability to create looping points in a track.
2. The ability to create events based on a specific point in the track.
3. The ability to change the pitch without restarting the track.
Number 3 for sure. Some good thoughts in this thread that I'll try and put to use myself.