Snowman screen saver playing 17 MIDI Christmas songs - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Christmas Code (https://qb64phoenix.com/forum/forumdisplay.php?fid=48) +---- Thread: Snowman screen saver playing 17 MIDI Christmas songs (/showthread.php?tid=1294) Pages:
1
2
|
Snowman screen saver playing 17 MIDI Christmas songs - Dav - 12-17-2022 I updated my old Snowman screen saver to test the experimental (and $UNSTABLE) MIDI playback feature of QB64PE. This is a simple looping animation that plays 17 different Christmas songs continuously. It's just something nice to have on the screen whenever you need a snowy atmosphere. It sure is nice to have MIDI playback in QB64PE, the only negative is that it takes a rather long time to open a MIDI file. Loading these 17 MIDI files takes a couple minutes on my PC. I found that MIDI feature is most stable when opening MIDI files at the beginning and leaving them open throughout the program. Opening/Closing them over and over in the program caused hangups, so I ended up just loading them all at startup and doing a _SNDSTOP when changing to a start new song. I'll post the code here for the curious, but you will need to download the archive to run it. You will need QB64PE v3.2 or higher to use the $MIDISOUNDFONT metacommand. I haven't tested this in Linux yet, but I guess it will work if the Linux version also supports the new MIDI metacommand. - Dav snowman-v103.zip (Size: 710.24 KB / Downloads: 88) Code: (Select All) '========== RE: Snowman screen saver playing 17 MIDI Christmas songs - Pete - 12-17-2022 WOW! That's a keeper. Nice to have some Christmas music while I code out Keywords of the Christmas Season. I used Alt+Enter a couple of times to reduce it to a small window while writing this post. Just one matter of utmost concern. Your title title led me to believe there would be an old snowman in the screen saver. All I see is Steve, in a funny hat, sweeping the snow off my New England rental property. Pete +2 RE: Snowman screen saver playing 17 MIDI Christmas songs - mnrvovrfc - 12-17-2022 Excellent! This worked on Manjaro KDE without problems. And without Wine. Some people might have to lower the volume a lot when listening with headphones LOL. Also Dav it's a good thing you called it "screensaver" because some kids might start being put off by the long "loading time". Tell one of those kids, "Just keep doing your stuff for like 3 minutes because it suddenly pops up and plays." RE: Snowman screen saver playing 17 MIDI Christmas songs - SMcNeill - 12-17-2022 @Dav Here's a trick for you to try with the upgraded version of QB64-PE: Code: (Select All) songhand&(s) = _SndOpen(song$(s), "stream") Change the line in your code where you open the songs to look like the above, and then give it a run. Let me know how long it takes to load the songs for you then, and whether or not they even play for you. As you mentioned in your own post, these features are still $UNSTABLE and need as much testing and feedback as we can give them. RE: Snowman screen saver playing 17 MIDI Christmas songs - Dav - 12-17-2022 @Pete, thanks for trying it out! @mnrvovrfc: Thanks for testing it in Linux. Glad it works. @SMcNeill: Thanks! Wow, what a speed increase adding that. Less than a second and they all load and play fine. I'm going to update the download with the edit code. - Dav RE: Snowman screen saver playing 17 MIDI Christmas songs - Dav - 12-17-2022 I updated the download with Steve's change, or you can edit the code you already have. Cool to have MIDI playback again in QB64! - Dav RE: Snowman screen saver playing 17 MIDI Christmas songs - SMcNeill - 12-17-2022 (12-17-2022, 03:06 PM)Dav Wrote: @Pete, thanks for trying it out! Glad it worked as advertised for you! Some info on "stream", as per our wiki: https://qb64phoenix.com/qb64wiki/index.php/SNDOPEN
RE: Snowman screen saver playing 17 MIDI Christmas songs - Dav - 12-17-2022 I never noticed that parameter. Glad to know about it. Thanks. - Dav RE: Snowman screen saver playing 17 MIDI Christmas songs - Jack - 12-17-2022 very nice Dav RE: Snowman screen saver playing 17 MIDI Christmas songs - Dav - 12-17-2022 (12-17-2022, 03:58 PM)Jack Wrote: very nice Dav Thanks, Jack. Hey Steve, or Pete, I just noticed there is a Christmas code section now. If you would like to move this into there, please do. Sorry I should have posted this in there. - Dav |