April 29, 2024, 06:44:27 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


A Morse Keyer

Started by GWS, October 13, 2011, 08:05:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

October 13, 2011, 08:05:41 AM Last Edit: October 13, 2011, 08:17:11 AM by GWS
Hi folks,

Here's a little program that lets you practice sending morse code ..  ;D

Before I hear your boo's and hisses, this wasn't an easy program to write ..  ::)

There were several problems.

Since Microsoft blocked direct access to the soundcard, generating a half decent morse tone isn't easy - neither wav nor midi sounds like to be switched on and off quickly.

I finally used a midi 'whistle' sound for the morse tone as a reasonable approximation to a normal morse tone.

Then there's the problem of providing the user with something like a morse key using the keyboard.
Here again, tapping on keys is rather clumsy and has some latency. 

I've used the spacebar - it seemed the easiest key to use to tap out morse.  :)

And finally, there's the small matter of the morse timing logic.  If you get it wrong it just generates gibberish.

Bear in mind, the computer has no idea what code you are trying to send - nor how fast you are bashing the input key.  It does best if you keep to a fairly uniform speed - I've set it for an overall 10 words per minute.

For example, the code for the letter 's' is dit-dit-dit.   If you tap too slowly, you will probably get 'e e e' coming up in the text box.  (The letter 'e' code is just one dit - so you get three of them). If your sending is just right - you will get the 's' typed out.

Subroutine Decode does all the work in figuring out what you are sending.  It's a bit complicated, so if anyone is interested how it works, just ask and I'll post an explanation.

Given the difficulties involved, the program's turned out pretty well I think ..

I've attached the source and .exe in the zip file ..

best wishes, :)

Graham
Tomorrow may be too late ..

Egil

Thanks Graham! ;D
As I am used to higher speeds, I had some difficulties adjusting, but for novices in "the noble art", the speed will be just fine. Personally I'll stick to my electronic keyer, running 25-30 wpm, but I have already learnt a lot studying your code... ( pun NOT intended).

--...  ...--

Egil

...-.-
Support Amateur Radio  -  Have a ham  for dinner!

GWS

Cripes - 25 wpm .. :o

I don't think I could get my old fingers - or my spacebar - to bounce up and down that fast ..  ;D

all the best, :)

Graham
Tomorrow may be too late ..

Doc

Nice work Graham!

Seems like I've always had a passing interest in amateur radio and especially the electronics behind it. Many moons ago, I even started a Morse training course in hopes of eventually earning a license. (Still a requirement back in the day) Unfortunately, LIFE came along, then computers, then programming and I got side-tracked to the point that I never completed any of it.  :-[

I've never had any interest in the voice side of things, but still dream of communicating around the world using only code and an inexpensive hand-rolled radio of my own doings. :)

...your little project may have just prompted me to give it another go. :)

As always, thanks for sharing!

-Doc-

GWS

Doc,

So glad you're still around ..  ;D  Hope you are keeping well.

There's so much fun and fulfillment to be had from programming - and a bit of electronics ..  :P

Just look what these guys do with bits of wire and capacitors ..  :o

http://www.crystalradio.net/crystalsets/lyonodyne/index.shtml

I'm not very good at reading morse unless it's nice and slow - I had a colleague G3XOF (Alan) - who could be working on some project, and listening to incoming morse at the same time.  Amazing.

But I get most satisfaction out of programming these days - in Basic of course.  :)

all the best, :)

Graham
Tomorrow may be too late ..

W4GNS

 Works like a charm !  ;D
Gary Scott-W4GNS