WatchUSeek Watch Forums banner

Open source timing software.

318K views 673 replies 145 participants last post by  aimhigh9685 
Mr. Mamino merged a pull request I made into tg almost one year ago and I haven't heard from him since. Someone else sent a in PR to add an audio source selection dialog and configurable sampling rate around six months ago, there's been no responses to it other than from me.

I've added a feature for live play back of audio, after applying the filters, to aid in positioning and evaluating the microphone. It's been very helpful. It turns out touching the movement holder is much more important that being near the balance.

It's open source, so anyone can add features if they want. It's easy to clone on github and then it's available to anyone.
 
Unfortunately I have only 3 green dots- so I can not see the "Degrees"
Increasing the sensitivity (of the adapter) at the soundcard does not improve the situation.
Is there a possibility to "tell" tg ( maybe in the settings) to show the "deg" even if I have only 3 green dots?
No, but one could modify the code to do that.

However, the waveform display has marks for amplitude on it, so even if it doesn't tell you what it is, you can read it from the display. The blue line, marking the start of first noise where the impulse jewel hits the pallet fork, shows the amplitude on the scale on the top. Without the blue line, you'll just need to estimate yourself where the unlocking happens in relation to the drop.

15674485
 
Just compiled your source (from 18 days ago?) but I didn't have the time to test it out.
I'll try to find some time tomorrow!

Edit: Is this git (xyzzy42/tg) the correct one? I built it and there are no extra features like live playback.
I used git clone -b hpf-once https://github.com/xyzzy42/tg.git
Yes, but that PR just has some speed improvements, you can see me description in the PR on github. I haven't put audio output out on github yet. I still want to make a better control loop to minimize the latency of the output audio.

There's another PR from someone else that has the audio source selection and sampling rate controls.
 
||PaMacCore (AUHAL)|| Error on line 667: err=''what'', msg=Unspecified Audio Hardware Error
||PaMacCore (AUHAL)|| Error on line 1277: err='-66748', msg=Unknown Error
Error opening audio input: Internal PortAudio error

Any Idea?
You're on a Mac and I just do Linux, so I don't know. But I recognize that error, it the same one reported here, Error opening audio input Mac OS Big Sur 11.1 · Issue #22 · vacaboja/tg
That seems to have been a problem with needing to grant tg-timer access to the microphone.

It seems like lots of things have this problem with Macos Big Sur 11.1. Maybe it's a problem with PortAudio on Big Sur. Elsewhere it seems to be solved by using a version of PortAudio that has some fixes for newer macos versions, as in this problem report, MacOS BigSur: ||PaMacCore (AUHAL)|| Error on line 1316: err='-66748', msg=Unknown Error · Issue #299 · spatialaudio/python-sounddevice
 
At low BPH, the noise reduction logic might see the ticks as noise. That would be certainly be an issue below 7200 BPH. More than 7200 would be ok I think, as more than half of the 250 ms noise reduction windows would have a tick in them. But, you could try enabling "lite" mode, which disabled noise reduction.
 
I think I fixed the issue with low BPH not working. The fix is in PR #27.

I don't have such a movement to test. So what I did was capture the sound from a 18,000 bph movement and then slow it down using audacity. Then I created a virtual audio source which was fed from the recorded file and let tg use that. It worked until I slowed it down enough for 12,000 bph, which failed due the above bug. After fixing it, 12,000 bph works.
 
I lowered MIN_BPH and was able to get it to work at 9000 bph. I do not know what you mean by "quadratic wave". To make a more realistic test track at an arbitrary bph, I used audacity to generate a rhythm track with 150 bpm (150*60 = 9000 bph), 2 beats/measure, and metronome ticks as the sound. This seems more realistic than a sawtooth or sine wave. The tick is much too short for an amplitude reading.

It does not work to auto-detected beat rate at 9000 bph, but if I enter that speed manually then it works. To auto-detect, the beat rate must be added to the list, and once done, auto detecting 9000 works too.

I suggest you try a test sound generated as I have described above.
 
