Jump to content
Brian Enos's Forums... Maku mozo!

Free laptop shot timer for airsoft training


Alex Brown

Recommended Posts

Hey everyone,

I've been lurking around the forums for a while, but I decided I'd make my first post somewhat productive.

I was getting a little bit annoyed with the fact that although there are two free iphone-based shot timers available, there are none for the PC (that I know of), and definitely no free ones. No, I'm not talking about a par timer for dry fire, I'm talking about a sound-based timer that you could use to keep track of your el pres times while training with an airsoft pistol, for instance.

so, since I ended up with a WE 1911 in my stocking this year, I thought I'd go ahead and make one since the christmas cash I was planning on using to buy a timer for range use is going to the gunsmith for a tune-up on the .45.

Now, I'll warn you, I programmed this in about an hour, so I'm sure there are bugs, and I'm sure the install won't work for all of you, but that's why i'm posting it... try it out, and if you have suggestions, I'm open! I'd like to eventually make a graphical user interface of some kind so users don't feel like they've slipped back in time to the DOS age.

You'll need to do a google search for 'matlab component runtime' and install this if you don't have matlab installed on your computer. This will take some time, but once it's installed the program SHOULD work. It's ideal for people with laptops that have built-in microphones, although I'm sure using an external mic plugged into your computer will work as well.

Let me know how it works for you, and remember to read the README file!

thanks! :cheers:

Alex Brown

EDIT: PLEASE USE THE LATEST VERSION, UPLOADED IN A LATER POST

basic_shot_timer_noruntime.zip

Edited by Alex Brown
Link to comment
Share on other sites

Cool!

I'm at work so I can't download it, yet, but did you include the source?

I did not, but I can... it's not very long and I think I've already found a timing-related error. I'll post an updated version if it is in fact a problem.

If I post the source, would you like the matlab code, or the compiled C?

Link to comment
Share on other sites

Alright,

