Church Bells Tower - auto bell chimer

Post your working scripts, libraries and tools
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Church Bells Tower - auto bell chimer

16 Sep 2018, 04:45

Hello!

I made a small script for bell lovers or... Church people. The script can chime/strike quarter-hours and on the hour. I do not know if this has ever been done here on the forum... So, my apologies if yes.

Features:
- strike quarter-hours
- strike on the hour once... or the number of hours
- toll distinctively every six hours [early morning, at noon, in the evening and at midnight]
- tick/tock background sound
- easy to configure intervals to chime or to keep silent
- option to display time when it chimes/strikes/toll ;-)
- display a random Bible quote at a specified interval
- informs you about equinoxes and solstices, and how much of the current day or year has elapsed
- option to display / indicate / observe Christian feast days; for Orthodox and Catholic worshippers; automatically calculates the dates for Easter and related celebrations
- option to regularly play semantron drumming sounds on days of feast in Christianity;
- option to start at boot [if compiled]

Download from Microsoft Windows Store:
https://www.microsoft.com/en-us/p/churc ... fqbhn18h4k

ZIP Package compiled [x64 / x32], includes AHK sources and sounds:
http://marius.sucan.ro/media/files/blog ... -tower.zip

Source code on GitHub
https://github.com/marius-sucan/ChurchBellsTower

Current version: 1.9.7 - 2018/11/16.

Screenshot:
Image

Best regards, Marius.
Last edited by robodesign on 16 Nov 2018, 06:00, edited 30 times in total.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
garry
Posts: 1509
Joined: 22 Dec 2013, 12:50

Re: Church Bells Tower - auto bell chimer

16 Sep 2018, 05:18

vă mulțumesc foarte mult
very nice, big work , added to autostart

just a script to check time ( if not syncronized)
time/date synchronize from user tmplinshi > https://autohotkey.com/boards/viewtopic ... 28&t=46997
syncronize to > EET - Eastern European Time or EEST - Eastern European SUMMER Time ( like ROMANIA )

Code: Select all

;- this script    = syncronize to >  EET - Eastern European Time  or  EEST - Eastern European SUMMER Time ( like ROMANIA )
;- user tmplinshi = 
;- https://autohotkey.com/boards/viewtopic.php?f=28&t=46997 ---

;- https://www.timeanddate.com/time/dst/
;- https://www.timeanddate.com/worldclock/romania/bucharest
;- https://www.timeanddate.com/worldclock/
;- https://www.science.co.il/language/Locale-codes.php
;- 歐洲 EET / EEST Eastern European Summer-Time
;-----------------------------------------------------

#warn
setworkingdir,%a_scriptdir%

; 以管理员身份运行
if !A_IsAdmin {
	Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
	ExitApp
}

global dst

if SynTime.DoIt()
    msgbox, 262208,SUCCESS ,Succes synchronized %dst%
else
    msgbox, 262208,NO SUCCESS ,	NO Succes synchronized CET
return

/*
if SynTime.DoIt()
	MsgBox, 64, 成功 , 同步北京时间成功!
else
	MsgBox, 48, 失败 , 同步失败!
; 同步北京时间。用法: SynTime.DoIt()
*/


