Welcome! Log In Create A New Profile

Advanced

old wall clock simulation

Posted by metric 
old wall clock simulation
March 09, 2015 03:44PM
My parents have an old wind-up wall clock with a gong that strikes every hour. Last year I had recorded the sound of that clock. Yesterday when we changed the time in the US I decided to simulate that on my dockstar. I thought I will share this simple shell script with the nice folks on this forum.

My Debian dockstar is connected via USB sound card to a nice set of computer speakers (built-in power save mode) that are on 24/7. I am running this script with crontab on the top of the hour.

#!/bin/bash
# d is current time in 0-12 format in my time zone to count strikes
# e is current time in 0-24 format to keep it quiet at night
# 1strike is edited sound of a short strike
# strikend is a strike with sustain and some gear sound at the end
# for the effect
# I do 1strike.mp3 (d -1) times in a loop and then strikeend.mp3 at the
# end 

d=`TZ='YOUR TIME ZONE' date +%I`
e=`TZ='YOUR TIME ZONE' date +%H`

# added following to remove leading zero from date output like 09
let d=$(expr $d + 0)
let e=$(expr $e + 0)


 if [ "$e" -lt 23 ] && [ "$e" -gt 7 ]
 then
        for (( c=1; c<d; c++ ))
                do
                mpg123 -q -f 120 /home/metric/clock/1strike.mp3
                done
        mpg123 -q -f 120 /home/metric/clock/strikeend.mp3
 fi



Edited 1 time(s). Last edit at 03/11/2015 11:50PM by metric.
Re: old wall clock simulation
March 10, 2015 04:53PM
That's awesome. Upload the mp3 files also please.
Re: old wall clock simulation
March 11, 2015 03:26PM
add a hacked dpf to that with a clock face graphic output and there we have another use for an old pogoplug an alarm clock

:)

nice to see a fun use for a plug!
Re: old wall clock simulation
March 11, 2015 11:57PM
@JohnW, the sound is not all that great, just my memories of that particular clock. You can find better samples on the web, just search for clock sound effects. I also saw the big ben somewhere. I used audacity to further shorten the duration.

@Gravelrash, I agree, thanks to a post on this forum this dockstar is also running mpd server for internet radio stations and dlna renderer that plays music from another dockstar dlna server.

BTW I do not want to add a display because
1. it is tucked away with the speakers above a closet
2. It is fun when people hear the gong and start looking around for a clock.
Re: old wall clock simulation
March 12, 2015 12:37AM
> 2. It is fun when people hear the gong and start
> looking around for a clock.

:)) cool! thanks.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: