MiSTer BGM - Background Music for the MiSTer Menu
- Moondandy
- Top Contributor
- Posts: 535
- Joined: Mon May 25, 2020 2:14 am
- Location: Edinburgh, Scotland
- Has thanked: 32 times
- Been thanked: 102 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Just heard about this feature in Luu's weekly MiSTer video, is a really fun feature!
Some thoughts:
Could uncompressed .wav files be played or are there issues loading larger files, similar to loading large background images?
Could you have a sister script that turns the music off when run?
Could update all, or downloader, grab the latest version of your script when run so it doesn't need to be manually updated?
Some thoughts:
Could uncompressed .wav files be played or are there issues loading larger files, similar to loading large background images?
Could you have a sister script that turns the music off when run?
Could update all, or downloader, grab the latest version of your script when run so it doesn't need to be manually updated?
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Thanks for the feedback everyone. Appreciate it. I'm working on a bigger update at the moment with all the features requested so far in the thread. Almost done but need to do a fair bit of testing
Thanks for reporting. Can you please take a photo of the error for me? There's not quite enough information here for me to go on, the error should also have a line number showing and maybe some other context. Thanks
Glad it's working for you now. I will keep it in mind but I'm not sure I can change this. I'll check into how this works though, I'm guessing this is the OS setting the volume to the "core volume" level.AntialiasedPixel wrote: ↑Sat Apr 16, 2022 4:50 pm One thing I notice is when launching a core, the volume seems to jump up a bit before it stops playing. I assume because of per-core volume settings, but overall a great new addition to the Mister toolbelt!
I just watched the video that's so cool!Moondandy wrote: ↑Mon Apr 18, 2022 8:10 pm Could uncompressed .wav files be played or are there issues loading larger files, similar to loading large background images?
Could you have a sister script that turns the music off when run?
Could update all, or downloader, grab the latest version of your script when run so it doesn't need to be manually updated?
- Yes, you should be able to already. It was a feature I added but didn't announce. If you have the latest version from github .wav files will work like any other file. I am also adding support for vgm files and internet radio playlists
- When you run the script the first time it creates some extra script in the Scripts menu for stop, play and skip. I think the stop one is what you want. In the next version you can also disable anything playing even on core change and disable starting on boot
- That would certainly be cool but not something I have any control of. I suspect the maintainers of those scripts won't be interested until this script is in a stable and proven state
- Sigismond0
- Posts: 339
- Joined: Mon May 25, 2020 2:21 am
- Has thanked: 1 time
- Been thanked: 66 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
If you want downloader support, you just need to set up BGM with a downloader-friendly repository format. See below. Once you have the zip made, anyone can add BGM to their updater ini, and it'll update along with everything else.
https://github.com/MiSTer-devel/Downloa ... tabases.md
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Ahh I see. That makes sense. Thank you! I will add this soonSigismond0 wrote: ↑Tue Apr 19, 2022 1:13 pm If you want downloader support, you just need to set up BGM with a downloader-friendly repository format. See below. Once you have the zip made, anyone can add BGM to their updater ini, and it'll update along with everything else.
https://github.com/MiSTer-devel/Downloa ... tabases.md
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
The new update is now live on github. I've added these new features:
Once you've done that, just re-run the bgm script and let it set itself up again. I'll try not to require manual update steps from now on
Make sure to read the docs on github before you try a new feature so you know how it works. I expect I've introduced a lot of bugs so I'd appreciate if people can report any they find. Thanks!
- .vgm file support (can be .vgz and .vgm.gz files too)
- Ability to create separate playlists by making subfolders in the music folder
- New playback type to disable all music except boot sounds
- New control GUI for playback control and config settings
- Internet radio support (see the docs on github for how to do this)
- Per track looping, configure individual tracks to loop a certain number of times
- Disable service from starting on boot from config
- Allow music to play during cores if configured
Once you've done that, just re-run the bgm script and let it set itself up again. I'll try not to require manual update steps from now on
Make sure to read the docs on github before you try a new feature so you know how it works. I expect I've introduced a lot of bugs so I'd appreciate if people can report any they find. Thanks!
-
- Posts: 157
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 98 times
- Been thanked: 46 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Finally trying this for the first time. Ran the script, it created /fat/music. I copied over five mp3s starting with _ in front for random startup music. After subsequent reboots it plays a random track as expected. =)
But running the script again doesn't give any type of gui (says to add files to /music and run the script again) and music continues to play in cores.
my bgm.ini is as follows, and I haven't changed it at all:
Any suggestions on what I can try to get it working properly?
But running the script again doesn't give any type of gui (says to add files to /music and run the script again) and music continues to play in cores.
my bgm.ini is as follows, and I haven't changed it at all:
Code: Select all
[bgm]
playback = random
playlist = none
startup = yes
playincore = no
debug = no
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Thanks for giving it a shot. That's really strange. When you run bgm from the scripts menu again it just does nothing? Or is there some output at all? Errors? The behaviour at the moment isn't super intuitive, the first time you run it will start the service, then it quits. The second time you run it will start the GUI. But that's just on first set up, it should always start the GUI if music is playing at the time.Stupid Dufus wrote: ↑Wed Apr 20, 2022 12:10 pm Finally trying this for the first time. Ran the script, it created /fat/music. I coped five mp3s starting with _ in front for random startup music. After subsequent reboots it plays a random track as expected. =)
But running the script again doesn't give any type of gui and music continues to play in cores.
my bgm.ini is as follows, and I haven't changed it at all:Any suggestions on what I can try to get it working properly?Code: Select all
[bgm] playback = random playlist = none startup = yes playincore = no debug = no
Would you mind changing the debug line in your ini file to "yes", reboot, try to start a core and have it keep playing music in the core, then paste the contents of the file "/tmp/bgm.log" here? The log file disappears when you reboot so you'll have to copy it over with FTP or SSH.
-
- Posts: 157
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 98 times
- Been thanked: 46 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Sorry, just edited my post to add a bit.
When I run the script again, I get:
Turned on debug, rebooted and music started. Loaded up a core, and here's the log (with music playing on top of the core):
When I run the script again, I get:
Code: Select all
/root# cd /media/fat/Scripts
/media/fat/Scripts# ./bgm.sh
Add music files to /media/fat/music and re-run this script to start.
/media/fat/Scripts#
Code: Select all
[2022-04-20T12:51:28.174480] Starting service...
[2022-04-20T12:51:28.175222] Playlist folder: /media/fat/music
[2022-04-20T12:51:28.176041] Starting remote...
[2022-04-20T12:51:28.178756] Selected boot track: /media/fat/music/_Sega Genesis Mini - Menu Music.mp3
[2022-04-20T12:51:28.182555] Now playing: /media/fat/music/_Sega Genesis Mini - Menu Music.mp3
[2022-04-20T12:51:28.184894] Loop #1
[2022-04-20T12:51:28.239747] High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
[2022-04-20T12:51:28.241377] version 1.25.15; written and copyright by Michael Hipp and others
[2022-04-20T12:51:28.242214] free software (LGPL) without any warranty but with best wishes
[2022-04-20T12:51:28.320223] Directory: /media/fat/music/
[2022-04-20T12:51:28.321071] Playing MPEG stream 1 of 1: _Sega Genesis Mini - Menu Music.mp3 ...
[2022-04-20T12:51:28.331832] MPEG 1.0 L III cbr192 48000 stereo
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Thanks mate. So I think I've almost got this worked out. I hadn't really tested a setup with *only* boot sounds. The control script thinks you have no music files available so is refusing to start, because it doesn't count start up sounds as regular files. It doesn't fix your problem but you can bring up the GUI by popping a regular music file, without a _ in front, in the music folder and launching it again. You can change the playback setting to disabled in the GUI top stop stuff playing.Stupid Dufus wrote: ↑Wed Apr 20, 2022 12:54 pm Sorry, just edited my post to add a bit.
When I run the script again, I get:
I will put a bug fix in the next day or so to make the experience better when you're only using boot sounds.
I'm a bit confused about when you say it's playing into cores though. Are you saying that the startup sound plays, and then you start a core and it starts playing more music sounds that you've marked as boot sounds? Or are you saying that if you launch a core while a boot sound is playing, the sound continues playing until it finishes (but it's playing over the top of a launched core) and then stops?
If it's the second one, that's a known issue. But if it's bothering people I will bump it up higher to be fixed
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Actually I've just noticed you're using menu music as a boot up sounds. Have you tried simply getting rid of the _ before all your file names and seeing that that works for you? The intention for the boot up sounds thing is for very short (like 3 second) sounds to play before the real stuff happens
- Sigismond0
- Posts: 339
- Joined: Mon May 25, 2020 2:21 am
- Has thanked: 1 time
- Been thanked: 66 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
GUI update is working great for me. Haven't tested all features, but seems good from what I've seen so far.
- lamarax
- Top Contributor
- Posts: 472
- Joined: Wed Nov 11, 2020 6:28 pm
- Has thanked: 33 times
- Been thanked: 202 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Hello wizzo,
I can't seem to get this feature working. Here's an example .pls I tried with (among others):
Code: Select all
[playlist]
numberofentries=1
File1=http://allstream.rainwave.cc:8000/all.mp3
Title1=Rainwave.cc All Stream
Length1=-1
version=2
PS: I also made a file with only the bare url in it; still no go
-
- Posts: 157
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 98 times
- Been thanked: 46 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.wizzo wrote: ↑Wed Apr 20, 2022 1:16 pm Thanks mate. So I think I've almost got this worked out. I hadn't really tested a setup with *only* boot sounds. The control script thinks you have no music files available so is refusing to start, because it doesn't count start up sounds as regular files. It doesn't fix your problem but you can bring up the GUI by popping a regular music file, without a _ in front, in the music folder and launching it again. You can change the playback setting to disabled in the GUI top stop stuff playing.
I will put a bug fix in the next day or so to make the experience better when you're only using boot sounds.
I'm a bit confused about when you say it's playing into cores though. Are you saying that the startup sound plays, and then you start a core and it starts playing more music sounds that you've marked as boot sounds? Or are you saying that if you launch a core while a boot sound is playing, the sound continues playing until it finishes (but it's playing over the top of a launched core) and then stops?
If it's the second one, that's a known issue. But if it's bothering people I will bump it up higher to be fixed
Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
Re: MiSTer BGM - Background Music for the MiSTer Menu
This is exactly what I need! After using mpg123 to play music but won't stop when I choose any core, I gave up lol
Thank you so much Wizzo, cheers!
Thank you so much Wizzo, cheers!
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Awesome! Thanks for testingSigismond0 wrote: ↑Wed Apr 20, 2022 1:50 pm GUI update is working great for me. Haven't tested all features, but seems good from what I've seen so far.
I will do some testing on this. The radio thing is pretty basic at the moment, I should improve it to support actual playlist files to get that url. I'm surprised the url by itself didn't work though. It seems to play just fine directly with mpg123
Try removing the underscore from all your files and see how it works for you. I'm still thinking you're better off not having anything set as a boot soundStupid Dufus wrote: ↑Thu Apr 21, 2022 1:38 am Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.
Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
You're welcome!
- lamarax
- Top Contributor
- Posts: 472
- Joined: Wed Nov 11, 2020 6:28 pm
- Has thanked: 33 times
- Been thanked: 202 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Hey, whaddayaknow! Tried again today to verify and indeed non-secure, bare urls do work! Yesterday I was attempting with a https url (different than the rainwave one above; in fact it was from arcaderadio.com), which obviously couldn't get resolved.
Sorry for sounding a false alarm
Here are a couple of stations to get anyone started, besides rainwave and its dedicated channels:
- the aptly named nolife-radio
- chiptunes from Japanese computers (MSX, X68000, PC-88 etc.)
- OC C64 SID compositions
- lamarax
- Top Contributor
- Posts: 472
- Joined: Wed Nov 11, 2020 6:28 pm
- Has thanked: 33 times
- Been thanked: 202 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Great job in making automatic updates compatible with the downloader script! However, the correct entry inside downloader.ini should look like this:
I don't have a github account, so I can't post an issue about this there, sorry
Code: Select all
[bgm]
db_url = https://raw.githubusercontent.com/wizzomafizzo/MiSTer_BGM/main/bgm.json
-
- Posts: 157
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 98 times
- Been thanked: 46 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Removed _ from all the files, and now it seems to be working. Will still pick a track at random on a hard reboot or power cycle and no longer plays on top of a core. Thanks!wizzo wrote: ↑Thu Apr 21, 2022 1:23 pmTry removing the underscore from all your files and see how it works for you. I'm still thinking you're better off not having anything set as a boot soundStupid Dufus wrote: ↑Thu Apr 21, 2022 1:38 am Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.
Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
New version is available on downloader. This is mostly bug fixes but I have added an "all" meta playlist which combines all the playlists together, and playlists can now contain subfolders (any level deep) so you can keep your files better organised if you want. I also made the radio playlist file support a little smarter so you should be able to use any .pls files now.
I'm still open to suggestions but otherwise I'd say this thing is almost feature complete. I'll be working on the web remote thing next.
I'm still open to suggestions but otherwise I'd say this thing is almost feature complete. I'll be working on the web remote thing next.
- Sigismond0
- Posts: 339
- Joined: Mon May 25, 2020 2:21 am
- Has thanked: 1 time
- Been thanked: 66 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
Loving the internet radio support. Just need a medium length boot sound to let WiFi come online, then Rainwave chiptune is perfect!
- PistolsAtDawn
- Posts: 358
- Joined: Fri Feb 18, 2022 7:29 pm
- Has thanked: 303 times
- Been thanked: 100 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
This is really great! Thank you for this!
I've got my MiSTer loaded up with EarthBound tracks to start off. Many of those make really chill bg music.
I've got my MiSTer loaded up with EarthBound tracks to start off. Many of those make really chill bg music.
- Captain FPGA
- Top Contributor
- Posts: 373
- Joined: Sun Apr 11, 2021 9:19 pm
- Has thanked: 195 times
- Been thanked: 25 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
So I tried this, the install went through except, I can't get music to come on at start. What am I missing here?
EDIT: NM I'm an idiot. Got it working on startup after downloading the latest bgm script. Great job boss!
EDIT: NM I'm an idiot. Got it working on startup after downloading the latest bgm script. Great job boss!
Dreams don't die!
Re: MiSTer BGM - Background Music for the MiSTer Menu
Can't get the boot sounds to play. I put them in music starting with an _.
Are these working for anyone?
Are these working for anyone?
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: MiSTer BGM - Background Music for the MiSTer Menu
I haven't had any reports of them not working. Are you using a playlist? It will only pick up boot sounds from the current playlist. And what's the full filename of one of them?
Re: MiSTer BGM - Background Music for the MiSTer Menu
They are named like this:
/media/fat/music/_Sega Dreamcast - Boot.mp3
/media/fat/music/_Sony PS1 - Boot.mp3
My playlists are in subfolders with a pls file. Everything else works great. The boot sounds need to be in a playlist as well? I thought they just need to be prefixed with an underscore.
/media/fat/music/_Sega Dreamcast - Boot.mp3
/media/fat/music/_Sony PS1 - Boot.mp3
My playlists are in subfolders with a pls file. Everything else works great. The boot sounds need to be in a playlist as well? I thought they just need to be prefixed with an underscore.