Unix/Linux Go Back    


OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.

AudioScope Project.

OS X (Apple)


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-04-2016
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
AudioScope Project.

AudioScope Project.

(Apologies for any typos.)
For the few following......
AudioScope.sh...
Now at Version 0.60.00.

Well this baby has come a long way since its inception in January 2013. It is now at Version 0.60.00. It is MUCH more Apple centric now with a new OSX Sierra minimum _silent_ capture mode. The original OSX 10.7.x capture mode is now defunct although the code is commented out for older OSX versions - pre-Yosemite. It is left to the individual to workout and swap the two sections of code.

The capture is voice into the internal mic which is vertically uncalibrated but horizontally calibrated.

This is the original at day one of the development and this thread is now closed:-
The Start Of A Simple Audio Scope Shell Script...
The code for this was only about 3KB in size...
Here are the stats for this latest version:-

# Total Lines=4325.
# Blank Lines=29.
# Code Lines=2022.
# Comments=2274, (including the builtin Manual).
# Filesize=183864 bytes.

Internal commands for subtle operation are as follows:-

Code:
# The builtin HELP:-
# ------------------
# These commands will be expanded upon later, type HELP<CR> to show these
# commands. Note that the commands are nearly all UPPER CASE ONLY. They are
# paged so just press <CR> to see the next page. So far there are three pages.
#
# <CR> .............................................. Reruns the scan(s) again.
# RUN<CR> ...................... Reruns the scan(s), always with real captures.
# QUIT<CR> OR EXIT<CR>...................................... Quits the program.
# HELP<CR> ............................................. This help as required.
# HOLD<CR> ..................................... Switch to pseudo-storage mode.
# DEMO<CR> ....... Switch capture to default DEMO mode and 10 continuous scans.
# DSP<CR> ................... Switch capture to Linux /dev/dsp mode and 1 scan.
# SOX<CR> .... Switch capture to multi-platform SOund eXchange mode and 1 scan.
# ONE<CR> ...................................... Sets the number of scans to 1.
# TEN<CR> ..................................... Sets the number of scans to 10.
# HUNDRED<CR> .......... Sets the number of scans to 100, (not very practical).
# VER<CR> ............... Displays the version number inside the status window.
# TBVAR<CR> ......... Set up uncalibrated user timebase offset and jump points.
#      SubCommands: ............................. Follow the on screen prompts.
# FASTEST<CR>, SLOWEST<CR> ... Set timebase to the fastest or slowest possible.
# 1mS<CR>, 2mS<CR>, 5mS<CR> ............ Set scanning rate to 1, 2, or 5mS/DIV.
# 10mS<CR>, 20mS<CR>, 50mS<CR> ....... Set scanning rate to 10, 20 or 50mS/DIV.
# 100mS<CR> ................................... Set scanning rate to 100mS/DIV.
# VSHIFT<CR> ........ Set the vertical position from -4 to +4 to the mid-point.
#      SubCommands: ............ Press U or D then <CR> when value is obtained. 
# DRAW<CR> ....... Connect up each vertical plot to give a fully lined display.
# TRIG<CR> ........ Sets the synchronisation methods for storage mode retraces.
#      SubCommand: SYNCEQ<CR> .. Synchronise from a variable, fixed value only.
#      SubCommand: SYNCGT<CR> ......... Synchronise from a positive going edge.
#      SubCommand: SYNCLT<CR> ......... Synchronise from a negative going edge.
#      SubCommand: EXT<CR> ............ SOX ONLY! Follow the on screen prompts.
# SAVEON<CR> ................. Auto-saves EVERY scan with a numerical filename.
# SAVEOFF<CR> ........................... Disables auto-save facility, default.
# ZOOM<CR> ............................. Low signal level gain, ZOOM, facility.
#      SubCommand: 0<CR> ................. Default lowest zoom/gain capability.
#      SubCommand: 1<CR> ............................. X2 zoom/gain capability.
#      SubCommand: 2<CR> ............................. X4 zoom/gain capability.
#      SubCommand: 3<CR> ............................. X8 zoom/gain capability.
#      SubCommand: 4<CR> ............................ X16 zoom/gain capability.
#      SubCommand: <CR> ...... To exit zoom mode when waveform has been viewed.
# HSHIFT<CR> ......... Shift the trace left or right at the highest scan speed.
#      SubCommand: L ........................ Shift the trace left by one byte.
#      SubCommand: l ... Shift the trace left by 64 bytes, (one complete scan).
#      SubCommand: R ....................... Shift the trace right by one byte.
#      SubCommand: r .. Shift the trace right by 64 bytes, (one complete scan).
#      SubCommand: Q or q ........ Exit back to normal usage, (quit this mode).
# RESET<CR> ......................... Do a complete COLD restart of the script.
# FREQ<CR> .. Measure a symmetrical waveform's frequency, accuracy 0.1 percent.
# MODE<CR> Display the X, Y, coupling and mode ranges inside the status window.
# STATUS<CR> . Display the previous status for 3 secs inside the status window.
# LOAD<CR> .................................. Load a binary file for reviewing.
#      SubCommand: ............................... Follow the on screen prompt.
# AC<CR> ......................... Set vertical input to default AC input mode.
# DC<CR> ............................ Attempt to measure DC polarity and level.
# BURST<CR> ........ Play an 8 second sinewave.wav burst using afplay or aplay.
# ARDDET<CR> ................ Detect an Arduino (Diecimila) Board if available.
#      SubCommand: .............................. Follow the on screen prompts.
# ALTDC<CR> ........ Alternate home built DC input device using the sound card.
#      SubCommand: ................................................ UNFINISHED.
# POLARITY<CR> ........... Generate pulse waveforms purely for amplifier tests.
# QTMAC<CR> ........... EXPERIMENTAL MAC, (MBP), QuickTime Player capture mode.
# WINSOUND<CR> ..... Special Windows SoundRecorder.exe for CygWin capture mode.
# ALSA<CR> ................. Special Linux command line, arecord, capture mode.
# SWEEP<CR> .............................. Sweep generator for bandwidth tests.
# SAVE<CR> ............................ Manually save the current scan to disk.
# V<CR> ...... Set the vertical Volts per Division range, (10mV), 100mV to 10V.
#      SubCommand: .............................. Follow the on screen prompts.
#
# !!!Use capture modes QTMAC<CR>, WINSOUND<CR> and ALSA ENTIRELY AT YOUR
# OWN RISK!!!

