The Start Of A Simple Audio Scope Shell Script...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting The Start Of A Simple Audio Scope Shell Script...
# 36  
Old 06-27-2013
Zoom for low signal levels is now complete.

It defaults to OFF and is never saved as part of the config file.
No user alterations are changed except switching from a real grab
to retrace mode.

From the command prompt window:-
ZOOM<CR>
(Then follow the on screen prompts.)

It has 5 depths:-
0) Default 8 bit to 4 bit quantising and uses the original plot.
1) X2, 7 bit to 4 bit quantising.
2) X4, 6 bit to 4 bit quantising.
3) X8, 5 bit ti 4 bit quantising.
4) X16, direct bit for bit display.

How it works:-
Decimal 128 is considered to be the centre point of the sound card.
Therefore a balanced signal will be centred on this number.
The minimum most point at any zoom level is shifted to give a 0(ish)
value then anything above that is the remainder of the waveform.

To keep it within the 16 vertical characters the values are divided
by an order ox 2^x depending upon the range.

None of the user coomands are available in this mode as it purely
to give an FSD for low and very low AC signal levels...

At the highest sensitivity, (4), centre point bit error will be
noticeable; this could be considered noise so be aware.

For those interetsed this is a _todo_ list:-

1) Horizontal shift control.
2) Basic frequency measurement.
3) Vertical claibration HW and SW in a similar guise to the built
in 1KHz sinewave generator.
4) DC input.
5) DC polarity.
6) Others, unknown at the moment.

Working on number 1) at the moment...

If anyone has any suggestions for any additions then please pass on
comments, all is welcome, even adverse ones...

This is now fast becoming a serious kids level application instead
of a fun project...

Enjoy...

Last edited by wisecracker; 07-14-2013 at 07:41 AM.. Reason: Code now an attachment.
# 37  
Old 06-30-2013
Horizontal shift is now complete.

This is the last of the quick and easy parts of the code.

From now on the distance between uploads could be high as HW will be needed.
This has to be ludicrously simple so as to be built by a 10 year old.

The next upload will be the frequency counter needed for two parts of this
project. However this is a while away yet so now to desribe the X shift control.
(I WILL post a fully working Python version of a frequency counter I wrote ages
ago that uses /dev/dsp.)

Horizontal shift, from the cammand line window type:-

HSHIFT<CR>

Using the keys r, R, l, L, and Q or q change the position of the scan like this:-

r shifts scan to the right by one scan size, (64 bytes).
R shifts scan to the right by one byte at a time.
l shifts scan to the left by one scan size, (64 bytes).
L shifts scan to the left by one byte at a time.
Q or q exits this mode.

The keys respond like INKEY$ in BASIC...
No user values are changed except switching from real grab to rescan mode.
The TB speed will always be the fastest available although it could be made
variable if so desired. I decided against it as this is useful for searching
for odd wavefronts. The status line will let you know where in the file the
start of the current scan is...

Enjoy...

P.S. In the process of building a simple, starter, Y amplifier input ATM...
Also the script is about 38KB in size now...

Last edited by wisecracker; 07-14-2013 at 07:44 AM.. Reason: Code now an attachment.
# 38  
Old 07-13-2013
Now added a RESET command, many thanks to Don Cragun for the help.

Also rearranged the internal HELP file.

Also added placeholders ready for the Frequency Counter to be added.

The RESET command returns to terminal back to the default colours, clears the window, deletes all files relevant to the code, resets the terminal and reloads the AudioScope.sh script.

It does NOT delete dynamically saved grabs, (that is using the SAVEON command), but all saved variables via the AudioScope.config file WILL be lost...

This is good for testing as well as for user problems that may occur...

From now on each upload will be an attachment as the Version_Number.sh; in this case "00100.sh"...
REMEMBER! After downloading, rename the file to AudioScope.sh and save/copy it to your _home_ drawer...

Enjoy...

Bazza...

Last edited by wisecracker; 07-14-2013 at 09:15 AM.. Reason: Code now an attachment.
# 39  
Old 11-10-2013
Major update this time guys and gals.

Version now set at 0.20.00.

Frequency Counter added for the symmetrical waveforms sine, square, triangle, (and maybe sawtooth).
This is for the future addition of the DC component and measures from 50Hz to 3500Hz to within 0.1% accuracy.
In DEMO mode this will always read 500Hz as that is the file manually generated for the task.
Many thanks to "agama" some time ago for his input using an array to speed up the Freq Counter time.
Worked an absolute treat...

Code now added for the creation of running files ready for the vertical calibration.

Note, that the vertical amplifier and calbrator are built and the circuit for the calibrator is adeed to the
end of the script.

The Windows version of the vertical calibrator SW works as a genuine file under Windows but as this is generated
on the fly it has NOT been transfered and tested yet. Feedback would be most welcome on this one. It should give
a 1KHz tone for around 8 seconds ONLY and has to be rerun ATM...

Enjoy this latest update...

Bazza...

Last edited by wisecracker; 12-30-2013 at 06:34 AM.. Reason: Code section now removed.
# 40  
Old 12-30-2013
Well this is a complete code update.

The untested Windows generator batch file now modified, tested and working using SOX
for Windows.

The HSHIFT now locks to the last positon you set it to.

The two images are a low level whistle into firstly this Macbook Pro 13 inch, OSX 10.7.5
using SOX and secondly my ACER ASPIRE ONE, PCLOS 2009 using /dev/dsp...

