commit 6dc7404279585ddabf176692c091e7fbb04dd1ae
parent 510f54174c0d29948beb1b268dfff1160b516169
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date: Fri, 29 Dec 2023 17:08:16 -0800
True beeps without the screen device
I wasn't sure if I could handle Morse timing using audio device
durations instead of the screen device, but this proof of concept shows
that it's possible!
Diffstat:
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/beep.tal b/beep.tal
@@ -5,21 +5,29 @@
|0000
|0100
- ( It's my understanding that this should play a tone for 500 ms and then
- stop, but it loops indefinitely. )
+ ( Current test code should toggle a beep on and off every 200 ms )
- ;stop-sound .Audio0/vector DEO2
- #014f .Audio0/duration DEO2
+ ;toggle-sound .Audio0/vector DEO2
+ #00c8 .Audio0/duration DEO2
#00f0 .Audio0/adsr DEO2
#0100 .Audio0/length DEO2
;sin-pcm .Audio0/addr DEO2
#ff .Audio0/volume DEO
-
+
#4e .Audio0/pitch DEO
BRK
-@stop-sound ( -> )
- #00 .Audio0/pitch DEO
+@toggle-sound ( -> )
+ [ LIT2 00 &f $1 ] INCk ,&f STR
+ #01 AND ,&beep JCN
+ #0001 .Audio0/length DEO2
+ ;silence .Audio0/addr DEO2
+ #4e .Audio0/pitch DEO
+BRK
+ &beep
+ #0100 .Audio0/length DEO2
+ ;sin-pcm .Audio0/addr DEO2
+ #4e .Audio0/pitch DEO
BRK
@sin-pcm
@@ -39,3 +47,6 @@ BRK
0b0c 0e0f 1012 1415 1719 1a1c 1e20 2225
2729 2b2e 3032 3537 3a3d 3f42 4547 4a4d
5053 5659 5c5f 6265 686b 6e71 7477 7a7d
+
+@silence
+ 7e