Here is a pattern generated by a 28800bph square wave tone generator.
Using sound generated by the same computer audio device running tg is a meaningless comparison. Any error in the audio rate for recording will be matched by an equal error in playback. It will always appear as perfect, even if it is not.

@qyburn, your first picture looks like the signal is too quiet, and so the gain is up very high, which shows the noise between the ticks. Ideally it should be a straight line with no noise between each pixel.

I am using the Google USB-C earbuds that came with my phone, but plugged into my computer. It works best with the control pod, which contains the microphone, resting on the movement or movement holder in some way, rather than just being near the movement.

Example from Bulova 5AR movement in holder.
15766980


Seiko 5626 in case with bracelet and watch sitting on top of microphone:
15766984
 
Updated TG with new features available for those who can build it.

contrate_wheel hasn't responded to activity on github for almost a year, so I've put together a version with all my work that's finished.

It's available as source on github, and if one is using Fedora there are binary packages on COPR. Building from source is quite trivial on Linux and MacOS and there are instructions in the README.

New features:
  • BPH values down to 8100 will work.
  • Significant performance improvement. Should be over twice as fast now.
  • Alternate layout with horizontal paperstrip can be toggled, allowing for a larger paperstrip with a greater length of displayed time.
  • Free zoom on the paperstrip beat scale. Instead of being fixed at a tenth of a beat, it can freely zoom from one beat to one hundredth of a beat.
  • Division between paperstrip and waveforms can be dragged to make one or the other larger.
  • Audio device setup dialog that allows choosing input device and audio sample rate.
  • High-pass filter cutoff frequency can be adjusted.
  • A few bug fixes and internal improvements.
Some screen shots.

Paperstrip made wider, notice zoom changed to 8.2 ms instead of 20 ms.
15846328


Horizontal layout.
15846333


Audio setup dialog:
15846335
 
I have also made an experimental branch where I added a Python interpreter into tg, so that Python scripts can be run inside and, access audio and timing date, and generate graphics.

As an initial use of these features, I added a simple graph of the high pass audio filter's effect. And the ability to get time and frequency reassigned spectrograms of the audio data.

The graph here will update as the slider is moved to adjust the HPF. I was curious how the group delay of the filter would affect timing.
15846350


The spectrogram of the last single beat detected. The white line shows the point tg detects as the beat (0 on waveform displays) and the blue where it's measuring amplitude from.
15846354


A spectrogram of the last second of audio. Detected beats are marked. The two clicks at the end are the mouse button press and release from clicking to make the graph.
15846357
 
However when trying to use one of the new functions, at least on my desktop computer, this error occurred.
I do not even need to translate that from Spanish to know what it says, "problem." But nothing more than that, it is as useless as, "my watch doesn't work." Linux and MacOS can automatically make crash dumps with backtraces with real information. I do not know how to do that on Windows. I suggest reporting an issue on my github and maybe a more technical Windows user will be able to investigate.
 
I changed the direction the line slopes. It seem more natural to me that time should progress from left to right, so if the watch runs slow, the beats arrive later than they should, and so they move to the right.

I also checked what a Witschi machine did and it slopes the same way.
 
I put the watch between 2 pillows and this is one example of the results
View attachment 16045685
This is not very good audio. TG will apply automatic gain to the signal, so you will not see the pulses get smaller or larger even if they are louder or quieter. But this gain makes everything louder, not just the beats but also the noise. So look at the signal line between the two beats and see the many small pulses, this is background noise which has been amplified and is not that much smaller than the actual beats. Ideally you should have a flat line between beats. But the problem is not that you have too much noise, but that your signal is too weak.

Try setting up a monitor that lets you listen to the microphone with some decent headphones. One can tell easily what manner of attaching the microphone is better for picking up the sound. I have found with earbud phone microphone that:
  • It is good to have the microphone touch the movement, not just be near it.
  • Which side and what location of microphone pod touches the movement makes a significant difference.
  • Holding the microphone rigidly is not good. Just resting against movement is better.
 