Enjoy.

Barry...
Attached Thumbnails
AudioScope Project.-06000-jpeg  
Attached Files
File Type: sh AudioScope.sh (179.6 KB, 1 views)
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (04-18-2017)
Sponsored Links
    #2  
Old Unix and Linux 12-29-2016
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
Hi all...

Well a lot has been going on behind the scenes here.

The latest Quicktime Player access for Sierra is now broken as of OSX 10.12.2. It works in 10.12.0 and 10.12.1 but is now broken again. <SIGH>
I am now abandoning Quicktime Player as a hidden capture mode. The code will be left in just in case a newer version of OSX works again, but I suspect Quicktime _Whatever_ will be phased out completely so I am chasing it no more.

I have done some major changes to allow for a seriously slow CygWin(64) running in the latest Windows 10. As quoted before Windows 10 no longer has SoundRecorder.exe so I am abandoning WINSOUND capture mode but leaving the code in for CygWin on Windows 8.1 and lower.

There is now a small, cyan, sub-window inside the main scanning window to display any DC component when enabled. In AC mode it will always show 0.000 Volts.

Although AC mode is now long since finished there is lots to do for DC mode.

As CygWin does NOT have the 'bc' or 'dc' commands on a standard install then 'awk' will have to do my floating point calculations for any average DC values on any random signal sent up the mic socket.

Stats so far for this Version 06060...

