[Solved]Partial playback in the Music Room

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
Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

[Solved]Partial playback in the Music Room

#1 Post by Nazon »

I am trying to create a song progress bar in the game's Music room, but it seems that Music room commands like:

Code: Select all

mr.Play(track_file)
don't support partial playback ajustments:

Code: Select all

"<from 5 to 15.5>waves.opus"
And this code is unusable:

Code: Select all

mr.Play("<from 5 to 15.5>" + track_file)
So is there any way to use partial playback for the music room tracks?
Last edited by Nazon on Thu Dec 08, 2016 1:46 pm, edited 1 time in total.

Ocasota
Newbie
Posts: 10
Joined: Sat Nov 26, 2016 11:44 pm
Contact:

Re: Partial playback in the Music Room

#2 Post by Ocasota »

does this work?

Code: Select all

python:
  renpy.music.play ("<from 5 to 15.5>"+track_file)
for a progress bar, would it work to just use renpy.music.get_pos() ?

Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

Re: Partial playback in the Music Room

#3 Post by Nazon »

Ocasota wrote:does this work?

Code: Select all

python:
  renpy.music.play ("<from 5 to 15.5>"+track_file)
for a progress bar, would it work to just use renpy.music.get_pos() ?
Thank you. Yes, it's working.
I also could use the screen action:

Code: Select all

Play("music", "<from 10>" + track_file)
I just wanted to check is there any way to do the same, using only MusicRoom instance commands.
It seems impossible though.

User avatar
Arowana
Miko-Class Veteran
Posts: 531
Joined: Thu May 31, 2012 11:17 pm
Completed: a2 ~a due~
Projects: AXIOM.01, The Pirate Mermaid
Organization: Variable X, Navigame
Tumblr: navigame-media
itch: navigame
Contact:

Re: [Solved]Partial playback in the Music Room

#4 Post by Arowana »

Was this issue actually solved like the title says? I'm interested in knowing the solution if so! :)
Complete: a2 ~a due~ (music, language, love)
In progress: The Pirate Mermaid (fairytale otome)
On hold: AXIOM.01 (girl detective game)

Image

Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

Re: [Solved]Partial playback in the Music Room

#5 Post by Nazon »

Arowana wrote:Was this issue actually solved like the title says? I'm interested in knowing the solution if so! :)
Well, as it seems to be an engine limitation somehow, I came up with the idea of the using seekbar, that remembers position on the music track automatically.

Code: Select all

screen seek_bar:
    bar:
        value AudioPositionValue('music')
        xpos x_p ypos y_p
And then I just use a Pause function for the Play/Pause button. Code for the changing of the button face from the Play picture to the Pause picture is kinda wacky, but it works.

Code: Select all

screen play_stop_button: #(1040, 100)
    python:
        
        play_state_on = soundmode_play_on
        play_state_off = soundmode_play_off
        
        if (playing == False):
            play_state_on = soundmode_play_on
            play_state_off = soundmode_play_off
            
            
        else:
            play_state_on = soundmode_pause_on
            play_state_off = soundmode_pause_off
        
        
    imagebutton idle play_state_off hover play_state_on xcenter xbut ycenter ybut action [PauseAudio("music", value="toggle"), ToggleVariable("playing", True, False) ]

Post Reply

Who is online

Users browsing this forum: No registered users