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.
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...
This User Gave Thanks to wisecracker For This Post:
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.
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.
This User Gave Thanks to wisecracker For This Post:
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?
Using AudioScope.sh on Ubuntu 17.04 from a live DVD disc I came across an error.
Consider the code below it is a MUCH shortened version of the KEYBOARD input in AudioScope.
#!/bin/bash
bash --version
uname -a
status=0
KEYBOARD()
{
read -r -p "Enter QUIT or EXIT to quit:- " kbinput
if ||... (11 Replies)
Hi all...
Apologies for any typos...
For those intersted in the AudioScope the next construction is finished.
I have not been totally idle but working out the hard stuff to be able to be very simple to build.
It is a single transistor simple timer that lasts for about 1.2 to 1.8 seconds.... (2 Replies)
Boy oh boy, with only a MONO mic input to use AudioScope gets much more difficult when the ALTDC board is included.
It needs, so far, two hits at the MIC input with a single hit at the HEADPHONE audio output.
The first at the highest practical resolution for the AC component and the second... (0 Replies)
Hi guys...
Well I have entered an area of partial insnity... ;o)
Below is a photo of the 'ALTDC' board for AudioScope.sh...
I have decided to incorporate all three methods for obtaining DC into this MBP via the MIC input.
1) VFO.
2) CHOPPER.
3) COUNTER.
The controller for the COUNTER... (9 Replies)
Development machine:- Standard MBP 13 inch, OSX 10.7.5...
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)
Copyright (C) 2007 Free Software Foundation, Inc.
Scenario:- Audio capture for AudioScope.sh for CygWin without ANY third party installs.
I am trying my hardest to get a... (6 Replies)
Hi all...
Has _below_ ever been done in UNIX shell scripting before?
(I have done this easily in Python but this is using purely the shell.)
The DEMO version IS built and has been tested.
Pre-amble...
I now need at least one control pulse for the AudioScope.sh when in PURELY audio I/O mode,... (2 Replies)
Hi Admin and Staff...
Thanks for hosting AudioScope.sh on this site. I have had the biggest surprise of my life today.
This months issue of the UK Linux magazine "Linux Format" have done a small piece on the project.
Issue April 2014, LXF 182, page 65...
This I never expected and I... (1 Reply)
A new project was posted on your project board.
Project title: Bash Shell Tutoring
Estimated Budget:
$50/hr
Start date:
Immediately
Required skills:
Linux, Bash, Shell, UNIX
I work as a datawarehouse designer and developer.
Although I usually stick to the role of an analyst,... (0 Replies)
We have a system running ssh. When a user logs in, they do not get the project they are assigned to (they run under "system"). I verify the project using the command "ps -e -o user,pid,ppid,args,project". If you do a "su - username", the user does get the project they are assigned to (and all... (2 Replies)