# Total Lines=4509.
# Blank Lines=30.
# Code Lines=2122.
# Comments=2357, (including the builtin Manual).
# Filesize=193247 bytes.

Because CygWin is so slow on Windows 10 I have to modify '/dev/dsp' capture timings due to OS time lags.

Boy oh boy the things I have learnt about OSes and their limitations is unreal.

A certain Linux flavour does not like the ZOOM facility, but hopefully this is now cured.

All needed files for the whole project are now saved to a new "$HOME"/Temp/ drawer. /tmp/ is no longer used.
These are saved to "$HOME" only:-
AudioScope.sh
AudioScope.config
AudioScope.Manual

Hopefully there are no critical bugs in 'DEMO', '/dev/dsp' and SOX modes.

Enjoy...
Attached Thumbnails
AudioScope Project.-06060-jpeg   AudioScope Project.-as_cygwin-jpg  
Attached Files
File Type: sh AudioScope.sh (188.7 KB, 0 views)

Last edited by wisecracker; 12-30-2016 at 12:38 PM.. Reason: Added CygWin in Windows 10 snapshot.
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (04-18-2017)
Sponsored Links
    #3  
Old Unix and Linux 02-17-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
(AudioScope.sh)
06150.sh

The most important file other than the script itself is 'waveform.raw' and it sits in a directory generated by the script of "$HOME"/Temp.

On the very first ever run the files below are created inside the "$HOME"/Temp also generated at the same time. Every rerun of the script tests for this file and if it exists these are not regenerated.
This means the script runs almost instantly from a restart. However if the script command "RESET" is used then this is the same as a very first start and these files are regenerated.

More information added to the Manual.

Quicktime Player capture mode is once again working in OSX 10.12.2 and 10.12.3, Sierra.

The only single byte file that is genuine is the 'dcdata.raw' file. All other single byte files are place-marker files only for extras that the script might need for all facilities.
'Arduino_9600.pde' for The Arduino Diecimila Board if used. To be used to program the board for use on this project.
'Untitled.m4a' for QUicktime Player cpature mode ONLY.
'pulsetest.sh' for use on a second machine with the '/dev/dsp' audio device to calibrate the correct polarity of a waveform displayed, the 'POLARITY' command.
'signed16bit.txt' for CygWin AND Windows SoundRecorder.exe capture mode ONLY.
'sweep.wav' and 'sweep.raw' for a swept andio frequency generator, from 4KHz to around 85Hz and back twice, the 'SWEEP' command.
'symmetricalwave.wav' for Quicktime Player capture for the frequency counter.


Code:
Last login: Fri Feb 17 14:52:09 on ttys000
AMIGA:amiga~> ls -l Temp
total 1360
-rw-r--r--  1 amiga  staff  48000 17 Feb 14:50 0000000000.BIN
-rwxr-xr-x  1 amiga  staff    609 17 Feb 14:50 1KHz-Test.sh
-rw-rw-rw-  1 amiga  staff      1 17 Feb 14:50 Arduino_9600.pde
-rw-rw-rw-@ 1 amiga  staff      1 17 Feb 14:51 Untitled.m4a
-rw-r--r--  1 amiga  staff    253 17 Feb 14:50 VERT_BAT.BAT
-rwxr-xr-x  1 amiga  staff    329 17 Feb 14:50 VERT_DSP.sh
-rwxr-xr-x  1 amiga  staff    370 17 Feb 14:50 VERT_SOX.sh
-rw-r--r--  1 amiga  staff      1 17 Feb 14:50 dcdata.raw
-rw-r--r--  1 amiga  staff  65580 17 Feb 14:50 pulse1.wav
-rw-r--r--  1 amiga  staff  65580 17 Feb 14:50 pulse2.wav
-rwxr-xr-x  1 amiga  staff      1 17 Feb 14:50 pulsetest.sh
-rw-r--r--  1 amiga  staff  48000 17 Feb 14:50 sample.raw
-rw-r--r--  1 amiga  staff      1 17 Feb 14:50 signed16bit.txt
-rw-r--r--  1 amiga  staff  65536 17 Feb 14:50 sinewave.raw
-rw-r--r--  1 amiga  staff  65580 17 Feb 14:50 sinewave.wav
-rw-r--r--  1 amiga  staff   8000 17 Feb 14:50 squarewave.raw
-rw-r--r--  1 amiga  staff      1 17 Feb 14:50 sweep.raw
-rw-r--r--  1 amiga  staff      1 17 Feb 14:50 sweep.wav
-rw-r--r--  1 amiga  staff  80000 17 Feb 14:50 sweeper.raw
-rw-r--r--  1 amiga  staff   8000 17 Feb 14:50 symmetricalwave.raw
-rw-r--r--  1 amiga  staff      1 17 Feb 14:50 symmetricalwave.wav
-rw-r--r--  1 amiga  staff  48000 17 Feb 14:51 waveform.raw
-rw-r--r--  1 amiga  staff  99948 17 Feb 14:51 waveform.wav
AMIGA:amiga~> _

