Page 1 of 2

Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue May 11, 2021 2:45 pm
by GanstaKingofSA
Hi everyone!

I released this a bit ago on the Ren'Py Discord, but never had the chance to post it here so here it is! I'm proud to present to you all Ren'Py Universal Player!
Ren'Py Universal Player is a improved music room that allows users to play your projects' soundtrack outside of the game's story along with any other music the user would add to a track specific folder.

Features:
  • MP3 and OGG Playback from a folder, RPA, and APK!
Sadly I don't have a Mac to test iOS but if anyone does want to do so, you are free to do so and give feedback!
  • Metadata support for tracks.
  • Music Player controls.
  • Dynamic Font Scaling for Titles (somewhat).
  • Sorting support.
  • Music unlock support.
and more to come!
Not all song names will be able to be read by the default font, especially Japanese. Songs with a UTF-8 cover (common in iTunes) will default to a generic player cover art due to some limitations.
Image
Additional screenshots can be seen here.

Download

Installation
1. Drop all the contents in this ZIP file to your projects' game folder.
2. Open screens.rpy and add this line somewhere after line 292 under the screen navigation(): block.

Code: Select all

textbutton _("Music Room") action [ShowMenu("music_room"), Function(ost.get_music_channel_info), Stop('music', fadeout=2.0), Function(ost.refresh_list)]
3. (Optional) Add some music to the track folder.
4. Run your project and enter the Music Room!

Q/A
Q1: How do I manually define a song?
A1: manualtracks.rpy has a small template to define songs manually if you need to do so. You have the following options to define these tracks.
  • name | Name of Track
  • full_name | Full Name of Track
  • path | Path to the file from the game folder
  • priority | Priortization of track on the list.
  • author | Artist
  • description | Track description, comments, etc.
  • cover_art | Path to the track's cover art (JPG/PNG Only)
  • unlocked | Allows a song to be shown to the player or not.
Q2: How do I priortize a song higher than another?
A2: Enable the numbered list icon in the music room and set the song priority by a value. 0 is the highest priority you can make a song be while 1, 2, etc. will be prioritzed lower in the list. i.e. 0 > 1 > 2 > ...
You may also enable this by setting organizePriority to True within ost.py.
Q3: How do I organize the list alphabetically?
A3: Enable the AZ icon in the music room or set organizeAZ to <u>True</u> within ost.py.
Q4: Why is there a python-packages folder in the ZIP file?
A4: This folder stores the python files that handle the functions of the music room player and the metadata of songs sideloaded or included in the game.
Q5: How do I add metadata info?
A5: Right-click your song, Select Properties, go to Details, and fill the blank boxes you can. Alternatively, use MusicBee or a similar music player, or MusicBrainz Picard and find your song. Refer to this for more information.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Wed May 12, 2021 3:08 pm
by Moshibit
This is really useful. Good work, thanks.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue May 18, 2021 1:38 pm
by GanstaKingofSA
Moshibit wrote: ā†‘Wed May 12, 2021 3:08 pm This is really useful. Good work, thanks.
Thanks! I hope to some this would be useful to expand their projects with new content. I know some people will ask, why make this if Ren'Py has it's own music room and TBH I was planning to code it in though might take a bit to import most stuff that I did in this code to it like forward and back 5 seconds, time bar adjustments, clock, etc. I am just used to this format cause I have done it in another project that uses the same code here.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Sat May 22, 2021 8:59 am
by GanstaKingofSA
So I just realized I derped a bit with the install instructions here compared to my actual documentation so I have updated most of it just now to reflect that. Sorry if many of y'all were trying to figure out, how to even enter it in the first place!

In good news, (even though I should probably post this more? IDK) 1.3 is out on Github for those wanting or have a existing copy to update it to that version.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue May 25, 2021 6:20 am
by henne
I tried it out for a bit, it's pretty cool :)

Maybe I am a bit stupid but what would I need to change so that it only shows songs that were already heard during the game?

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Thu May 27, 2021 12:58 pm
by GanstaKingofSA
henne wrote: ā†‘Tue May 25, 2021 6:20 am I tried it out for a bit, it's pretty cool :)

Maybe I am a bit stupid but what would I need to change so that it only shows songs that were already heard during the game?
I never coded any functionality to lock out songs from the player depending on playthrough though I think I can do it depending on how I code the whole check if the song will be open to the player or no.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue Jun 29, 2021 11:58 am
by szebi444
It works! Thank you! Also, may i ask if i free to use this option with the player on commercial goals? (like Patreon) (I'm still newbie, sorry if it's a common question! >w<)

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue Jun 29, 2021 1:33 pm
by GanstaKingofSA
I'm totally fine with it being used commercially. Really it's a use it whatever you want. It's mainly a template designed to customize and have in your projects.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue Jun 29, 2021 2:10 pm
by szebi444
Thank you for the answer, now i edit this like the 4th time, but in progress, in ren'py's launch project (simulation you know~) it's not working. By curiosity, i made a build and installed the game on my phone and it's actually do work, but once, i mean i got a crash and the music is disappeared from the room. Geez. Maybe it's a bug?

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Tue Jun 29, 2021 5:36 pm
by GanstaKingofSA
Hmm...is this in Ren'Py 7.4.6? I assumed you pasted everything into the game folder of your project and made a button for the menu. I can see to it but last I tested this it should work fine.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Wed Jun 30, 2021 2:36 pm
by szebi444
It's Ren'Py 7.4.4. Should i update? :D

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Sat Jul 10, 2021 7:37 pm
by GanstaKingofSA
szebi444 wrote: ā†‘Wed Jun 30, 2021 2:36 pm It's Ren'Py 7.4.4. Should i update? :D
Sorry for the delay. I just took a look at the code as of late and can see there is a bug where the music will not load in along with some image album errors. This is being addressed now and should be up as 1.5 in a few hours or a day.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Sun Jul 11, 2021 10:40 pm
by GanstaKingofSA
Version 1.5 of the player is now out which addresses some bugs in 1.4 that I have missed or forgot to add to itself. The new update can be downloaded from here: https://github.com/GanstaKingofSA/RenPy ... leases/1.5

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Fri Jul 16, 2021 2:41 am
by negascott245
Iā€™m new to coding but I placed the music room coding beneath the game menu coding line 292and I still get an error.

Re: Ren'Py Universal Player - A Improved Music Room Screen

Posted: Fri Apr 08, 2022 5:10 am
by shadowsword68
Well, what I want to say is that I am a novice. I want to know how to realize some functions in this music space, because I want to use it in my own project, that is, how to drag the progress bar in my project. If I can answer my question, I think I will be very happy. Thank you!