Extended Music Room for Ren'Py
A downloadable music room
Overview
Easily include a custom music room in Ren'Py for players to listen to the game soundtrack. This code builds off of Ren'Py's built-in Music Room system, and does not require any additional libraries to work.
Features
- Include song metadata when adding tracks to the music room, such as the song title, artist, cover art, and more. You can display as much or as little as you want in the music room screen.
- Have the music room automatically alphabetize songs by title, or show them in the order you declare.
- Specify unlock conditions, or stick with the default which automatically unlocks a song when you hear it in-game. You can choose to show or hide locked songs in the music room tracklist. A developer option lets you see all tracks unlocked automatically for testing.
- The audio playback bar supports seeking (i.e. you can click on the bar to jump to that part of the song).
- Many improvements made to the default music Ren'Py room functionality:
- The back button starts the song over if it's been playing longer than 2 seconds, or goes to the previous song if it's been playing for less than 2 seconds (default Ren'Py music room behaviour: always goes to the previous song)
- Shuffle and repeat one are not mutually exclusive/your shuffle settings are remembered even if you turn repeat one on (default Ren'Py music room behaviour: turning on shuffle will turn off repeat one and vice versa)
- Changing songs with Next/Previous with repeat one on automatically turns it into repeat all (default Ren'Py music room behaviour: just keeps it on repeat one)
- A shuffled playlist is re-shuffled every time it reaches the final song of that particular shuffle round (default Ren'Py music room behaviour: shuffles the list once and always plays it in that order)
- The loop button cycles between Repeat All, Repeat One, and Repeat Off. There is no state where you can have "single_track" active and repeat off (default Ren'Py music room behaviour: separates repeat and single track functionality to two separate toggles)
- Includes several standard music room buttons (created by me) which can be included in the final game - play, pause, next/previous song, back/forwards 10 seconds, repeat all, repeat 1, shuffle, and a volume button. The buttons come in black and can be colorized to match your UI theme using values at the top of music_room.rpy
- Comes with three different layout options, which can be customized however you wish or simply used as a guideline to make your own screen. The provided layouts are made to suit a game that is 1920x1080.
Instructions
Download music_room.zip and unzip it. Inside are two folders, music_room and gui. Copy both folders directly into your project's game/ folder so the gui folder is merged with your existing gui folder. You can keep the README around for reference. To immediately test the music room, make a button to go to the music room screen e.g.
textbutton _("Music Room") action ShowMenu("music_room", mr=music_room)
You must pass in the ExtendedMusicRoom object you are using - an example one called music_room is used here and in the files as a template. You will see the first music room layout, with several examples (Note: the examples only play silence; no music files are included).
01_music_room_backend.rpy contains the essentials for the music room to run. music_room.rpy contains the information you can modify yourself, such as updating the screens or declaring music files. Several examples are provided.
Compatibility
This system has been tested for compatibility with Ren'Py 7.5-7.6 and 8.0-8.2. One of the music room layouts uses nearrect, and is thus not compatible with earlier versions without modifications. The other layouts are expected to be compatible with earlier versions up to 7.4 (due to use of matrixcolor, which can also be removed with set images) but have not been tested. Leave a message in the stickied thread if you run into any bugs.
Terms of Use
You may:
- Use this code in commercial and noncommercial projects
- Modify and edit the code to suit your needs
You may not:
- Resell all or part of the code as-is or sell it with modifications
- Release any projects created using this code without providing attribution
Attribution must be credited as Feniks, with a link either to the page with this code or to https://feniksdev.com
Final Notes
If you're looking for systems to add extras to your game, you might also be interested in my multi-touch gallery or my achievements systems, both available below:
I also have a new marquee tool which may be helpful for long song titles:
Follow me to be notified of new tool and tutorial releases!
Status | Released |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (10 total ratings) |
Author | Feniks |
Genre | Visual Novel |
Tags | Graphical User Interface (GUI), Kinetic Novel, Modular, Music, Ren'Py, User Interface (UI) |
Download
Click download now to get access to the following files:
Development log
- New feature + complementary toolJan 15, 2024