WatchUSeek Watch Forums banner

Open source timing software.

279926 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
601 - 605 of 605 Posts
Which branch? You mention a couple in that post, and I tried json-dump and color-coded-tics. I didn't see any new features in the interface after switching branches and recompiling (which i may have messed up. I'm not a huge git user). The filters and spectrogram look badass, exactly what I'm looking for!
Try new-stuff. One needs python development libraries and some python packages to get the spectrograms and some of the other features enabled. The configure script will tell you what it found or did not find in a summary at the end. It should be possible install everything needed with some brew and pip commands. There are some mac build instructions included but I only dig out my 2012 macbook air occasionally to test on mac so they aren't entirely up to date. The need to pip install libtfr for the spectrograms at least is missing.

I'm familiar with the basics of the timegrapher, not with the specifics of TG-timer. I guess what I'm looking to understand is how it decides where the lock and unlock are happening.
I've written a somewhat technical description in this post, Open source timing software. But I got tired of writing before I got into too much detail about the peak finding algorithm. Amplitude is basically: the loudest peak is the lock, the first peak is the unlock, the time between them tells you the amplitude. This doesn't work well when you have an odd waveform with five or six peaks of nearly equal amplitude. The first one you posted was not great. Your more recent post with the new microphone is much better, with fewer more distinct peaks. Looks like the signal is a bit weak though.
See less See more
Try new-stuff. One needs python development libraries and some python packages to get the spectrograms and some of the other features enabled. The configure script will tell you what it found or did not find in a summary at the end. It should be possible install everything needed with some brew and pip commands. There are some mac build instructions included but I only dig out my 2012 macbook air occasionally to test on mac so they aren't entirely up to date. The need to pip install libtfr for the spectrograms at least is missing.
I cannot get this sucker to build on my '16 MBP with Ventura. I suspect the problem is that I have Anaconda on here, so python is not in a standard library (but all the paths are updated). I installed Python from python.org removed the Anaconda paths, updated ./bash_profile and /etc/paths and still nada.
I did see the need to reinstall libtfr, so did that, also I needed to install CoreFoundation, which is part of PyObjC package. I can't see what else I am missing though.
My suspicion is that somewhere there's a C routine calling "python" instead of "python3" but I can't find it. (i've even re-aliased 'python' to 'python3' just to be sure and ... no dice)
I did try the suggestion to include the LIBS variable, but that doesn't seem to have helped either (maybe i'm putting in the wrong thing there, too)?

Attached is my most recent config.log. Let me know if you see anything jumping out at you.
Thanks!

Attachments

OK i might have figured it out
line 5105 of configure has a call to sysconfig that returns an incorrect path replacing that call with python3-configure seems to have fixed the problem
Code:
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5
printf %s "checking python extra linking flags... " >&6; }
  if test -z "$PYTHON_EXTRA_LDFLAGS"; then
    PYTHON_EXTRA_LDFLAGS=config-python3 --libs --prefix
Needs some more testing though. but it did compile and build, so .... (fingers crossed)

Source: Issue 3588: sysconfig variable LINKFORSHARED has wrong value for MacOS X framework build - Python tracker
Hey all,

Thank you for this wonderful software!

I am running across a bug on MacOS where clicking CENTER in the trace makes the program crash... Opened a bug on github here: [Bug] Crash when clicking CENTER on the trace on MacOS Ventura · Issue #41 · vacaboja/tg
It's not a showstopper IMO but thought I would document it :)
Needs some more testing though. but it did compile and build, so .... (fingers crossed)
I'm guessing it didn't work. I dug out my old Macbook and did some testing. There were a number of issues to fix on MacOS. Also some problems that only appeared when run for the first time without an existing settings file. The experience should be much improved now. To be sure you get the latest code, clone again from github from scratch if the word "rebase" doesn't mean anything to you.

The updated mac instructions should work much better now. I've also updated the homebrew recipe for tg, so you can install with with brew install --HEAD xyzzy42/horology/tg-timer. To get a working python on my mac, I just used Homebrew. brew install python numpy scipy did everything. Then pip3 install matplotlib libtfr to get some additional packages that are not part of brew. Worked pretty well. It's not as good as Linux package management, but better than Windows by wide margin.
601 - 605 of 605 Posts
Top