Class SynTime
{
	DoIt() { ; 成功返回 1
		return this.SetLocalTime( this.BeijingTime() )
	}
	SetLocalTime(YYYYMMDDHHMISS) {
		FormatTime, t, %YYYYMMDDHHMISS%, yyyy/M/1/d/H/m/s/0
		VarSetCapacity(SystemTime, 16, 0)
		Loop, Parse, t, /
			NumPut(A_LoopField, SystemTime, (A_Index-1)*2, "UShort")
		return DllCall("SetLocalTime", "Ptr", &SystemTime)
	}
	BeijingTime() { ; 返回 YYYYMMDDHHMISS
		whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
		whr.Open("HEAD", "http://baidu.com", true)
		whr.Send()
		whr.WaitForResponse()
		_date := whr.GetResponseHeader("Date") ; 示例数据: Mon, 21 Apr 2014 14:58:23 GMT
		arr := StrSplit( _date, [A_Space, ":"] )
		oMonth := {Jan:"01",Feb:"02",Mar:"03",Apr:"04",May:"05",Jun:"06",Jul:"07",Aug:"08",Sep:"09",Oct:"10",Nov:"11",Dec:"12"}
		Mon    := oMonth[ arr.3 ] ; 月份英文缩写转换成数字
		timestamp := arr.4 Mon arr.2 arr.5 arr.6 arr.7 ; YYYYMMDDHHMISS 格式的日期
		;p2:=1                             ;- ( UTC + 1 / CET - Central European Time - begin last sunday in octobre / e.g  sun 2018-10-28 03:00>02:00 )
		p2:=2                              ;- ( UTC + 2 / EET - Eastern European Time
        stringmid,q,timestamp,1,8
        stringmid,Y,timestamp,1,4
        q:=(q)
        lsm := LastSunday(Y . "03")
        lso := LastSunday(Y . "10")
        if (q >= lsm) and (q < lso)
           {
		   DST:="EEST summertime UTC+3"
           p2:=(P2+1)                     ;- ( UTC + 2 / CEST - Central European SUMMER Time - DST begin last sunday in mars / e.g. sun 2018-03-25 02:00>03:00 )
		                                  ;- (UTC  + 3 / EEST - Eastern European SUMMER Time
           timestamp += +P2,hours
           }
        else
		   {
		   DST:="EET normaltime UTC+2"
           timestamp += +P2,hours
		   }
		;timestamp += 8, Hours ; 加 8 小时就是北京时间
		return timestamp
	}
}

;-----------------------------------------------------------------------
;- Function last sunday in mars and october for DST daylight saving time
;- https://autohotkey.com/board/topic/97664-find-specific-wday/ ---
LastSunday(Date)
    {
    Date += 31, D
    Date := SubStr(Date, 1, 6)
    Date += -1, Day
    FormatTime, WD , %Date%, WDay
    Date += -(WD - 1), D
    return, SubStr(Date, 1, 8)
   }
;============================================================================
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

16 Sep 2018, 15:35

Thanks , Garry; I am glad you like it.

Suggestions and ideas are welcome.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

20 Sep 2018, 06:36

Just released version 1.5.

Change log:

1. Migrated to AHK_H
2. It strikes the bells without waiting for the echo to end. When the application strikes/tolls, it plays the bell sound multiple times at the same time. This makes it sound more natural...
3. New option to set the interval between strikes. This interval is randomized each time, within a margin of half a second.
4. New and improved sound clips for each event [quarter, hour, noon, midnight].
5. The TickTock sound no longer gets interrupted when bells strike.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
garry
Posts: 1509
Joined: 22 Dec 2013, 12:50

Re: Church Bells Tower - auto bell chimer

20 Sep 2018, 10:03

thank you Marius , I didn't tried AHK_H yet

an old script from ahk user Nilson Rodrigues , hear bird song every half hour ( the folder \Cantos with mp3-files ( bird-song ) is missing )
if someone interesting , where shoul'd I upload the short mp3-files ?

;- a script from Nilson Rodrigues , 20100510 , Brasil /Ouro Preto / Minas Gerais ( btw music 'Adeus Minas Gerais' = https://www.youtube.com/watch?v=pqDvAuR1skg )
;- https://autohotkey.com/board/topic/5326 ... -warbling/
;- needs the folder \Cantos with mp3-files ( bird-song ) which is missing

Code: Select all

;------------------------------------------------------------------------------------------
; Created  by: Nilson Rodrigues - https://autohotkey.com/board/user/11196-nilsonrdg/
; Modified by: nick             - https://autohotkey.com/board/user/860-nick/
; MP3 files can be found here:  - www.4shared.com/file/Drynebkn/Relgio_que_anuncia_a_hora_com_.html  ;- no more / mp3-files missing
; nilsonrdg                     - https://www.blogger.com/profile/06879254768854439764
;                               - http://nilsonrdg.blogspot.com/
;------------------------------------------------------------------------------------------

;- https://autohotkey.com/board/topic/53264-a-clock-that-shows-the-time-with-brasilian-birds-warbling/
;- needs the folder \Cantos with mp3-files ( bird-song )  which is missing

#NoEnv
#Persistent
; Script para um relógio que mostra a hora (traytip) ao som de cantos de pássaros brasileiros.
; Você pode modificar este Script como quiser, principalmente melhorá-lo.
; Web: http://nilsonrblog.blogspot.com/
; Definindo o caminho onde o script e sons devem ser colocados.
CaminhoBase = %A_ScriptDir%
Cantos =
(
000000|Urutau
003000|Sabiá
010000|Curiango
013000|João-de-barro
020000|Jaó
023000|João Teneném
030000|Coleiro - Fibra
033000|Garibaldi
040000|Sanhaço Frade
043000|Trinca Virando - Canto e Dando Boi
050000|Corruíra do Brejo
053000|Trinca Ferro
060000|Coleiro Paulistinha - Tui Tui - Canto Flautado
063000|Rouxinol
070000|Coleiro - Tui-Tui Puro
073000|Pitiguari ou Gente-de-fora-vem
080000|Sabiá Laranjeira Peito Laranja
083000|Juruviara
090000|uirapuru
093000|Gavião Carijó
100000|Azulão
103000|Trinca-Ferro Classico
110000|Coleiro - Zeo Zeo Zeo
113000|Patativa
120000|Pássaro Preto
123000|Galo de Campina
130000|Sanhaço da Amoreira
133000|Curió Avinhado
140000|Tico-Tico
143000|Cravina - Cabeca de Fogo
150000|Tui Tui Classico do Coleiro
153000|Cotovia
160000|Sabiá - Canto Aguirre
163000|Tiziu
170000|Pintassilgo
173000|Choro Boi
180000|Choquinha Carijo
183000|Cardeal do Sul
190000|Bigodinho
193000|Coleiro - Apito
200000|Canario da Terra - Metralha
203000|Bico de Veludo
210000|Bem-te-vi
213000|Bico de Pimenta
220000|Curió Paracambi
223000|Corocoxó
230000|Coleiro - Tiu Vi Vi
233000|Sací
)
Loop, Parse, Cantos, `n
{
  StringSplit, S, A_LoopField, |
  Canto%S1% := S2
}
SetTimer, ChecarHoras, On
Return
; ------------------------------------------------------------------------------
; Scripts para checar a hora a cada segundo e escolher o som a toca
ChecarHoras:
  Agora := A_Hour . A_Min . A_Sec
  If (Canto%Agora%)
    Cantar(Canto%Agora%)
Return
; ------------------------------------------------------------------------------
; Função que reproduz o som selecionado
Cantar(Canto)
{
  Global CaminhoBase
  TrayTip, São %A_Hour%:%A_Min% horas, Você está ouvindo o canto: %Canto%
  SoundGetWaveVolume, VolumeAtual
  SoundSetWaveVolume, 10
  SoundPlay, %CaminhoBase%\Cantos\%Canto%.mp3, Wait
  SoundSetWaveVolume, %VolumeAtual%
  Sleep, 1000
  TrayTip
  Return
}
; ------------------------------------------------------------------------------
; Scripts para atalho para verificar a hora: Tecla Win + Q
#q::
  TrayTip , Agora, %A_Hour%:%A_Min%:%A_Sec% do dia %A_DD%/%A_MM%/%A_YYYY%, 3
Return
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

20 Sep 2018, 10:29

@garry: the zip file package contains the compiled version of the script, so you do not need to have AHK_H.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
garry
Posts: 1509
Joined: 22 Dec 2013, 12:50

Re: Church Bells Tower - auto bell chimer

20 Sep 2018, 10:48

thank you Marius, bells-tower-x32.exe works fine ( I needed msvcr100.dll )
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

20 Sep 2018, 14:26

Okay, thanks for the reminder. I updated the ZIP file. Now it includes the DLL and also.... I made more fixes and improvements.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

21 Sep 2018, 09:50

Updated to version 1.5.2. Even more bug fixing...
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

24 Sep 2018, 05:13

New version: v1.5.3 .

* Added option to toggle dynamic volume for the sound level of the chimes.
* Bug fixes and improvements.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

27 Sep 2018, 10:43

Updated to v1.5.4. Bug fixes.

It now also sports a personalized icon for the application .

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

28 Sep 2018, 04:50

Updated to v1.5.5. I fixed a bug reported by Garry. Now, it will play the audios on both left and right channels.

Version 1.5.6 shows the time and the short date simply by hovering the tray icon. Other really small fixes...

ZIP Package compiled [x64 / x32], includes AHK sources and sounds:
http://marius.sucan.ro/media/files/blog ... -tower.zip

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

03 Oct 2018, 11:33

Hello, people !

I just released a new version: 1.6.1.

This one brings further fixes and small improvements.

At the About window, you can see a progress bar for the entire year and one for the current day, both highlighting how much of the current year and day has elapsed.

In the same window, you can also learn when the next equinox or solstice is going to occur, and when was the previous one.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

09 Oct 2018, 10:38

Holla!

Major new release: v.1.7.0

- [new] option to strike additionally every 5/10/50/100 minutes [the user can define the frequency]
- [new] options to control width and height of the on-screen display
- improved and simplified the tray menu
- improved the preferences window layout
- it can store its settings in the windows registry, instead of an INI file
- and of course , bug fixes

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 07:25

This product is now available on Windows Store:

https://www.microsoft.com/en-us/p/churc ... fqbhn18h4k
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
burque505
Posts: 628
Joined: 22 Jan 2017, 19:37

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 09:56

Great job, Marius! Kudos on getting it into the Windows Store.
EDIT: I'd love knowing how you packaged it. :bravo:
Regards,
burque505
User avatar
Bon
Posts: 17
Joined: 11 Jan 2014, 07:31

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 11:34

Very nice job! Just downloaded it and tested, but noticed that due to the timer firing every 15:th second, the bells toll slightly off time. May I suggest something like

Code: Select all

 SetTimer theChimer, % ((15 - Mod(A_Min, 15)) * 60 - A_Sec) * 1000 - A_MSec
The timer would then have to be reset at the end of theChimer.
This would also have the benefit of not wasting any CPU cycles... ;)
Quidquid Latine dictum sit altum videtur
"Anything said in Latin sounds profound"
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 13:58

Very nice job! Just downloaded it and tested, but noticed that due to the timer firing every 15:th second, the bells toll slightly off time. May I suggest something like

Code: Select all

 SetTimer theChimer, % ((15 - Mod(A_Min, 15)) * 60 - A_Sec) * 1000 - A_MSec
The timer would then have to be reset at the end of theChimer.
This would also have the benefit of not wasting any CPU cycles... ;)
Thank you very much. The next application is KeyPress OSD :-).

You are suggesting I use:
SetTimer theChimer, % ((15 - Mod(A_Min, 15)) * 60 - A_Sec) * 1000 - A_MSec
... instead of SetTimer, theChimer, 15000

But what do you mean exactly by... resetting it at the end?

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
robodesign
Posts: 388
Joined: 30 Sep 2017, 03:59
Facebook: marius.sucan
GitHub: mariussucan
Location: Romania
Contact:

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 14:05

Great job, Marius! Kudos on getting it into the Windows Store.
EDIT: I'd love knowing how you packaged it. :bravo:
Regards,
burque505
Thank you very much , Burque505.

I used the Desktop AppConverter Bridge provided by Microsoft. Then, I use MakeAppx to unpack it and modify the AppManifest.XML to suit my needs and the dashboard requirements. And in the end, I use MakeAppx to repack it.

The converter is only needed once. Each time you update the pack, you repack what you have.

You cannot write in the application's own folder. You must use %appData% folder. And...

You can write in the Windows registry, but not in the «real» one...

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
My home page.
burque505
Posts: 628
Joined: 22 Jan 2017, 19:37

Re: Church Bells Tower - auto bell chimer

17 Oct 2018, 14:10

Thanks a million, Marius. I had never heard of those tools.
Regards,
burque505

Return to “Scripts and Functions”

Who is online

Users browsing this forum: arcticir and 51 guests