1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

モールス信号変換ツール + Web Audio 再生(PARIS タイミング標準)

1
Posted at

作ったもの

Morse Codehttps://sen.ltd/portfolio/morse-code/

スクリーンショット

  • 国際モールス信号(A-Z, 0-9, 23 記号)
  • テキスト ↔ モールス
  • Web Audio 再生(滑らかなゲインエンベロープ)
  • WPM スライダー(5-40)
  • 再生中のビジュアルインジケータ
  • フラッシュモード
  • タップ入力(長押しで -、短押しで .

vanilla JS、ゼロ依存、ビルド不要node --test で 50 ケース。

PARIS タイミング

モールスのタイミング標準は "PARIS" という単語から導出される。PARIS は合計 50 単位(word gap 含む)。5 WPM なら毎分 5 回 = 250 単位/分 = 240ms/単位。一般式で 1 単位 = 1200/N ms(N = WPM)

  • dot = 1 単位
  • dash = 3 単位
  • 文字内ギャップ = 1 単位
  • 文字間ギャップ = 3 単位
  • 単語間ギャップ = 7 単位

クリック音対策: ゲインエンベロープ

オシレータを瞬時にオン/オフするとクリック音(周波数スペクトルの飛び)が出る。5ms の attack/release を付けるだけで滑らかになる:

gain.gain.linearRampToValueAtTime(0.3, startTime + 0.005);

E と T が最短

E = .
T = -

モールスは英語の頻度に最適化されている。E と T は最頻出なので 1 単位。サミュエル・モールスは 1838 年にハフマン符号を先取りしていた。

シリーズ

100+ 公開ポートフォリオ シリーズの #87 です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?