Script file statistics:-

# Total Lines=4566.
# Blank Lines=28.
# Code Lines=2129.
# Comments=2409, (including the builtin Manual).
# Filesize=196479 bytes.

The attached image is a whistle into the internal microphone using Quicktime Player as the capture source.

Enjoy...
Attached Thumbnails
AudioScope Project.-06150-jpeg  
Attached Files
File Type: sh 06150.sh (191.9 KB, 1 views)
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (02-17-2017)
    #4  
Old Unix and Linux 04-17-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
Well the screen now has frequency [COUNTER] and [ DC VOLTS ] windows both set to OFF when not enabled or not in use.
There is now a new startup screen on FIRST time run OR after a software RESET.
Four images from a cold first time run to SOX, showing the commands from QUIT to SOX...

I am now working on a low resolution pure text mode audio file converter and not sure whether to incorporate it into this project.

I had thought about an AF Spectrum Analyser but FFT(s) in shell scripting is really a none starter, unless I can incorporate say something like 'matlab' into it to do the heavy FFT lifting.

This single 'bash' script that creates everything including all calibration signals and text mode electronic circuits is now over 207,000 bytes in size...

The manual and quickstart notes can now be read is situ using either 'less' or 'more'. 'less' is the first chioce but switches to more if that doesn't exist.

