Not a seamless music loop. [solved]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Not a seamless music loop. [solved]

#1 Post by warmsundae »

When a song loops in my game, there's always a split second break between the loops. Is it because it's getting ready for the next repeat or something? Could someone explain why that happens, and maybe even how I could fix it?
Last edited by warmsundae on Sat Sep 24, 2016 10:21 pm, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Not a seamless music loop.

#2 Post by indoneko »

Just to make sure that the error is not on the music file itself, have you tried playing the song in windows media player (or whatever multimedia player is available in your system) and confirmed that if it loops seamlessly?
My avatar is courtesy of Mellanthe

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Not a seamless music loop.

#3 Post by warmsundae »

Just tested it again, and yeah, I'm pretty sure it's smooth. I also made sure there isn't too much release at the end so the loop isn't jarring. This happens in all my games. Is it just me?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Not a seamless music loop.

#4 Post by Donmai »

What audio format are you using?
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Not a seamless music loop.

#5 Post by indoneko »

When you said that it happens in all your games, does it also hold true for renpy's demo game (and any renpy games made by other people)?

If it's true, I suspect that there's something wrong with your system. I supposed you could try to play your game on another computer to see if the problem persist.

Otherwise, you might want to put your code here so that others can point out where the mistake is.
My avatar is courtesy of Mellanthe

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Not a seamless music loop.

#6 Post by warmsundae »

Actually, it seems fine on "the Question". I don't use any code beyond the script to play the song, so here:

Code: Select all

play music "droplets.mp3" fadein 2.0 fadeout 1.0

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Not a seamless music loop.

#7 Post by Divona »

warmsundae wrote:Actually, it seems fine on "the Question". I don't use any code beyond the script to play the song, so here:

Code: Select all

play music "droplets.mp3" fadein 2.0 fadeout 1.0
Have you try remove

Code: Select all

fadeout 1.0
I usually only use that when I stop playing the audio.
Actually, remove all the fade, does the audio loop seemlessly?
Completed:
Image

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Not a seamless music loop.

#8 Post by indoneko »

In practice, fade-in/out only has effect on the first and last iterations of the loop, so your song should still loop seamlessly in between. But I agree with Divona's suggestion : try removing the fades and see if it has any effect.

And since "The Question" can run smoothly (which also means that there's no problem with your system), could you try replacing your game's song with any music files from that demo game? If it loops seamlessly, then the culprit was your original song. You can also do different test by making a new project (just let it as the default, don't write anything on the script.rpy yet) and add this line in the new project's options.rpy (it will play your original song as the game menu's BGM) :

Code: Select all

config.main_menu_music = "droplets.mp3"
If you have changed your original music with the one from "The Question" but the problem still persist, then you might have mistakenly added unnecessary line(s) in your script file(s) which leads to some kind of delay between loop.
My avatar is courtesy of Mellanthe

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Not a seamless music loop.

#9 Post by warmsundae »

I put the demo song into my game and it worked perfectly. I hadn't looped mp3 form of the song in anything other than logic pro, which was what I created them with, and I don't know any other looping media players. But I tried iTunes. If iTunes doesn't have a break between songs, then it means that there's a break at the end of the song, though I don't know why.

I guess I'll be trying to fix that on my own. Thanks for all the replies!

edit: Actually, it works fine in iTunes if I put it in a playlist. I've tried cutting the end of the song but it's not fixing anything. Okay, back to the drawing board.
Last edited by warmsundae on Sat Sep 24, 2016 7:34 am, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Not a seamless music loop.

#10 Post by indoneko »

You're welcome~ :3

The break/silence at the end of the song can be easily eliminated by using wave editor like Audacity. Good luck!
My avatar is courtesy of Mellanthe

User avatar
J-Ray
Regular
Posts: 67
Joined: Sat Mar 05, 2016 3:48 pm
Contact:

Re: Not a seamless music loop.

#11 Post by J-Ray »

If you're trying to make music really "seamlessly" like one piece playing without pauses - you have to use OGG, not MP3.
MP3 will break seamless connection between end and start.
The reason why I keep all the sounds in my free library in OGG format:
http://www.julianraymusic.com/sound/soundblend/main.php

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Not a seamless music loop.

#12 Post by Donmai »

J-Ray wrote:If you're trying to make music really "seamlessly" like one piece playing without pauses - you have to use OGG, not MP3.
This. That's why I made that unanswered question before.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Not a seamless music loop.

#13 Post by warmsundae »

Oh wow! Okay, I'll try that.

Yeah, it works. That was an easy fix, thanks so much.

User avatar
J-Ray
Regular
Posts: 67
Joined: Sat Mar 05, 2016 3:48 pm
Contact:

Re: Not a seamless music loop.

#14 Post by J-Ray »

warmsundae wrote:Oh wow! Okay, I'll try that.
Yeah, it works. That was an easy fix, thanks so much.
You're welcome!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], GetOutOfMyLab, giorgi1111, Majestic-12 [Bot]