This is pretty much the same as my regular Mantel Clock, except I cut the size of it all in half. It uses a 400 x 300 window so you can keep it running and watch it while doing other work on your computer. I also had to decrease the font size of the Roman Numerals. I cut everything in half down to the widths of the hands. I'll probably use this one a lot more than my original one. That is why I made a new topic for it, so nobody passes it up. It also uses the new way of the hour hand moving between hours as the minutes go, as I just added to the original one a couple days ago. Plus of course it does the same chiming song of the famous Westminster Quarters song that Dav helped me with. Thanks again Dav! I also kept the ability to hear it at any time using the Space Bar. I hope you all get this one because I'm sure you will want to use it more often than the large one. Oh, I also had to move a couple of the hours over so they wouldn't go over the white circles.
'Mantel Clock Mini by SierraKen with help for Westminster Quarters hourly song by Dav on the QB64.org forum.
'Created on 1-2-2020
'This is made from my regular Mantel Clock.
'I made this so you can keep it running and away from your other computer work.
_TITLE "Mantel Clock Mini - Space Bar plays chimes." CX
= 200: CY
= 150: R
= 150: C
= _RGB32(0, 78, 0) fillCircle CX, CY, R, C
LINE (50, 150)-(350, 300), C
, BF
CX
= 200: CY
= 150: R
= 100: C
= _RGB32(183, 139, 100) fillCircle CX, CY, R, C
ss = (60 - sc) * 6 + 180
x2
= INT(SIN(ss
/ 180 * 3.141592) * 70) + 200 y2
= INT(COS(ss
/ 180 * 3.141592) * 70) + 150 n2 = (60 - sc) * 6 + 180
x3
= INT(SIN(n2
/ 180 * 3.141592) * 80) + 195 y3
= INT(COS(n2
/ 180 * 3.141592) * 80) + 147.5 clock song
CX
= 200: CY
= 150: R
= 5: C
= _RGB32(0, 0, 0) fillCircle CX, CY, R, C
'from Steve Gold standard
Radius
= ABS(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF
minutes
= TIMER \
60 - hours
* 60 seconds
= (TIMER - hours
* 3600 - minutes
* 60) hours = hours + (minutes / 60) 'Code added to make hour hand move between numbers.
'Seconds
s = (60 - seconds) * 6 + 180
x
= INT(SIN(s
/ 180 * 3.141592) * 60) + 200 y
= INT(COS(s
/ 180 * 3.141592) * 60) + 150 'Minutes
m = 180 - minutes * 6
xx
= INT(SIN(m
/ 180 * 3.141592) * 60) + 200 yy
= INT(COS(m
/ 180 * 3.141592) * 60) + 150 'Hours
h = 360 - hours * 30 + 180
xxx
= INT(SIN(h
/ 180 * 3.141592) * 45) + 200 yyy
= INT(COS(h
/ 180 * 3.141592) * 45) + 150 'Chimes
song = 0
'note frequencies
IF notes
= 1 THEN note
= 311.13 'D# IF notes
= 2 THEN note
= 246.94 'B IF notes
= 3 THEN note
= 277.18 'C# IF notes
= 4 THEN note
= 185.00 'F# IF notes
= 6 THEN note
= 185.00 'F# IF notes
= 7 THEN note
= 277.18 'C# IF notes
= 8 THEN note
= 311.13 'D# IF notes
= 9 THEN note
= 246.94 'B IF notes
= 11 THEN note
= 311.13 'D# IF notes
= 12 THEN note
= 277.18 'C3 IF notes
= 13 THEN note
= 246.94 'B IF notes
= 14 THEN note
= 185.00 'F# IF notes
= 16 THEN note
= 185.00 'F# IF notes
= 17 THEN note
= 277.18 'C# IF notes
= 18 THEN note
= 311.13 'D# IF notes
= 19 THEN note
= 246.94 'B
'queue some sound
sample
= SIN(ttt
* note
* ATN(1) * 8) '340Hz sine wave (ttt * 440 * 2p) sample
= sample
* EXP(-ttt
* 3) 'fade out eliminates clicks after sound ttt
= ttt
+ 1 / _SNDRATE 'sound card sample frequency determines time 'do other stuff, but it may interrupt sound
ttt = 0
hour2 = hou
IF hour2
> 12 THEN hour2
= hour2
- 12 ttt = 0
'queue some sound
sample
= SIN(ttt
* 240 * ATN(1) * 8) '340Hz sine wave (ttt * 440 * 2p) sample
= sample
* EXP(-ttt
* 3) 'fade out eliminates clicks after sound ttt
= ttt
+ 1 / _SNDRATE 'sound card sample frequency determines time 'do other stuff, but it may interrupt sound
two: