Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Fading in a BGM/Changing Tempo

How would I fade in a BGM using a script?

Also, how would I increase/decrease the tempo of a BGM using a script?

You can't do these with normal RMXP functions.
 

Mac

Member

This is how you would change the pitch(tempo).

Code:
Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)

To fade out a song you would simply use this.

Code:
Audio.bgm_fade(time * 1000)

And btw, you can do these functions using normal rmxp functions ^_^
 
I didn't want to change the pitch, I wanted to change the tempo. You know, how fast the music plays? Remember in RM2K/3 you could play a BGM and set how fast it plays from 50% to 150%?

And also I wanted to know how to fade a BGM IN, not out.
 
Pitch changes the pitch of the audiofile being played. How it does this depends on the file. On a midi, it changes the pitch of the controls. On other formats, it speeds up the playback speed to get the effect. So, midis cannot have "increased tempo" but other formats can.
 
Then in RM2K how could music (Which could only be in midi format) be played faster/slower?

Anyway, I see now that in RMXP only non midi formats can be played faster/slower.

Though I would still like to know if it's possible to fade a BGM in, or would I have to manually play the BGM at the lowest volume, wait a few frames, and then play it at the next highest volume until I got to 100%? Because that would not only be really tedious, but take a lot of testing to get it to sound right.
 
That actually sounds like a good idea. I'm not even skilled enough to figure this out, so someone else would have to do it... I'm sure if there are people out there that can write mouse scripts, keyboard input scripts, etc, then there's someone out there that can do this.
 
Enterbrain said:
MIDI files played via the DirectMusic Synthesizer. If a BGM MIDI file contains the control change value 111, that value is recognized as where the song will start repeating after it reaches the end.

I found something about DirectMusic API here.

EDIT: If you want to know more about DirectMusic, take a look at this website.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top