Code:
# Files saved to the ""$HOME"/Temp/" directory.
#
# -rw-r--r--  1 barrywalker  wheel  48000  4 Aug 21:06 0000000000.BIN
# -rwxr--r--  1 barrywalker  wheel    585  4 Aug 21:06 1KHz-Test.sh
# -rwxr-xr-x  1 barrywalker  wheel    293  4 Aug 21:08 Arduino_9600.pde
# -rw-r--r--@ 1 barrywalker  staff  65536  4 Nov 21:08 Untitled.m4a
# -rw-r--r--  1 barrywalker  wheel    253  4 Aug 21:06 VERT_BAT.BAT
# -rw-r--r--  1 barrywalker  wheel    303  4 Aug 21:06 VERT_DSP.sh
# -rw-r--r--  1 barrywalker  wheel    344  4 Aug 21:06 VERT_SOX.sh
# -rw-r--r--  1 barrywalker  wheel      1  4 Aug 21:06 dcdata.raw
# -rw-r--r--  1 barrywalker  wheel  65580  4 Aug 21:06 pulse1.wav
# -rw-r--r--  1 barrywalker  wheel  65580  4 Aug 21:06 pulse.wav
# -rwxr-xr-x  1 barrywalker  wheel    107  4 Aug 21:07 pulsetest.sh
# -rw-r--r--  1 barrywalker  wheel  48000  4 Aug 21:06 sample.raw
# -rw-r--r--  1 barrywalker  wheel 680000  4 Aug 21:06 signed16bit.txt
# -rw-r--r--  1 barrywalker  wheel  65536  4 Aug 21:06 sinewave.raw
# -rw-r--r--  1 barrywalker  wheel  65580  4 Aug 21:06 sinewave.wav
# -rw-r--r--  1 barrywalker  wheel   8000  4 Aug 21:06 squarewave.raw
# -rw-r--r--  1 barrywalker  wheel  65096  4 Aug 21:07 sweep.raw
# -rw-r--r--  1 barrywalker  wheel  65140  4 Aug 21:07 sweep.wav
# -rw-r--r--  1 barrywalker  wheel  32548  4 Aug 21:07 sweeper.raw
# -rw-r--r--  1 barrywalker  wheel   8000  4 Aug 21:06 symmetricalwave.raw
# -rw-r--r--  1 barrywalker  staff  20071  4 Aug 21:06 symmetricalwave.wav
# -rw-r--r--  1 barrywalker  wheel  48000  4 Aug 21:07 waveform.raw
# -rw-r--r--  1 barrywalker  wheel  65580  4 Aug 21:06 waveform.wav
#
# Files saved in the "$HOME" directory.
#
# -rw-r--r--  1 amiga  staff   xxxxx 17 Apr 17:09 AudioScope.Circuits
# -rw-r--r--  1 amiga  staff  xxxxxx 17 Apr 17:09 AudioScope.Manual
# -rw-r--r--  1 amiga  staff     xxx 17 Apr 17:09 AudioScope.Config
# -rwxr-xr-x  1 amiga  staff  xxxxxx 17 Apr 17:08 AudioScope.sh
# -rw-r--r--  1 amiga  staff    xxxx 17 Apr 17:09 AudioScope_Quick_Start.Notes
# File size "xxxxxx" means it will change as the project progresses.

Change 06250.sh.txt to AudioScope.sh and place into the $HOME directory.
Change access rights to 755...

Stats so far:-
--------------

# Total Lines=4797.
# Blank Lines=28.
# Code Lines=2201.
# Comments=2568, (including the builtin Manual).
# Filesize=207173 bytes.

Enjoy.

Bazza...
Attached Thumbnails
AudioScope Project.-06250_start-jpeg   AudioScope Project.-06250_second_run-jpeg   AudioScope Project.-06250_draw-jpeg   AudioScope Project.-06250_sox_1ms-jpeg  
Attached Files
File Type: txt 06250.sh.txt (202.3 KB, 0 views)
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (04-18-2017)
Sponsored Links
    #5  
Old Unix and Linux 04-28-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
Not an upload but this is a taster for what is to come.

The spectrum analyser is completed and nothing like the primitive free version previously uploaded here.

The images start with a voice capture using SOX and displayed at 5mS/Division, Note the red CAPTURE mode inside the top little window. In the COMMAND window the command SPECAN is ready to be entered.

Once entered the next image prompts for an External source for measurement input, for example the external microphone. 'N' will be entered and a 48000 byte main capture raw file is converted to an 8000 byte version for the limited 4KHz resolution of this code. I will try and extend to at least 24KHz resolution at a later date.

After a few seconds the spectrum displays this low resolution capture. This will automatically switch from main red CAPTURE mode to green STORAGE mode for the last image to write protect the current main capture. This display awaits an ENTER to return to the STORAGE screen of the original capture.
Attached Thumbnails
AudioScope Project.-speech_sox_capture_mode-jpeg   AudioScope Project.-prompt_for_external_source-jpeg   AudioScope Project.-spectrum_of_main_capture-jpeg   AudioScope Project.-storage_mode_original-jpeg  
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (04-28-2017)
Sponsored Links
    #6  
Old Unix and Linux 05-20-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
AudioScope.sh Version 0.65.00.

This a major upload and includes the limited Audio Frequency Spectrum _Analyser_ to 4KHz.
This has a relative _calibration_, not an absolute one.
This Spec-An is NOT available for CygWin as there is no access to at least Python 2.7.x in a default CygWin install.
OSX 10.12.x and above specific creating of a new terminal added.
Many thanks to 'xbin' for the code for this.
Also many thanks to much of Corona688's additions and following of this, much of which is inside this script in various modified formats.

