#!/bin/bash## AudioScopeDisplay.sh# # This method can also be used for a simple kids level Analogue Data_logger/Transient_Recorder.# Cannot use "setterm -cursor off" as Mac OSX 10.7.5 has not got "setterm", thought of another way for the Macbook Pro. ;o)## $VER: AudioScopeDisplay.sh_Version_0.00.01_Public_Domain_B.Walker_G0LCU.

I am really appreciative of you guys testing on various linux platforms...

This is just a taster, the "o"s were just as a proof test. The graticule display WILL be in a different colour to the plotted _graph_. Anything I post in the near future will be proof of concept only...

The next one will need /dev/dsp so if anyone is interested in the next level then check you have /dev/dsp "installed"...

#!/bin/bash## AudioScopeDisplay.sh# # This method can also be used for a simple kids level Analogue Data_logger/Transient_Recorder.# Cannot use "setterm -cursor off" as Mac OSX 10.7.5 has not got "setterm", thought of another way for the Macbook Pro. ;o)## Set window size down to 66 x 24...printf "\x1B[8;24;66t"

I think that it will be important to interpolate between points, where they are spaced apart vertically. Otherwise, higher frequencies appear as a visually random scatter of stars, and the trace even at mid-frequencies will be broken into irregular "dashes".

I'd suggest that for each new point, you start drawing one step offset (up or down as required) from the previous point, and draw a vertical line of stars to the new point. Or of course, if the points are level then don't!

Red on blue/green is not easily legible. Yellow on blue/green would be much better for me.

"Klinger, do you know how many zoots were killed to make that one suit?" — BJ Hunnicutt, 4077 M*A*S*H

The interpolation will come as linear. As this progresses then I might make the whole user definable - colours, type of plotting character etc...

Hi jh...

The colours will remain FTTb but I have taken note of both comments. As for the instantaneous effect that is because I removed the sleep 0.05 delay... This will be how it will be displayed in reality. I am looking at SoX for the grabbing tool as it supposedly is platform independent.

Thanks to both for risking your machines.

The next snippet will use /dev/dsp and demo mode defaulting to demo mode until you edit the file and rerun. I have to assume that your systems have it as a device...

The limitation of /dev/dsp is 8KHz sampling speed, mono, 8 bit depth. This is where the binary transfer file uploaded recently will come into play... This will be the timebase... ;o)

#!/bin/bash## AudioScopeDisplay.sh# # This method can also be used for a simple kids level Analogue Data_logger/Transient_Recorder.# Cannot use "setterm -cursor off" as Mac OSX 10.7.5 has not got "setterm", thought of another way for the Macbook Pro. ;o)

# Change demo value of 0 to 1 to access /dev/dsp for "storage" AudioScope facility, OR, -1 to use SoX...demo=0count=0number=0char=""vert=12horiz=9graticule=""# Scan retraces...scan=1scanloops=10# Timebase variables...subscript=0# IMPORTANT!!! There is NO error checking yet so be careful with your choice of values...# scan_start is from 0 to (length of file - 64)...scan_start=0# scan_jump is from 1 to (length of file / 64)...scan_jump=1# scan_finish is not used yet...scan_finish=$[ ( $scan_jump * 64 ) ]

# This is the main loop...while truedo for scan in $( seq 1 $scanloops ) do waveform display plot # Remember to do all the status reports using the line below as a separate _function_. # Temporarily set the cursor outside of the plotting window. printf "\x1B[20;46f\x1B[0;37;40m" done breakdone

IF this part is uncommented and run then a sinewave test signal runs in parallel with the scope and injecting this to the input of the scope and also setting the input and output levels you can see it working...

#!/bin/bash## AudioScope.sh# At this point I will include and say thank you to "Corona688", a member of http://www.unix.com for his input...

# The lines below, from ">" to "xterm", will generate a new shell script and execute it in a new xterm terminal...# Just EDIT out the comments and then EDIT the line pointing to the correct </full/path/to/sox/play> to use it.# It assumes that you have SoX installed. When this script is run it generates a 1KHz sinewave in a separate window# that lasts for 8 seconds. Just press ENTER when this window is active and it will repeat again. To quit this script# and close the window just press Ctrl-C. This generator will be needed for the calibration of some timebase ranges. #> /tmp/1KHz-Test.sh#chmod 777 /tmp/1KHz-Test.sh#printf '#!/bin/bash\n' >> /tmp/1KHz-Test.sh#printf '> /tmp/sinewave.raw\n' >> /tmp/1KHz-Test.sh#printf 'data="\\\\x80\\\\x26\\\\x00\\\\x26\\\\x7F\\\\xD9\\\\xFF\\\\xD9"\n' >> /tmp/1KHz-Test.sh#printf 'for waveform in {0..4095}\n' >> /tmp/1KHz-Test.sh#printf 'do\n' >> /tmp/1KHz-Test.sh#printf ' printf "$data" >> /tmp/sinewave.raw\n' >> /tmp/1KHz-Test.sh#printf 'done\n' >> /tmp/1KHz-Test.sh#printf 'while true\n' >> /tmp/1KHz-Test.sh#printf 'do\n' >> /tmp/1KHz-Test.sh#printf ' /full/path/to/sox/play -b 8 -r 8000 -e unsigned-integer /tmp/sinewave.raw\n' >> /tmp/1KHz-Test.sh#printf ' read -p "Press ENTER to rerun OR Ctrl-C to quit:- " -e kbinput\n' >> /tmp/1KHz-Test.sh#printf 'done\n' >> /tmp/1KHz-Test.sh#sleep 1#xterm -e /tmp/1khz-Test.sh &

# Change demo value of 0 to 1 to access /dev/dsp for "storage" AudioScope facility, OR, 2 to use SoX...demo=0hold=1count=0number=0char=""vert=12horiz=9kbinput=""status=1graticule="Public Domain, 2013, B.Walker, G0LCU."# Scan retraces...scan=1scanloops=10# Timebase variables...subscript=0# IMPORTANT!!! There is NO error checking yet so be careful with your choice of values...# scan_start is from 0 to (length of file - 64)...scan_start=0# scan_jump is from 1 to (length of file / 64)...scan_jump=1# scan_finish is not used yet...scan_finish=$[ ( $scan_jump * 64 ) ]