WatchUSeek Watch Forums banner
  • Take part in a short activity and share your valuable opinion on new design concepts for AVSForum! >>> Click Here

Open source timing software.

280316 Views 604 Replies 139 Participants Last post by  tpiepho

Hi guys,

I have a more or less usable version of my timing program that is ready
for initial testing, if anyone is interested.

First the goodies. Here are Windows binaries
http://ciovil.li/tg.zip
and here is the full source code
https://github.com/vacaboja/tg

Now some info on the program. This program is released under the GNU GPL
license, version 2 -- basically you can do what you want with it, free of
charge, no warranty, if you redistribute a (modified) version, you must
distribute also the source code. If you want to build from source, you
need gtk+ (I'm using v. 2.24), portaudio2, and fftw3, plus a C99 compiler
clearly. If you want to run the Windows version, just download the zip
archive, unzip, double click.

This program tries to pick up audio from the default audio input of your
computer, which should be the same that Audacity defaults to, so you can
test the audio setup with Audacity. It does not fiddle with the volume:
just check that it is set to a reasonable level. Of course the rate that
you get from this program, for any watch, is affected by the rate of the
clock of your sound card: the same holds for all timing programs and there
is no escape (except calibrating the card against a reliable time source).

The algorithm I decided to use is quite hungry of computing power, so I
made two versions: "tg" is the full version, "tg-lt" is a lighter version.
The light version sacrifices some accuracy and noise resilience for speed.

My intended audience is amateurs and tinkerers. This program has not been
written for professionals, neither do I want to compete with
professionally built hardware or software, nor with those that can write
better software on their own. In particular I have set to myself the
following three goals.

One. Try a less conventional algorithm to deal with bad audio, at the
expense of lots of number crunching (all other programs for which I did
find information online use possibly some band pass filter and a threshold
trigger, we do it differently). I can currently obtain satisfactory
results from the internal mic of my ThinkPad and a few other lower quality
mics. I don't know how it will perform with a good piezo, but I am
interested (probably, for clean audio, mine is not the best approach).
Your mileage may vary.

Two. To avoid complaints like this one
Review: TickoPrint Android App | Watch Guy
the entire operation of the algorithm is designed to be double-checkable.
In particular, the waveforms that the program associates to the tics and
tocs of the watch are shown in real time, so one can check that they are
properly recognized and properly aligned. The slope representing the
currently detected instantaneous rate is drawn (the blue lines) on the
timing-machine-like graph, etc. See also the discussion here for some
example of such double checking
https://www.watchuseek.com/f6/definition-beat-error-2394130.html

Three. Make it open source, so other people can tinker with the source
code (well, this one was the easy part).

Usage should be quite intuitive for those that know how an escapement
works. See also the thread referenced above for more info.

That's all for now. Any feedback is appreciated.
See less See more
  • Like
Reactions: 5
361 - 380 of 605 Posts
The Korg and other cheap mics are what's called "unbalanced" (two wire) while professional recording technicians use balanced (three wire) cables and connectors. Balanced setups are much lower in noise. The mics that come with time graphing machines are also balanced, but more expensive and more difficult to connect to your computer. In short, the answer is no you can't rewire a cheap unbalanced mix to balanced, but simple tone controls like on my little Behringer mixer/mic preamp can reduce the noise enough to make the program work. Probably the best solution is to simply spend a little more and buy a balanced mic intended for the purpose for $69. You will still need to buy a preamp to interface this balanced mic with your computer. Now we're up around $100 for the mic and the preamp/mixer, which is close to the cost of a complete machine, but I prefer the software to the box.
What I have is actually a modified pre-amp thanks to the help of Guido from Modifying PYLE PP444 Preamp - Reparación de Relojes
I cut two ceramic capacitors out of the curcuit and replaced one electrolytic capacitor with a 105 ceramic. I also removed the rubber dampener from the clip on mic.
All of these changes increased the overall sound quality and seemed to better isolate the actual sound of the watch.

What I currenty have is definitely usable with all of the available timing software, but simply listening to the audio or trying to add it into a video is an annoyance due to the humming noise.
Perhaps my next project will be to build a proper stand for the watch/mic combo so I can properly time various positions of the watch.

If you're interested, here's are some videos demonstrating all the changes I made to the microphone/pre-amp.
The last half of video 5 is what I'm currently using (after the capacitor replacement) and it sounds decent. Still a lot of unfavorable noise though.
https://www.youtube.com/playlist?list=PLOMif0oGPj4AXfAc7JXbbU6aBayAiXYdW

Electronics Technology Electronic device I/o card Circuit component
Electronics Cable Electronic device Technology Wire
See less See more
2
That's a phono preamp not a mic preamp. Phono preamps use the RIAA curve to reduce record noise. I know you've modified it, but a proper mic preamp would help a lot, especially in the hum department, as that device is boosting the signal in hum area (60 to 120HZ), and cutting where a watch makes most of its sound, up in the treble region. My setup is a little noisy, but perfectly usable for videos, especially with the EQ (tone controls) applied.

EDIT: OMG I listened to your recordings, that is WAY too much hum!!!! You need to swap that thing out for a proper mic preamp and use it to play records. Get a microphone preamp
that takes an unbalanced input like the Behringer XENYX 502 I'm using. Here's my rig in action.
  • Like
Reactions: 1
That's a phono preamp not a mic preamp. Phono preamps use the RIAA curve to reduce record noise. I know you've modified it, but a proper mic preamp would help a lot, especially in the hum department, as that device is boosting the signal in hum area (60 to 120HZ), and cutting where a watch makes most of its sound, up in the treble region. My setup is a little noisy, but perfectly usable for videos, especially with the EQ (tone controls) applied.

EDIT: OMG I listened to your recordings, that is WAY too much hum!!!! You need to swap that thing out for a proper mic preamp and use it to play records. Get a microphone preamp
that takes an unbalanced input like the Behringer XENYX 502 I'm using.
The last 8 seconds of Test 5 is my best sample with the least amount of hum.
Now that I think about it, I believe that he actually used a shielded RCA cable soldered to the pickup mic and it produced almost zero hum.
I don't have enough knowledge of these cable designs to do it properly.

On a side note - is there a way, through hardware, to force single channel audio into both the left and right channel? When I record the watch ticking, it only plays on the right side. I know you can put it on both channels through software but what about a hardware solution?

:-!
The last 8 seconds of Test 5 is my best sample with the least amount of hum.
Now that I think about it, I believe that he actually used a shielded RCA cable soldered to the pickup mic and it produced almost zero hum.
I don't have enough knowledge of these cable designs to do it properly.

On a side note - is there a way, through hardware, to force single channel audio into both the left and right channel? When I record the watch ticking, it only plays on the right side. I know you can put it on both channels through software but what about a hardware solution?

:-!
That's better, but still a lot of hum. https://www.amazon.com/Mizar-3-5mm-Stereo-Audio-Adapter/dp/B01DZV37VY/ref=sr_1_2_sspa?ie=UTF8&qid=1524155837&sr=8-2-spons&keywords=1%2F8+female+to+rca+male+y+adaptor&psc=1
Wouldn't the female end need to be 6.5mm to accommodate the mic?
The only 3.5mm in my setup is the 3.5mm male that goes into the computer
You're right, if that's what's on the end of your mic.
You're right, if that's what's on the end of your mic.
Odd...I can't find a 6.5mm female to 2 male RCA.

I guess I'll need to add ANOTHER between the mic and pre-amp
https://www.amazon.com/InstallerParts-Splitter-Compatible-Most-Audio-Systems/dp/B008NCD5WC/
I'm getting output on both channels from the adapter I just purchased. Now to do something about the buzzing o|
I'm getting output on both channels from the adapter I just purchased. Now to do something about the buzzing o|
https://www.amazon.com/Behringer-50...UTF8&qid=1525630292&sr=8-1&keywords=xenyx+502
  • Like
Reactions: 1
I'm getting output on both channels from the adapter I just purchased. Now to do something about the buzzing
https://www.amazon.com/Behringer-50...UTF8&qid=1525630292&sr=8-1&keywords=xenyx+502
Managed to eliminate some of the buzzing in my setup with a high pass filter. It's good enough to use with the timing software and OK to listen to but it's still not perfect. I think before I buy another pre-amp I will make a few of my own piezo pickups as I just purchased 20 extras.

Edit: I actually tested with a different higher quality pre-amp and I'm still having a similar sound. I believe the mic is just not properly shielded and/or piezo is picking up other signals from screens/microwave/lights.
Equalizer APO with Peace plug-in high pass filter seemed to improve the sound tremendously!
Audio: https://clyp.it/ke0zxt03
tks for the OS X install - i just upgraded to High Sierra and basically:

1. uninstalled brew
2. installed brew
3. installed:
'brew install dmnc/horology/tg'

and now i'm back up with tg-timer!

tks!

works great and is a fabulous tool - most appreciated!
Did you do any changes in your mac other than switching to an external microphone as the input? I've tried using both a piezo mic and a Røde M3 mic and I can't get any readings in TG at all... I'm using a Steinberg UR22 connected to my mac and it seems that both mics are connecting and is giving audio (I can record the ticking fine in Logic), but nothing happens in TG timer. I've already calibrated with a quartz watch from the internal mic, but the program just won't pick up anything with external mics.

TIA
Did you do any changes in your mac other than switching to an external microphone as the input? I've tried using both a piezo mic and a Røde M3 mic and I can't get any readings in TG at all... I'm using a Steinberg UR22 connected to my mac and it seems that both mics are connecting and is giving audio (I can record the ticking fine in Logic), but nothing happens in TG timer. I've already calibrated with a quartz watch from the internal mic, but the program just won't pick up anything with external mics.

TIA
I'm nowhere near an expert in this area, but I've been playing around A LOT lately with various timing applications.
Do you have a recording of the audio that your mics are picking up?
This works well on my Surface Pro 4 using the stock mic on the back of the device.
Did you do any changes in your mac other than switching to an external microphone as the input? I've tried using both a piezo mic and a Røde M3 mic and I can't get any readings in TG at all... I'm using a Steinberg UR22 connected to my mac and it seems that both mics are connecting and is giving audio (I can record the ticking fine in Logic), but nothing happens in TG timer. I've already calibrated with a quartz watch from the internal mic, but the program just won't pick up anything with external mics.

TIA
i use a Logitech C270 webcam at the mic input - plug into the USB port, adjust settings (Apple->System Preferences->Sound->Input tab)... tg-timer should use the default sound input according to system prefs

btw, tg-timer continues working just fine under OS X 10.13.5

hth,

willie
on the Gulf of Mexico
  • Like
Reactions: 1
I am having problems getting the program up and running properly. I am on Fedora 27. I used git to download the source and compiled it with no problems. I can run the "tg-timer" which seems to work fine with a logitech webcam microphone -- I have no problems picking up data from any of my mechanical watches using the logitech webcam.

Text Font Technology Line Screenshot


My problem is that I cannot get the software to calibrate.

I am attempting to calibrate by placing the webcam mic on one of my quartz watches. When I attempt to calibrate by checking the "calibrate" box in the upper right menu. the software responds by displaying the red clock and the "cal (wait) 0%" comments. Occasionally (rarely) the clock will turn green for a moment and the dialog will report "cal (acq) 0%" but then immediately goes back to "cal (wait 0%)" and nothing else ever happens. The calibration procedure is never completed.

Unfortunately, the "documentation" in the earlier post doesn't really explain what is supposed to be happening or what these cryptic comments mean, or how to troubleshoot if the system fails. That lack of disclosure makes it impossible to debug the failed calibration procedure.

by any chance is there a debug mode in which additional status information is displayed? or additional documentation somewhere that better explains the calibration procedure?

thanks.
See less See more
My problem is that I cannot get the software to calibrate.

I am attempting to calibrate by placing the webcam mic on one of my quartz watches. When I attempt to calibrate by checking the "calibrate" box in the upper right menu. the software responds by displaying the red clock and the "cal (wait) 0%" comments. Occasionally (rarely) the clock will turn green for a moment and the dialog will report "cal (acq) 0%" but then immediately goes back to "cal (wait 0%)" and nothing else ever happens. The calibration procedure is never completed.

Unfortunately, the "documentation" in the earlier post doesn't really explain what is supposed to be happening or what these cryptic comments mean, or how to troubleshoot if the system fails. That lack of disclosure makes it impossible to debug the failed calibration procedure.

by any chance is there a debug mode in which additional status information is displayed? or additional documentation somewhere that better explains the calibration procedure?

thanks.
Can you get the software to determine the rate of your quartz watch?
Maybe the audio signal isn't ideal and the software is having issues differentiating the "ticks".
Can you get the software to determine the rate of your quartz watch?
No.

I have tried a few different quartz watches, all with the same result -- the calibration procedure does not complete and no intelligible error codes are issued. All that I see is a red clock face icon (which I assume is bad because it is red), an occasional green clock face icon (which I assume is supposed to indicate something good, but I'm not sure what), along with some animated stacked squares next to the clock face (who's meaning is undefined), and a progress meter that stays on 0%.

Maybe the audio signal isn't ideal and the software is having issues differentiating the "ticks".
I'm reluctant to make assumptions, but perhaps the problem is that the mic isn't picking up the quartz watch ticks. To eliminate that possibility I have tried several different quartz watches, none of which seem to work. All the mechanical watches seem to work fine.

I'm not quite sure what the calibration procedure is supposed to accomplish. It's not clearly explained anywhere. The result displayed in the calibration box is a dimensionless number. Should we assume that sample 0.8 number is a rate that is expressed in units of seconds/day?
See less See more
I reckon your mic signal isn't high enough. Calibration can take some time, like 15 mins, but it usually does it continuously in my experience - there may be some small breaks in 'transmission'. The green squares indicate signal strength I believe, and when working well all four will be displayed (same when using the program after you've set it up).
by any chance is there a debug mode in which additional status information is displayed?
Hi, thanks a lot for your post.

There is a debug version which puts a lot of even more cryptic stuff on stdout and draws mysterious graphs. You have to run "make tg-timer-dbg" instead of "make tg-timer".

Perhaps, I can try to debug this issue. Could you record a minute or so of your favorite quartz watch and send it to me?
361 - 380 of 605 Posts
Top