Layering music channels
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.
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.
-
Friendbot2000
- Regular
- Posts: 161
- Joined: Tue Feb 15, 2011 8:00 pm
- Projects: Mutagen : Journey to Haven's Landing
- Contact:
Layering music channels
I am having a problem with putting multiple music channels into my VN. When I put multiple channels into the code and start up the VN to test it, my music will start skipping. I also have sound effects programmed in so maybe I am overloading the engine with too much audio output. I could potentially edit the audio all into one file, but I want to avoid doing that until I finish programming the entire game. After that I can go back and clean everything up. Is there anything I can do to fix this?
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Layering music channels
How many channels? How are you declaring them?
-
Friendbot2000
- Regular
- Posts: 161
- Joined: Tue Feb 15, 2011 8:00 pm
- Projects: Mutagen : Journey to Haven's Landing
- Contact:
Re: Layering music channels
I am trying to layer 3 channels and I am using the format written in the new wiki. I would pull it up and copy and paste it here, but I am at work and posting from my phone.
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
-
Friendbot2000
- Regular
- Posts: 161
- Joined: Tue Feb 15, 2011 8:00 pm
- Projects: Mutagen : Journey to Haven's Landing
- Contact:
Re: Layering music channels
Ah I am finally home. Okay, here is my current code:Aleema wrote:How many channels? How are you declaring them?
Code: Select all
init python:
renpy.music.register_channel("hospital1", "sound", True)
renpy.music.register_channel("hospital2", "sound", True)
renpy.music.register_channel("hospital3", "sound", True)
label start:
scene intro
play hospital1 "sounds/hospital1.wav"
play hospital2 "sounds/hospital2.wav"
play hospital2 "sounds/hospital3.wav""
return
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Layering music channels
Here's an alternative method of playing multiple layers of sounds:
$ renpy.sound.play("sound.wav", channel = 0)
$ renpy.sound.play("sound2.wav", channel = 1)
(or renpy.music.play)
There are already multiple sound channels/layers that exist. I believe 0-1 is sound, the next several are for music, and a couple for voice. By that, I mean they'll show up on the sound/music/voice mixer, respectively. Try that method and see if it helps at all? If not, make sure the game itself isn't lagging (it's not hogging up all the system's resources).
$ renpy.sound.play("sound.wav", channel = 0)
$ renpy.sound.play("sound2.wav", channel = 1)
(or renpy.music.play)
There are already multiple sound channels/layers that exist. I believe 0-1 is sound, the next several are for music, and a couple for voice. By that, I mean they'll show up on the sound/music/voice mixer, respectively. Try that method and see if it helps at all? If not, make sure the game itself isn't lagging (it's not hogging up all the system's resources).
-
Friendbot2000
- Regular
- Posts: 161
- Joined: Tue Feb 15, 2011 8:00 pm
- Projects: Mutagen : Journey to Haven's Landing
- Contact:
Re: Layering music channels
Thanks Aleema.
I think the problem could be that the game hogs too much system resources. Any suggestions on how to cut down on resource usage? I like the way my game is set up now and if there is a way to cut the resource cost and keep the content I want to utilize it.
I think the problem could be that the game hogs too much system resources. Any suggestions on how to cut down on resource usage? I like the way my game is set up now and if there is a way to cut the resource cost and keep the content I want to utilize it.
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Re: Layering music channels
Try to change "sound" to "sfx"...renpy.music.register_channel("hospital1", "sound", True)
http://www.renpy.org/doc/html/other.htm ... er_channel
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Layering music channels
Hmmm ... Do you know how much RAM you have? If it's too low, we probably can't help you. But then again, this is a show-text-with-a-picture program and it shouldn't be that inaccessible. I would definitely say that mixing all your sound layers into 1 will help when you're ready to do that. I'd also cut down on the amount of visuals you show at once, and take space-saving measures on pictures and music, since they're cache hogs. By "space saving", I mean, just be conscious if you need the absolute highest quality music, or if you really need the same base sprite over and over and over when you could just cut out the emotions and have just one body + many faces. Just things that lower the cost of the resources involved.
-
Friendbot2000
- Regular
- Posts: 161
- Joined: Tue Feb 15, 2011 8:00 pm
- Projects: Mutagen : Journey to Haven's Landing
- Contact:
Re: Layering music channels
I have 4 GB of RAM on my Mac, but I am more worried about what OTHER people have. I don't want to model my game off of the specs on my computer, but on the specs of the average player. I don't want to alienate anybody with a game they can't play because they can't shell out for the hardware. Of course if you are playing with a Commodore 64 then I can't help youAleema wrote:Hmmm ... Do you know how much RAM you have? If it's too low, we probably can't help you. But then again, this is a show-text-with-a-picture program and it shouldn't be that inaccessible. I would definitely say that mixing all your sound layers into 1 will help when you're ready to do that. I'd also cut down on the amount of visuals you show at once, and take space-saving measures on pictures and music, since they're cache hogs. By "space saving", I mean, just be conscious if you need the absolute highest quality music, or if you really need the same base sprite over and over and over when you could just cut out the emotions and have just one body + many faces. Just things that lower the cost of the resources involved.
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games
Who is online
Users browsing this forum: Majestic-12 [Bot]