I fixed one glaring bug in the timing algorithm, changed the beep tone (program starts listening for a shot AFTER the beep tone ends, so I made it short (.25 sec) to make sure nobody outruns it.

I also added a nice graphic that lets you know when the program is recording. everything else is still command-line DOS style.

Finally, I made it so you do not change the threshold before every string of fire. currently, if you want to change the threshold, you have to re-start the program.

I've been having good luck with a 'threshold' value of 35-45, depending on where in the room i'm standing relative to the computer.

If there's a large interest in the source code after some people have tried it, I can certainly post it.

basic_shot_timer_noruntime_0_1_1.zip

Link to comment
Share on other sites

So, what am I doing wrong?

Your readme file says to download the runtime from http://www.mathworks.com/matlabcentral/fil...ller-automation.

The zip file that's downloaded from mathlab has two files, mcr_release14_auto....exe and .AU3.

When I run the .exe, there's an error saying that the Matlab v7.0 installer was not found in the folder.

I assumed this meant it was supposed to be in the zip folder, along with the other two files???

The matlab web site says the MCRInstaller.exe will be installed from this mcr_release14 auto installer.

Where is it?

Thanks

Edited by g.willikers
Link to comment
Share on other sites

So, what am I doing wrong?

Your readme file says to download the runtime from http://www.mathworks.com/matlabcentral/fil...ller-automation.

The zip file that's downloaded from mathlab has two files, mcr_release14_auto....exe and .AU3.

When I run the .exe, there's an error saying that the Matlab v7.0 installer was not found in the folder.

I assumed this meant it was supposed to be in the zip folder, along with the other two files???

The matlab web site says the MCRInstaller.exe will be installed from this mcr_release14 auto installer.

Where is it?

Thanks

Let me look into this. The problem is that every computer I own has Matlab on it already, so when I tested the MCR download, I might have been fooled by the fact that my computer could already run the program, and has files and folders in place that other computers won't.

If there's a way for me to host the file WITH the MCR, I will do that. Much less hassle for those downloading it, but it'll be aboutr 150Mb download instead of 500kb... thus is the efficiency of Matlab. Writing a program this small with that package is killing a fly with a sledgehammer.

In the meantime, will someone try using this link to download the component runtime? http://www.bioacademy.gr/bioinformatics/Br...d/download.html

these guys have a program built in the same version of matlab as I used, so the MCR version requrements should be the same.

Edited by Alex Brown
Link to comment
Share on other sites

Well, I went to the bioacademy web site, downloaded the mcrinstaller file, installed it and everything seemed ok.

Installing the setup for the timer program yields a dos command screen saying the .bat file is inflating and asking if the files in the program should be replaced.

Eh??

Trying it both ways, yes and no got the same apparent results - a quick blink of the screen and the dos window disappears.

Then trying to open the timer program .exe file gets an error of a missing mclmcrrt76.dll.

But this file is in the matlab runtime win32 folder.

Now what???

Edited by g.willikers
Link to comment
Share on other sites

Man, I'm so sorry for all the trouble. I tried to install from the beginning to see what might be going on in your case. I started with just the zip file, extracted it, and double clicked the install file.

During the install, that DOS window appears, disappears, and the following files pop up in addition to the readme and setup file:

-basicshottimer_0_1.ctf

-basicshottimer_0_1.exe

then when i run the program .exe file for the fiirst time, a DOS window comes up and says it's extracting the CTF archive... then says CTF archive extraction complete, and then the shot timer program runs in the DOS window like it's supposed to.

When you look back into the folder basic_shot_timer_noruntime, a folder called 'basicshottimer_0_1_mcr' should appear.

If I were you, I'd delete everything except the zip file and try again (don't uninstall MCR, just delete my program's directory), now that you have the MCR from matlab installed properly. Please let me know how this works, and thanks for bearing with the teething issues and my incompetent instructions. I don't often make standalone software, so the ins and outs are a little fuzzy for me. Nevertheless, The program's already given me back the 2 hours I spent making it 100-fold in useful feedback, and I hope it can do the same for others as well...

Link to comment
Share on other sites

It worked!!

Alex, your last directions did the trick; your program is installed.

Tomorrow I'll give it a try with my trusty airsoft pistola.

Thanks much, both for the program and your patience.

A computer guru I ain't.

Good job, Mr. Brown.

At this rate, you are going to be very popular around here.

Link to comment
Share on other sites

Glad to help. Hope it works well for you. I'm just too damn cheap to buy my own timer.

Some tips that might make finding the 'sweet spot' in threshold setting a little easier:

-I programmed this thing very simplistically- essentially, the program 'looks' for peaks in the sound trace that are greater than .09sec apart (not many people run splits faster than this, I don't think). If your microphone input volume is too high, the 'blast' from the pistol will distort in the recording, and the program might get confused. If changing the threshold adjustment at the beginning of the program doesn't work, make sure your input volume isn't too high or low. In your 'accessories' menu in windows, use the sound recorder to record your voice, loud claps, maybe even your airsoft. If the sound is distorted, turn down your computer's input level. If it's too quiet, turn it up.

-My microphone input level is set around 50%, and if I stand in the vicinity of the computer while training, with the threshold on the program set to 35, neither the TV, the ventilation fan, or the cat contribute to my shot string as recorded by the program.

-If you see more shots than you fired, especially if they're separated by something eerily close to .09 seconds, you probably need to turn up the threshold adjustment (by quittting the program and restarting it until I write a new version that's more user friendly) because it's picking up echo.

-One other known bug right now is that if the program registers zero shots, it quits. This is also an easy fix, but until some people use this and fill a laundry list of things to fix, I'll leave well enough alone.

Link to comment
Share on other sites

Hello Alex,

Tried the program this morning, using the info you supplied about setting the volume of both the mic and the program.

Everything worked just fine with one exception.

On my Sony Vaio with Vista, after the last shot, when I hit "any key" to get the results, sometimes the program quits.

(the Enter key seems to work best).

Other times, it works perfectly, giving a read out just like a store bought timer.

The difference as to whether it shuts down or not seems to be how long from the last shot to hitting "any key" to get the results.

Around ten seconds seems to be the magic number for success. Less causes the shutdown.

There's a second window, with two eyeball like things, that opens when the timer starts.

It goes away when the results show.

Normal?? Something to do with the sound recording, maybe?

I'll play with it some more later today.

It looks like a winner.

Thanks, again.

Link to comment
Share on other sites

the eyeball looking things are a placeholder graphic (supposed to look like a cassette tape) to let the shooter know the program is recording. do you see the text 'Recording' written above that graphic?

I'll have to look into the other thing. As far as I know there are only three ways 'out' of the program. One is selecting 'n' when it asks you if you want to continue, the second is the bug relating to when the program doesn't hear any shots, and the third is closing the window with the 'x' button. Let me try it on my Vista-equipped laptop and see if i can reproduce your problem during my practice this evening. I developed the program on my netbook, which runs XP, so I guess there could be compatibility issues (although I doubt it).

thanks for the feedback!

Link to comment
Share on other sites

First of all thanks for this great program.

I report this error.

I think that it happens because the program didn't heard the shots? and then it gives the error at line 100?

Welcome to the Basic Shot Timer for Airsoft Practical Shooting Training version

0.1.

Copyright 2010 Alexander Allen Brown

commercial use, modification, sale, or misrepresentation of this program are pro

hibited

contact alexanderallenbrown@gmail.com for suggestions, problems, etc.

________________________________________________________________________________

__________________

NOTE: you must have a properly configured sound card, with speakers and micropho

ne

NOTE: if threshold adjustment does not produce adequate results, adjust your com

puter input level

________________________________________________________________________________

__________________

for best results, experiment with shot volume thresholds

enter threshold percent (keep mic from distorting for best results)

50

Press enter when ready. You will have 5 seconds to make ready...

when you are finished shooting, press any key

GET READY!!

recording finished

your shot times are (zero included)

shottime =

0

your shot splits are

??? Attempted to access shotsplit(2); index out of bounds because numel(shotspli

t)=1.

Error in ==> tests at 100

MATLAB:badsubscript

C:\Users\x\Desktop\basic_shot_timer_noruntime_0_1_1\basic_shot_timer_noruntime_0

_1_1>

Link to comment
Share on other sites

This is a known bug. I plan to fix it in the next version, but first, do any of you have a desire for the program to export an excel or text file containing your practice session times? I'm working on this right now, but I'll go ahead and release the next version sooner if this isn't important. I've already fixed the bug mentioned, and I've also incorporated an option to go back and change the threshold without exiting the program.

Let me know!

EDIT: and yes, this error occurs when the program doesn't hear your shots. is this happening all the time for you, or just occasionally?

Edited by Alex Brown
Link to comment
Share on other sites

Hi Alex,

It is good to see another software developer interested in this. I threw together a similar Java app and lost interest once I got it doing what I needed it to do. I posted my work on Google code.

My experience was that requiring a re-distributable like mat-lab (or the JRE) as well as a full size computer killed the appeal for most people. SureFire already has a shot timer for the iPhone so it doesn't seem like an appealing platform to develop for (and I don't have one). Android has Java support which is a big plus for me since it also makes simultaneously targeting J2SE easier. At the time I looked at the Android APIs and they weren't ready, but things have improved (a lot, holy crap) since then. The main problem was that you couldn't get access to the raw audio data. Apparently they went to API level 3 which has the necessary functionality a few weeks after I evaluated Android.