4 commands added.

AC, DC, STATUS and MODE...

AC and DC don't do much ATM.

STATUS re-prints the LAST status shown to the STATUS window for 3 seconds.
MODE re-prints the last line in the STATUS window.

SHIFT now renamed VSHIFT.

HSHIFT now fixes the position after exit as opposed to resetting back to the start of the
file.

Lots of other minor changes.

The Manual is well out of date ATM but still has some use...

Enjoy...

Last edited by wisecracker; 01-07-2014 at 06:18 PM.. Reason: Code section now removed...
This User Gave Thanks to wisecracker For This Post:
# 41  
Old 01-07-2014
More major changes...

Auto-detect of DSP, (/dev/dsp), mode and if not found reverts back to DEMO.

Also for SOX mode except it is commented out. It would be far quicker to edit the script and
alter line 63:- capturepath="/full/path/to/your/sox" as uncommenting line 606 and running
will take a long time.

Other modifications done and photos added...

Left picture is the vertical calibrator, except mine uses a potentiometer instead of fixed reseitors.
Next the underside of the same.
Next is the proof of concept of DC polarity, (frequency), and level, (chopper).
This is for record only...
Finally the vertical amplifier using a potentiometer instead of fixed resistors again.
ATM this is for record only...

(Now seriously contemplating using the Arduino Diecimila board.)

The pointers in the script are already in various uploads in this thread.

Enjoy finding simple solutions to often very difficult problems...

Bazza...

Last edited by wisecracker; 01-18-2014 at 10:59 AM.. Reason: Code section now removed...
# 42  
Old 01-18-2014
AudioScope.sh version 0.21.80.

Complete code check and modification to try and use as many builtins only as possible.

Removed all PRIMARY shell script references to the non-builtin 'clear' command.
The function 'clrscn()' replaces it.

Removed all PRIMARY shell script references to the non-builtin 'sleep' command.
The function 'delay()' replaces it, (with keyboard override).

These functions use builtins and terminal extensions only.
(For the future, will be to try and remove hexdump using builtins.)

Added a LOAD command to load a capture into the _buffer_ and dsiplay it.
On program startup a pseudo-capture file is generated '0000000000.BIN' in the
'/tmp/' directory to test the LOAD command.
If you enter a wrong filename then it does nothing except return you back to the
Scope's COMMAND window.

A few further tweeks to make the whole better.

Bazza...

EDIT:

Removed the visible code.
Left the attachment of it intact...

Last edited by wisecracker; 03-15-2014 at 05:57 PM.. Reason: See above...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

A simple variable frequency sinewave audio generator.

Hi all... Well I have not been inactive but working out how to make OSX 10.14.x command line audio player have a variable sample rate. This is a back door as afplay does not have a sample rate flag unlike aplay for ALSA, in Linux flavours. This is a DEMO only but a derivative of it will... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. Shell Programming and Scripting

Generate 10000 unique audio file of 2MB each using shell script.

Hi, I want 10000+ unique Audio file of approx 2MB each. How can i generate numerous audio files using shell script. Any tool, command or suggestions are welcome. If i give one audio seed file then can we create numerous unique files with same seed file? Any help is highly appreciable.... (11 Replies)
Discussion started by: sushil.kumar
11 Replies

3. OS X (Apple)

Python script to do simple audio capture...

This site is the first to get this snippet. It will capture an audio recording of any time length within the limits of OSX's QuickTime Player's capablility... A shell script derivative of this will be used as a further capture for CygWin's AudioScope.sh. Thoroughly read ALL the comments in... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. UNIX for Dummies Questions & Answers

unable to start shell script

Hi, Pleasse could someone advise why i'm getting this error below - No such file or directory dev6:$ ls -ltr ReleaseManagement.sh -rwxr-xr-x 1 dev fix 4830 Aug 22 11:13 ReleaseManagement.sh dev6:$ ./ReleaseManagement.sh : No such file or directory dev6:$ thank you (2 Replies)
Discussion started by: venhart
2 Replies

5. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies

6. What is on Your Mind?

Scope of Shell Programming and scripting

Hi all, I want to know what is the scope and job status of shell Programming and scripting. Does it have any attractive jobs? (2 Replies)
Discussion started by: malikshahid85
2 Replies

7. Shell Programming and Scripting

Help with stop/start Shell Script.

Hi All, I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task. 1. User will input the option which server they wish to stop. 2. Will clear cache files from specific location. 3. ... (1 Reply)
Discussion started by: venga
1 Replies

8. Shell Programming and Scripting

scope of a Variable inside shell script

hi all, i'm using the following script, Status=1 Function_do () { while read line; do if ; then #echo $line if ; then Status=0 echo " LINKINK ERROR " fi fi done < ldd.log } Function_do (4 Replies)
Discussion started by: vij_krr
4 Replies

9. Shell Programming and Scripting

simple shell - how to get a parameter typed in a shell script

Hi, I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies

10. Shell Programming and Scripting

problem with shell variable's scope

Hi, I am stuck while developing a shell sub-routine which checks the log file for "success" or "failure". The subroutine reads the log file and checks for key word "success", if found it set the variable (found=1). It returns success or failure based on this variable. My problem is, I can... (2 Replies)
Discussion started by: cjjoy
2 Replies
Login or Register to Ask a Question