From 5839b459e22eebe7f767ee1afef252fc9dad4352 Mon Sep 17 00:00:00 2001 From: Elliot Gerchak Date: Tue, 8 Mar 2016 03:08:37 +0000 Subject: [PATCH 1/7] Added smb.song I copied the file from pull request #1. --- smb.song | 352 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 smb.song diff --git a/smb.song b/smb.song new file mode 100644 index 0000000..bd85258 --- /dev/null +++ b/smb.song @@ -0,0 +1,352 @@ +:beep frequency=660 length=100ms; +:delay 150ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=510 length=100ms; +:delay 100ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=770 length=100ms; +:delay 550ms; +:beep frequency=380 length=100ms; +:delay 575ms; + +:beep frequency=510 length=100ms; +:delay 450ms; +:beep frequency=380 length=100ms; +:delay 400ms; +:beep frequency=320 length=100ms; +:delay 500ms; +:beep frequency=440 length=100ms; +:delay 300ms; +:beep frequency=480 length=80ms; +:delay 330ms; +:beep frequency=450 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 200ms; +:beep frequency=660 length=80ms; +:delay 200ms; +:beep frequency=760 length=50ms; +:delay 150ms; +:beep frequency=860 length=100ms; +:delay 300ms; +:beep frequency=700 length=80ms; +:delay 150ms; +:beep frequency=760 length=50ms; +:delay 350ms; +:beep frequency=660 length=80ms; +:delay 300ms; +:beep frequency=520 length=80ms; +:delay 150ms; +:beep frequency=580 length=80ms; +:delay 150ms; +:beep frequency=480 length=80ms; +:delay 500ms; + +:beep frequency=510 length=100ms; +:delay 450ms; +:beep frequency=380 length=100ms; +:delay 400ms; +:beep frequency=320 length=100ms; +:delay 500ms; +:beep frequency=440 length=100ms; +:delay 300ms; +:beep frequency=480 length=80ms; +:delay 330ms; +:beep frequency=450 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 200ms; +:beep frequency=660 length=80ms; +:delay 200ms; +:beep frequency=760 length=50ms; +:delay 150ms; +:beep frequency=860 length=100ms; +:delay 300ms; +:beep frequency=700 length=80ms; +:delay 150ms; +:beep frequency=760 length=50ms; +:delay 350ms; +:beep frequency=660 length=80ms; +:delay 300ms; +:beep frequency=520 length=80ms; +:delay 150ms; +:beep frequency=580 length=80ms; +:delay 150ms; +:beep frequency=480 length=80ms; +:delay 500ms; + +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=150ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 150ms; + +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=430 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 100ms; +:beep frequency=570 length=100ms; +:delay 220ms; + +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=200ms; +:delay 300ms; + +:beep frequency=1020 length=80ms; +:delay 300ms; +:beep frequency=1020 length=80ms; +:delay 150ms; +:beep frequency=1020 length=80ms; +:delay 300ms; + +:beep frequency=380 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=150ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 150ms; + +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=430 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 100ms; +:beep frequency=570 length=100ms; +:delay 420ms; + +:beep frequency=585 length=100ms; +:delay 450ms; + +:beep frequency=550 length=100ms; +:delay 420ms; + +:beep frequency=500 length=100ms; +:delay 360ms; + +:beep frequency=380 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=150ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 150ms; + +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=430 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 100ms; +:beep frequency=570 length=100ms; +:delay 220ms; + +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=200ms; +:delay 300ms; + +:beep frequency=1020 length=80ms; +:delay 300ms; +:beep frequency=1020 length=80ms; +:delay 150ms; +:beep frequency=1020 length=80ms; +:delay 300ms; + +:beep frequency=380 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=760 length=100ms; +:delay 100ms; +:beep frequency=720 length=100ms; +:delay 150ms; +:beep frequency=680 length=100ms; +:delay 150ms; +:beep frequency=620 length=150ms; +:delay 300ms; + +:beep frequency=650 length=150ms; +:delay 300ms; +:beep frequency=380 length=100ms; +:delay 150ms; +:beep frequency=430 length=100ms; +:delay 150ms; + +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=430 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 100ms; +:beep frequency=570 length=100ms; +:delay 420ms; + +:beep frequency=585 length=100ms; +:delay 450ms; + +:beep frequency=550 length=100ms; +:delay 420ms; + +:beep frequency=500 length=100ms; +:delay 360ms; + +:beep frequency=380 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 300ms; +:beep frequency=500 length=100ms; +:delay 150ms; +:beep frequency=500 length=100ms; +:delay 300ms; + +:beep frequency=500 length=60ms; +:delay 150ms; +:beep frequency=500 length=80ms; +:delay 300ms; +:beep frequency=500 length=60ms; +:delay 350ms; +:beep frequency=500 length=80ms; +:delay 150ms; +:beep frequency=580 length=80ms; +:delay 350ms; +:beep frequency=660 length=80ms; +:delay 150ms; +:beep frequency=500 length=80ms; +:delay 300ms; +:beep frequency=430 length=80ms; +:delay 150ms; +:beep frequency=380 length=80ms; +:delay 600ms; + +:beep frequency=500 length=60ms; +:delay 150ms; +:beep frequency=500 length=80ms; +:delay 300ms; +:beep frequency=500 length=60ms; +:delay 350ms; +:beep frequency=500 length=80ms; +:delay 150ms; +:beep frequency=580 length=80ms; +:delay 150ms; +:beep frequency=660 length=80ms; +:delay 550ms; + +:beep frequency=870 length=80ms; +:delay 325ms; +:beep frequency=760 length=80ms; +:delay 600ms; + +:beep frequency=500 length=60ms; +:delay 150ms; +:beep frequency=500 length=80ms; +:delay 300ms; +:beep frequency=500 length=60ms; +:delay 350ms; +:beep frequency=500 length=80ms; +:delay 150ms; +:beep frequency=580 length=80ms; +:delay 350ms; +:beep frequency=660 length=80ms; +:delay 150ms; +:beep frequency=500 length=80ms; +:delay 300ms; +:beep frequency=430 length=80ms; +:delay 150ms; +:beep frequency=380 length=80ms; +:delay 600ms; + +:beep frequency=660 length=100ms; +:delay 150ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=510 length=100ms; +:delay 100ms; +:beep frequency=660 length=100ms; +:delay 300ms; +:beep frequency=770 length=100ms; +:delay 550ms; +:beep frequency=380 length=100ms; +:delay 575ms; +:end \ No newline at end of file From b21a02337a1211c8d4d917d845f525e07a7349e1 Mon Sep 17 00:00:00 2001 From: Elliot Gerchak Date: Tue, 8 Mar 2016 04:58:24 +0000 Subject: [PATCH 2/7] syntax fixes There were a few missing semi colons and undefined vars before which are now fixed. --- In Javascript/airgap.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/In Javascript/airgap.js b/In Javascript/airgap.js index 2664e17..68a4910 100644 --- a/In Javascript/airgap.js +++ b/In Javascript/airgap.js @@ -7,25 +7,25 @@ function now() { } var NSEC_PER_SEC = 1000000000; -var register = 3.1415 +var register = 3.1415; function square_am_signal(time,freq) { - document.getElementById('logs').value += "Playing / "+time+" seconds / "+freq+"Hz\n"; - var period = NSEC_PER_SEC/freq; - var start = now(); - var end = now()+time*NSEC_PER_SEC; - while (now() < end) { - var mid = start+period/2; - var reset = start+period; - while (now() Date: Tue, 8 Mar 2016 05:20:38 +0000 Subject: [PATCH 3/7] Made song editable Based on pull request #1... The list of frequencies to be played has been moved from the JS to a textbox in the HTML. Editing the content of the box will change what gets played. The format also is more human human readable and consistent with the songfile from #1. If you copy and paste the smb.song file, it should work. --- In Javascript/airgap.html | 31 +++++++++++++++++++++++++-- In Javascript/airgap.js | 44 ++++++++++++++++----------------------- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/In Javascript/airgap.html b/In Javascript/airgap.html index b663ec7..4a2215d 100644 --- a/In Javascript/airgap.html +++ b/In Javascript/airgap.html @@ -16,8 +16,35 @@



