Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wisecracker

macrumors newbie
Original poster
Sep 24, 2012
18
0
In front of my computer.
Whistle.jpeg Whistle_Specan.jpeg Hi fellow MBP fans...
I wanted to learn shell scripting by doing something that had not been done before.
I first uploaded this to here on July 31st 2013 with an update on Jun 1st 2015.
Well since then it has come a long way.
https://forums.macrumors.com/threads/audioscope-sh-shell-script.1616862/#post-21388550
It is being developed on a Macbbok Pro 13 inch and is designed to work on numerous *NIX style machines including CygWin, some terminals however might not have some facilities.

It is hosted here by kind permission of the Admin and is a FULL evolution of said script witn photos, descriptions etc.
It was started in January 2012 on another thread and the current thread points to the start. It has since then aquired many facilities.
http://www.unix.com/os-x-apple-/269769-audioscope-project.html

I have learnt so much about bash's and the OSX terminal's foibles and love the bash language so much that I have all but abandoned other languages.
On my virgin iMac default OSX 10.12.5, it uses a generated Applescript to capture using Quicktime Player and a generated Python script to create the spectrum display.
Awk is used for a
Whistle.jpeg
Whistle_Specan.jpeg
rithmetic stuff for CygWin.
This is the current version, AudioScope.sh Version 0.66.12, first released HERE on 'macrumors.com' today.

Script stats:-

# Total Lines=5187.
# Blank Lines=45.
# Code Lines=2375.
# Comments=2767, (including the builtin Manual).
# Filesize=223345 bytes.

This script generates:-
A 'Temp' drawer inside your $HOME drawer and creates these files inside it:-
-rw-r--r-- 1 amiga staff 48000 30 Jul 15:20 0000000000.BIN
-rwxr-xr-x 1 amiga staff 609 30 Jul 15:20 1KHz-Test.sh
-rw-rw-rw- 1 amiga staff 1 30 Jul 15:20 Arduino_9600.pde
-rw-rw-rw-@ 1 amiga staff 1 30 Jul 15:20 Untitled.m4a
-rw-r--r-- 1 amiga staff 253 30 Jul 15:20 VERT_BAT.BAT
-rwxr-xr-x 1 amiga staff 329 30 Jul 15:20 VERT_DSP.sh
-rwxr-xr-x 1 amiga staff 370 30 Jul 15:20 VERT_SOX.sh
-rw-r--r-- 1 amiga staff 1 30 Jul 15:20 dcdata.raw
-rw-r--r-- 1 amiga staff 65580 30 Jul 15:20 pulse1.wav
-rw-r--r-- 1 amiga staff 65580 30 Jul 15:20 pulse2.wav
-rwxr-xr-x 1 amiga staff 1 30 Jul 15:20 pulsetest.sh
-rw-r--r-- 1 amiga staff 48000 30 Jul 15:20 sample.raw
-rw-r--r-- 1 amiga staff 1 30 Jul 15:20 signed16bit.txt
-rw-r--r-- 1 amiga staff 65536 30 Jul 15:20 sinewave.raw
-rw-r--r-- 1 amiga staff 65580 30 Jul 15:20 sinewave.wav
-rw-r--r-- 1 amiga staff 8000 30 Jul 15:20 squarewave.raw
-rw-r--r-- 1 amiga staff 1 30 Jul 15:20 sweep.raw
-rw-r--r-- 1 amiga staff 1 30 Jul 15:20 sweep.wav
-rw-r--r-- 1 amiga staff 80000 30 Jul 15:20 sweeper.raw
-rw-r--r-- 1 amiga staff 8000 30 Jul 15:20 symmetricalwave.raw
-rw-r--r-- 1 amiga staff 1 30 Jul 15:20 symmetricalwave.wav
-rw-r--r-- 1 amiga staff 48000 30 Jul 15:20 waveform.raw
-rw-r--r-- 1 amiga staff 65580 30 Jul 15:20 waveform.wav
And thes five files inside your $HOME drawer:-
-rw-r--r-- 1 amiga staff 20715 30 Jul 15:20 AudioScope.Circuits
-rw-r--r-- 1 amiga staff 306 30 Jul 15:20 AudioScope.Config
-rw-r--r-- 1 amiga staff 119863 30 Jul 15:20 AudioScope.Manual
-rwxr-xr-x 1 amiga staff 223345 27 Jul 10:20 AudioScope.sh
-rw-r--r-- 1 amiga staff 6307 30 Jul 15:20 AudioScope_Quick_Start.Notes

Every single_byte file, except 'dcdata.raw', is not created UNTIL and UNLESS it is required for a particular capture mode and/or calibration/test facility.

These are a couple of current images using the SLOW Quicktime Player as the audio capture method, first a whistle into the internal mic, and second, a spectral disply to 4KHz.

The default initial DEMO, (/dev/urandom), capture mode is a learning mode and the vast majority of commands work although not much use in a realtime capture.

Hav a play around and......

ENJOY...
 

Attachments

  • AudioScope.sh.txt
    218.1 KB · Views: 51
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.