Apply morse code onto a curve

Hey guys,
I’m trying to script a sentence in morse code. The output I want is a line segment in dash and dots following the rules of Morse code.

  • The length of a dot is 1 time unit.
  • A dash is 3 time units.
  • The space between symbols (dots and dashes) of the same letter is 1 time unit.
  • The space between letters is 3 time units.
  • The space between words is 7 time units.

Basically, I want to apply this to a curve and obtain the curve segmented according to morse code.

For example,

‘the quick brown fox’ in morse code is " - … . --.- …- … -.-. -.- -… .-. — .-- -. …-. — -…-"

I want to apply this to a curve and get this in segments.

I hope I have explained the problem. I know it’s a bit geeky, But anyone with suggestions to resolve this would be great.

Thanks,
AM

1 Like

:rofl: you said it!

The idea is to have a sequence of numbers defining the length of “on” and “off” state.
Make mass addiction > partial results and then evaluate length to get parameters, and shatter with those parameters. Then doing a dispatch will let you keep/see only the “on” state.
This part is actually the simplest, just 4 components.

To achieve your sequence of numbers you can smartly insert characters and then “translate” them using unicode.

Reverse-engineering this will explain more than words.


morse-code to curve.gh (24.5 KB)

13 Likes

Where did you get your Morse Code table?

Here https://morsecode.world/international/morse2.html
I searched for the easiest to copy-paste.
There are errors?

PS1 i wrote brown as BOWN …
PS2 the space character, i’ve translated to ‘_’ but it could have just been translated into itself in the first translation, making it " = " in the first dictionary and " =7" in the second dictionary…

I wasn’t checking you, I was just wondering how you got it into such a nice GH format.

Yes, many morse code tables are shown in 2 or more columns and selecting them mess up the order.
In that page the <div>s are probably in an order which made the selecting easy.
Then removing the spaces with notepad++ is a 30 sec task, using ALT+drag to edit many rows at once:
n++
(I’m saying this just for who don’t know this :upside_down_face: … notepad++ should be built-in on windows!)

2 Likes

Riccardo, You Rockstar!
It’s just perfectly what I wanted.
Reverse-engineering it makes sense of the logic.

I can now complete my tattoo!

Thanks buddy!

1 Like

whoa!
Please double… triple check if the dictionary i’ve used is correct! (I’ve just copy-pasted from a random google result).
Check that everything is correct and translate back to counter proof the correct-ness of everything.

2 Likes

Absolutely, I cross-checked already.

Will do multiple proof reading before inking!

Thanks anyways, Appreciate it!

1 Like

Just as an aside, there’s a great book “The Victorian Internet” by Tom Standage that makes the case the telegraph was a more world-shaking development than the WWW. I tend to agree.

https://www.amazon.com/Victorian-Internet-Remarkable-Nineteenth-line/dp/162040592X

2 Likes

This sounded like a fun little problem, so I gave it a go in Python:

Thanks for the inspiration!

Morse Code Curve.gh (11.8 KB) MorseCodeDict.txt (184 Bytes)

4 Likes