File listings are as such:-

Code:
The "$HOME" drawer.

-rw-r--r--   1 amiga  staff   20715 20 May 13:40 AudioScope.Circuits
-rw-r--r--   1 amiga  staff     307 20 May 13:40 AudioScope.Config
-rw-r--r--   1 amiga  staff  115248 20 May 13:40 AudioScope.Manual
-rwxr-xr-x   1 amiga  staff  217121 20 May 12:52 AudioScope.sh
-rw-r--r--   1 amiga  staff    6319 20 May 13:40 AudioScope_Quick_Start.Notes

The "$HOME"/Temp drawer.

0000000000.BIN		pulse[1].wav		sweep.raw
1KHz-Test.sh		pulse[2].wav		sweep.wav
Arduino_9600.pde	pulsetest.sh		sweeper.raw
Untitled.m4a		sample.raw		symmetricalwave.raw
VERT_BAT.BAT		signed16bit.txt		symmetricalwave.wav
VERT_DSP.sh		sinewave.raw		waveform.raw
VERT_SOX.sh		sinewave.wav		waveform.wav
dcdata.raw		squarewave.raw

The /tmp/drawer for the spectrum display.
(From the manual.)

# SPECAN<CR>, This is the built in AF spectrum analyser that has an upper limit
# of 4KHz. This is experimental and generates a stand alone 'bash' script that
# includes a stand alone Python script to do the FFT heavy lifting. It uses the
# built in frequency counter to capture an external signal, otherwise it will
# use AudioScope's capture and convert it to a 'WAV' file. The files generated
# are saved into the '/tmp/' drawer and not permanantly kept. If you want to
# extract these files they are:-
# 
# -rw-r--r--  1 amiga  wheel   914 27 Apr 19:29 FFT_WAV.py
# -rwxr-xr-x  1 amiga  wheel  4705 27 Apr 19:29 Spec_An.sh
# -rw-r--r--  1 amiga  wheel  **** 27 Apr 19:29 bash_array
# -rw-r--r--  1 amiga  wheel 48000 27 Apr 19:29 symmetricalwave.raw
# -rw-r--r--  1 amiga  wheel  8044 27 Apr 19:29 symmetricalwave.wav
# The '****' file length varies per the command 'SPECAN' call.
#
# The only important ones are 'FFT_WAV.py' and 'Spec_An.sh'.
# The files 'Spec_An.sh' and FFT_WAV.py are licenced as GPL2.
# A typical coloured disply looks something like this:-
#
#        ++-------[ $VER Spec_An.sh_(C)2017_B.Walker_GPL2_Licence.]-------++
#    100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++100
#        ||       |       |       |       |       |       |       |       ||
#     90 ++       |       |       |       |       |       |       |       ++ 90
#  R     ||       |       |       |       |       |       |       |       ||
#  E  80 ++       |       |       |       |       |       |       |       ++ 80
#  L     ||     * |       |       |       |       |       |       |       ||
#  A  70 ++     * |       |       |       |       |       |       |       ++ 70
#  T     ||  *  * |       |       |       |       |       |       |       ||
#  I  60 ++  *  * |       |       |       |       |       |       |       ++ 60
#  V     ||  *  * |       *       |       |       |       |       |       ||
#  E  50 ++  *  * |    ** *       |       |       |       |       |       ++ 50
#        ||  *  * *    ** **      |       |       |       |       |       ||
#  L  40 ++  * ** *  * ** **      |       |       |       |       |       ++ 40
#  E     ||  * ** ** * ** ** * ** *  *    |       |       |       |       ||
#  V  30 ++  **** ** * ** ** * ** **** *  |       |       |       |       ++ 30
#  E     ||  ******* ******* * ** **** ** |       |       |       |       ||
#  L  20 ++  ******* ********* ** ******* | **    *       |       |       ++ 20
#Log10(X)|| ***************************** *****  ***** * *| **** **       ||
#     10 ++ *********************************************** ******* **  ***+ 10
#        ||****************************************************************|
#      0 +*****************************************************************+ 0
#FREQ Hz +0------500----1000----1500----2000----2500----3000----3500----4000
#                          Press <CR> to continue:-