I think there is a lot of compelling software that has yet to be developed for this sport. There is no reason match scoring shouldn't include the full set of shot times as well as video of the shooter running the stage. Shoot me an email if you are interested in collaborating.

Link to comment
Share on other sites

EDIT: and yes, this error occurs when the program doesn't hear your shots. is this happening all the time for you, or just occasionally?

I'm working on the correct configuration of the treshold and microphone, but unfortunately i don't have many time. It is happened only two times.

It is great if the program can save the session in excel.

Your work is very useful and unique i think!

Edited by thepossible
Link to comment
Share on other sites

  • 3 months later...

This is a known bug. I plan to fix it in the next version, but first, do any of you have a desire for the program to export an excel or text file containing your practice session times? I'm working on this right now, but I'll go ahead and release the next version sooner if this isn't important. I've already fixed the bug mentioned, and I've also incorporated an option to go back and change the threshold without exiting the program.

Let me know!

EDIT: and yes, this error occurs when the program doesn't hear your shots. is this happening all the time for you, or just occasionally?

OMG! Cool app! finally manage to make it work with all the downloads.

Thank you sir, thank you veeeeeeeeeery much. I've been looking for such apps for ages.

Just a suggestion, it would be cool to make it standalone app.

Love to have the option for exporting to Excel. It would be a good source for database.

Imagine running this app with a bluetooth mic (within range ofcourse). It's sooooooooo cool!

Link to comment
Share on other sites

  • 4 weeks later...

I have tried mic threshold from 10-50 and I'm still getting low draw times. Maybe I need to laptop a little further away.

My draws are ranging from .49-.59 I have an airsoft stop plate that is plugged into my timer. Using it I hit mid .75-.85 draws. With airsoft if I remember right you take away .08 to get the correct time due to the BB slow travel to the stop plate. It records the time from the hit not the sound.

Any suggestions?? I can try moving the computer around. I moved it some but it didn't make a difference.

Thks

Flyin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...