QB64 Phoenix Edition
Another Christmas Tree and Snow - With Music - 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: Holiday Code (https://qb64phoenix.com/forum/forumdisplay.php?fid=48)
+---- Thread: Another Christmas Tree and Snow - With Music (/showthread.php?tid=4248)



Another Christmas Tree and Snow - With Music - SierraKen - 12-22-2025

Here are 3 files zipped up. The code, the picture of a real tree, and the song. The song is a Public Domain song I found on archive.org called "Noel (Holy Night)" by The Venetian Trio recorded in 1916.

Enjoy! 

Here is also a YouTube video of it: 



-Ken


RE: Another Christmas Tree and Snow - With Music - Dav - 12-24-2025

Nice.  Historic song.  Recently learned O Holy Night was the first live music performance ever broadcast over radio.

Thanks for sharing.

- Dav


RE: Another Christmas Tree and Snow - With Music - ahenry3068 - 12-24-2025

(12-22-2025, 08:09 PM)SierraKen Wrote: Here are 3 files zipped up. The code, the picture of a real tree, and the song. The song is a Public Domain song I found on archive.org called "Noel (Holy Night)" by The Venetian Trio recorded in 1916.

Enjoy! 

Here is also a YouTube video of it: 



-Ken

    I liked this a lot,  so I put my own little spin on your code.    Hope you don't mind.   Merry Christmas.

OOPSIE. I didn't reinclude the mp3 .. Please get it from Ken's archive above !

[Image: image.png]


RE: Another Christmas Tree and Snow - With Music - ahenry3068 - 12-24-2025

Another version that makes it easier to play with the "SNOW" appearance.   

Just the source.   Needs jpg,  png & mp3 from above files. 

Code: (Select All)

'Merry Christmas
'Updated on Dec. 22, 2025
'Needed files: Noel.mp3 and ChristmasTree.jpg
'Noel (Holy Night) by The Venetian Trio recorded in 1916. https://archive.org/details/Voices_of_Christmas_Past_1898_to_1922
'Christmas Tree photo is of the Plumas County Courthouse Christmas Tree in 2024. Photo taken by me.
Dim MaxFlakes As Integer
Dim MinFlakeSize As Integer
Dim MaxFlakeSize As Integer

MaxFlakes = 4200
MinFlakeSize = 6
MaxFlakeSize = 24


Dim x(MaxFlakes + 1)
Dim y(MaxFlakes + 1)
Dim size(MaxFlakes + 1)
Dim i As Long
Dim snow As Long
Dim pic As Long
Dim snd As Long
Cls
snow& = _NewImage(1024, 1024, 32)
Randomize Timer
_Title "Merry Christmas! Noel (Holy Night) by The Venetian Trio recorded in 1916."
start:
GoSub snow
sF& = _LoadImage("SnowFlake.png", 32)
i& = _LoadImage("ChristmasTree.jpg", 32)
Screen i&, snow&
pic& = _CopyImage(0)

snd& = _SndOpen("Noel.mp3")
If snd& Then _SndPlay snd&
Do
    _Limit 1000
    _PutImage (0, 0), pic&
    For t = 1 To MaxFlakes
        y(t) = y(t) + (Rnd * 5) + 2
        x(t) = x(t) + 1
        If x(t) > 1024 Then x(t) = ((Rnd * 800) * 4) - (800 * 2)
        sz = size(t)
        Flake& = _NewImage(sz, sz, 32)
        _PutImage , sF&, Flake&
        _PutImage (x(t), y(t)), Flake&
        _FreeImage Flake&
    Next t

    For t = 1 To MaxFlakes
        If y(t) > 800 Then y(t) = 0
    Next t
    _Delay .005
    _Display
    Cls
    a$ = InKey$
    If a$ = Chr$(27) Then End
    If a$ = " " Then GoTo start
    If snd& Then
        If Not _SndPlaying(snd&) Then _SndPlay (snd&)
    End If
Loop

snow:
For t = 1 To MaxFlakes
    x(t) = ((Rnd * 800) * 4) - (800 * 2)
    y(t) = Rnd * 800
    size(t) = Int(Rnd * MaxFlakeSize) + MinFlakeSize
Next t
Return





RE: Another Christmas Tree and Snow - With Music - SierraKen - 12-24-2025

Great versions guys! Thank you! Merry Christmas Everyone!