Also what does the circled Red or Green check mark indicate?
And the green dots meaning?
Happy green watch vs frowning red watch indicate if a beat has been synced too. The green dots relate vaguely to signal quality, but really I think that is fake, meant to placate those who do not understand what a timegrapher does or how it does it, with a simple "you have four dots!" picture.

The reality is that the dots are the averaging interval. Tg will attempt to find a consistent beat signal throughout the last 2, 4, 8, and 16 seconds. This is the 1-4 dots. For example, if there are consistent beat sounds detected for the last 8 seconds, but when looking at the last 16 seconds there is now a gap included with no recognizable beat, you would get 3 dots. And your s/d and amplitude measurement would reflect the average of the beats from the last 8 seconds. If not even 2 seconds worth is detected, then you get the red watch and no dots. But also, if amplitude can not be detected, then a 16 second interval will get 3 dots instead of 4.

I changed that last bit in a newer version so that number of dots always displays averaging interval. The last dot will be hollow if the signal is not good enough to measure amplitude, because the distinct pulses of unlock - impulse - lock can not be detected.
 
Hello, after updating my mac on monterey, unfortunately the timegrapher is showing just a black window. Have already uninstalled tg and brew and installed new, but with the same effect. Any troubleshoot here? Would be great, because i am loving this Tool :)
Have you tried building from source? brew can install all the dependencies and then the instructions in the README, just a few commands, will work. I'm not an expert with brew on macs, but I think the brew install of tg will install binaries, and those might be out of date on Monterey.

Also try the solutions from post #461 and #465, it could be one of those audio permission things with macos updates. And maybe check that there isn't a dialog somewhere you didn't notice asking for microphone permission when you start the app that is still waiting for a response.
 
Based on someone else's recommendation for the same unit (but at a higher price), after two tries I finally got this unit. No instructions, so... some questions:
I got the version with the stand and the 9V battery, but it appears the electronics are basically the same common boards in both, so I think I can guess what the other version does. They have a new version, called type 5 or 3rd generation, which has only USB connection and no battery, which is different. But I think you have the type 2 or 2nd generation.

The USB cable is solely to charge the battery.
The microphone jack is for connecting it to an audio input. Use a 4-pin TRRS plug in the device. A 3-pin will short it! Connect the cable with the other end having 3-pins to something with a line-in or mic-in, while use the 4-pin plug cable when connecting so something that connects to a headset with headphones and a mic, e.g. a phone.
The switch powers controls the amplifier board, based on an LM386 chip, available for < $1 on the usual places.
The red led is on the amplifier board.
The blue led is on the li-ion battery charger and voltage regulator board. It is a sort of gas gauge and charge status indicator. Even the datasheet for the control IC, probably ETA9640, doesn't say how it works exactly. "The LED is to indicate the battery voltage level, which serves as an 4-level battery gas gauge." That is all they say. I think more flashes means more charged? And it will go solid when it is finished charging.

I don't know what the purpose of a 3 head USB cable would be? Usually this kind of USB cable are only for charging and might not even have wires for the data pins. They have different connectors, so you can charge from/to e.g. USB-A and micro-USB with one cable by picking the two connectors of the three that you need.
 
I'm still lacking some icons,
Try installing "adwaita-icon-theme" with brew or port. I'm not really a mac dev and don't know the details here. In tg, I just use standard gtk icon names. So they should be provided by the gtk theme, rather than anything tg needs to do to provide them. The theme, with style sheets and icons and other assets, is distinct and separable from the gtk libraries, so it is possible to build and run gtk software without a theme or an icon set installed.

Have you tried the python branch? I was able to build it with brew installed python dependencies easily enough. This enables the filter graphs and the nifty spectrograms. However, pip didn't want to install the libtfr python package on the mac for me.
 
The spectrograms in my latest version will do a good job of letting you see how good your signal is. Both signal level and background noise. I've also added a tppm display to help with adjusting levels, but that version isn't released yet.
 
Top