- + +
Ported by Yeo Quan Yang. Credits to the original author William Entriken @https://github.com/fulldecent

Project site at https://github.com/fulldecent/system-bus-radio

List of computers that work and what frequency to try at https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv
diff --git a/In Javascript/airgap.js b/In Javascript/airgap.js index 68a4910..908d93d 100644 --- a/In Javascript/airgap.js +++ b/In Javascript/airgap.js @@ -29,30 +29,22 @@ function square_am_signal(time,freq) { } function start() { - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2093); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2673); - square_am_signal(0.790, 2673); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2349); - square_am_signal(0.790, 2349); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 3136); - square_am_signal(0.790, 3136); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2093); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2349); - square_am_signal(0.400, 2673); - square_am_signal(0.400, 2349); - square_am_signal(0.790, 2093); + var song = document.getElementById("tones").value.split(":"); + var length = song.length; + var i = 1, line, time, freq; + while (1 <= length) { + line = song[i].split(" "); + if (line[0] == "beep") { + freq = +line[0].split("=")[1]; + time = +line[2].split("=")[1].slice(0,-1); + square_am_signal(time, freq); + } + if (line[0] == "delay") { + // delay + } + if (song[i] == "end") { + i = 1; + } + i++; + } } From 81756689bac9483d8976d59310dfcd96c3921b2f Mon Sep 17 00:00:00 2001 From: Elliot Gerchak Date: Tue, 8 Mar 2016 05:26:40 +0000 Subject: [PATCH 4/7] more nitpicking Inconsistent code spacing, as well as other things that make my code linter itch have been fixed. --- In Javascript/airgap.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/In Javascript/airgap.js b/In Javascript/airgap.js index 908d93d..a0aef3a 100644 --- a/In Javascript/airgap.js +++ b/In Javascript/airgap.js @@ -3,27 +3,26 @@ //Tested to be working on Chrome at 1560khz function now() { - return performance.now()*1000000; + return window.performance.now() * 1000000; } var NSEC_PER_SEC = 1000000000; var register = 3.1415; -function square_am_signal(time,freq) { - document.getElementById('logs').value += "Playing / "+time+" seconds / "+freq+"Hz\n"; - var period = NSEC_PER_SEC/freq; +function square_am_signal(time, freq) { + document.getElementById('logs').value += "Playing / " + time + " seconds / " + freq + "Hz\n"; + var period = NSEC_PER_SEC / freq; var start = now(); - var end = now()+time*NSEC_PER_SEC; + var end = now() + time * NSEC_PER_SEC; while (now() < end) { - var mid = start+period/2; - var reset = start+period; - while (now() Date: Wed, 26 Oct 2016 22:33:22 +0000 Subject: [PATCH 5/7] New song format Changed over the song parser and accompanying code to be inline with the new, as suggested in issue #28. --- In Javascript/airgap.html | 54 +++++++++++++++++++-------------------- In Javascript/airgap.js | 21 ++++++--------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/In Javascript/airgap.html b/In Javascript/airgap.html index 4a2215d..4c91257 100644 --- a/In Javascript/airgap.html +++ b/In Javascript/airgap.html @@ -17,34 +17,34 @@


+

Feel free to edit the code below or copy and paste any valid code.
Column one is time in milliseconds, and column two is frequency.

+400 2673 +400 2349 +400 2093 +400 2349 +400 2673 +400 2673 +790 2673 +400 2349 +400 2349 +790 2349 +400 2673 +400 3136 +790 3136 +400 2673 +400 2349 +400 2093 +400 2349 +400 2673 +400 2673 +400 2673 +400 2673 +400 2349 +400 2349 +400 2673 +400 2349 +790 2093
Ported by Yeo Quan Yang. Credits to the original author William Entriken @https://github.com/fulldecent


List of computers that work and what frequency to try at https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv
diff --git a/In Javascript/airgap.js b/In Javascript/airgap.js index a0aef3a..6b8c463 100644 --- a/In Javascript/airgap.js +++ b/In Javascript/airgap.js @@ -28,23 +28,18 @@ function square_am_signal(time, freq) { } function start() { - var song = document.getElementById("tones").value.split(":"); + var song = document.getElementById("tones").value.split("\n"); var length = song.length; - var i = 1, - line, time, freq; - while (1 <= length) { + var line, time, freq; + for (var i = 0; i < length; i++) { line = song[i].split(" "); - if (line[0] == "beep") { - freq = +line[0].split("=")[1]; - time = +line[2].split("=")[1].slice(0, -1); - square_am_signal(time, freq); - } - if (line[0] == "delay") { + if (line[1] == "0") { // delay } - if (song[i] == "end") { - i = 1; + else { + freq = +line[1]; + time = +line[0]; + square_am_signal(time, freq); } - i++; } } From bb5335c8852cacd6af3a87ba3cb724a24245c0df Mon Sep 17 00:00:00 2001 From: Elliot Gerchak Date: Wed, 26 Oct 2016 22:52:17 +0000 Subject: [PATCH 6/7] Updated contributor information --- In Javascript/airgap.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/In Javascript/airgap.html b/In Javascript/airgap.html index 4c91257..2b5903a 100644 --- a/In Javascript/airgap.html +++ b/In Javascript/airgap.html @@ -45,7 +45,9 @@ 400 2673 400 2349 790 2093 -
Ported by Yeo Quan Yang. Credits to the original author William Entriken @https://github.com/fulldecent

+
Ported by Yeo Quan Yang & maintained by Elliot Gerchak. +
+ Original machine code by William Entriken.


List of computers that work and what frequency to try at https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv
From 143532f89b66f9eccd42e2ad823219be063b28c7 Mon Sep 17 00:00:00 2001 From: Elliot Gerchak Date: Wed, 26 Oct 2016 23:18:18 +0000 Subject: [PATCH 7/7] Improved link styling --- In Javascript/airgap.html | 2 +- In Javascript/main.css | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/In Javascript/airgap.html b/In Javascript/airgap.html index 2b5903a..5c4420b 100644 --- a/In Javascript/airgap.html +++ b/In Javascript/airgap.html @@ -47,7 +47,7 @@ 790 2093
Ported by Yeo Quan Yang & maintained by Elliot Gerchak.
- Original machine code by William Entriken.

+ Original machine code by William Entriken.
Project site at https://github.com/fulldecent/system-bus-radio

List of computers that work and what frequency to try at https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv
diff --git a/In Javascript/main.css b/In Javascript/main.css index 1734f9b..bcdaab7 100644 --- a/In Javascript/main.css +++ b/In Javascript/main.css @@ -97,4 +97,15 @@ input[type="text"]:focus ,input[type="password"]:focus,textarea:focus,select:foc input, textarea, keygen, select, button, isindex { outline:none; resize: none; +} +a +{ + color: white; + font-weight:bold; + background-color: rgba(220, 220, 220, 0.35); + text-decoration:none; +} +a:hover +{ + background-color: rgba(240, 240, 240, 0.52); } \ No newline at end of file