Now working on true RMS for any random signal now, and it looks as though AWK might just do it.
Many more things like Average Voltage, LF frequency using the Chopper and much more.

The stats for the current incarnation.

# Total Lines=5045.
# Blank Lines=45.
# Code Lines=2334.
# Comments=2666, (including the builtin Manual).
# Filesize=217121 bytes.

The images are a whistle into the internal mic using SOX as the prime mover, zoomed in 8x.
A psectral display of the same whistle.

In this current state 'SPECAN<CR>' gives you the option of looking at the proper capture or an external one, but only to 4KHz
The power of the *NIX style shell, utilities and terminal!

Has anything like this ever been done before I wonder?
Attached Thumbnails
AudioScope Project.-whistle_zoom-jpeg   AudioScope Project.-whistle_specan-jpeg  
Attached Files
File Type: txt 06500.sh.txt (212.0 KB, 1 views)
Sponsored Links
    #7  
Old Unix and Linux 06-22-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 August 2017, 5:52 AM EDT
Location: Loughborough
Posts: 1,216
Thanks: 365
Thanked 323 Times in 253 Posts
Well I have discovered that I was using a method to QUIT the program that was not allowed.
Thanks to Corona688 for putting me straight and using the correct method to quit now.
This was apparantly a major bug in bash and was in there until at least bash version 4.3.42.

When tested on bash 4.4.5 the bash bug had been removed and created a bug in the code, it is now cured.

There are two separate closedown modes available now:-

'QUIT<CR>' that quits, saving all four of the AudioScope files saved inside '$HOME'.
'EXIT<CR>' that literally exits without saving those files.

It has come to my attention that some terminals are NOT 80 x 24 or 25 from a default install.
In fact one comes in at 77 x 23, one wonders why? After all it is NOT a classic AMIGA which does have that sized CLI.

Well I have had to use this terminal escape code to correct to the size for AudioScope.sh "\x1B[8;24;80t" to force a size increase.
The original size is saved as stty size and the values used to reset the terminal size back to default state on 'QUIT' or 'EXIT'.
Of course this method might be subject to some terminals not responding to the escape codes so manual resizing will be needed.

The four images are a sung note, the spectrum up to 4KHz of said note, the 'QUIT' window and 'EXIT' window.
(Note: the absolute paths are created through "$HOME"/path../file .)

RMS code for fixed waveforms is done but not incorporated in this version.

Stats so far:-

# Total Lines=5128.
# Blank Lines=46.
# Code Lines=2356.
# Comments=2726, (including the builtin Manual).
# Filesize=221113 bytes.

Enjoy...

Again thanks to Corona688 for his input.
Attached Thumbnails
AudioScope Project.-sung_note-jpeg   AudioScope Project.-sung_note_specan-jpeg   AudioScope Project.-quit-jpeg   AudioScope Project.-exit-jpeg  
Attached Files
File Type: txt 06600.sh.txt (215.9 KB, 0 views)

Last edited by wisecracker; 06-22-2017 at 03:13 PM..
The Following User Says Thank You to wisecracker For This Useful Post:
Corona688 (06-22-2017)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AudioScope... wisecracker What is on Your Mind? 0 06-26-2015 07:26 AM
The Alternate DC board for AudioScope.sh. wisecracker OS X (Apple) 9 06-25-2015 10:27 AM
AC to DC trigger pulse for AudioScope.sh. wisecracker OS X (Apple) 2 04-14-2014 05:47 AM
AudioScope has had a magazine review. <shock> wisecracker What is on Your Mind? 1 03-03-2014 03:02 PM



All times are GMT -4. The time now is 04:35 PM.