From 34bf4c8176f45bcb2da86d4ae5352573a4de7362 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sun, 18 Feb 2018 18:38:02 +0000 Subject: [PATCH] More spectral images. --- scripts/piped-work/docimages_all.py | 46 ++++++++++++++++++++----- scripts/piped-work/docimages_spectro.py | 18 +++++++--- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/scripts/piped-work/docimages_all.py b/scripts/piped-work/docimages_all.py index 06489d7a5..d41338d3e 100644 --- a/scripts/piped-work/docimages_all.py +++ b/scripts/piped-work/docimages_all.py @@ -5,12 +5,42 @@ # Make sure Audacity is running first and that mod-script-pipe is enabled # before running this script. +import time + + +# records time, name of file and returns contents. +def inner( name ) : + global old_name + global start_time + global results + result = old_name + ' took ' + str( time.time() - start_time ) + results.append( result ) + print( result ) + start_time = time.time() + if not name : + return "" + old_name = name + return open("docimages_" + name + ".py" ).read() + +#initialise timing +start_time = time.time() +old_name = 'startup' +results = [] + +#do the different files... +exec( inner( 'tracks' ) ) +exec( inner( 'labels' ) ) +exec( inner( 'spectro' ) ) +exec( inner( 'after' ) ) +exec( inner( 'envelopes' ) ) +exec( inner( 'cut_n_paste' ) ) +exec( inner( 'clip_boundaries' ) ) +exec( inner( 'oddments' ) ) + +#report on timing. +inner( "" ) + +print( "\n\nSummary:" ) +print( "\n".join( results ) ) + -exec( open("docimages_tracks.py" ).read() ) -exec( open("docimages_labels.py" ).read() ) -exec( open("docimages_spectro.py" ).read() ) -exec( open("docimages_after.py" ).read() ) -exec( open("docimages_envelopes.py" ).read() ) -exec( open("docimages_cut_n_paste.py" ).read() ) -exec( open("docimages_clip_boundaries.py" ).read() ) -exec( open("docimages_oddments.py" ).read() ) diff --git a/scripts/piped-work/docimages_spectro.py b/scripts/piped-work/docimages_spectro.py index 240d0b455..1b8f66cb7 100644 --- a/scripts/piped-work/docimages_spectro.py +++ b/scripts/piped-work/docimages_spectro.py @@ -55,12 +55,20 @@ def spectro_imagesB(): capture( 'Spectral004.png', 'All_Tracks' ) def spectro_imagesC(): + # A chirp and the word 'Audacity' loadExample( 'AudacitySpectral.wav' ) capture( 'Spectral005.png', 'All_Tracks' ) do( 'SetTrack: Scale=dB') capture( 'Spectral006.png', 'All_Tracks' ) do( 'SetTrack: Display=Spectrogram') capture( 'Spectral007.png', 'All_Tracks' ) + do( 'Select: Start=1.5 End=2.1 Low=3000 High=6000') + capture( 'Spectral008.png', 'All_Tracks' ) + do( 'Select: Start=1.1 End=2.5' ) + do( 'ZoomSel' ) + do( 'Select: Start=1.5 End=2.1 Low=3000 High=6000') + do( 'SetTrack: Height=400' ) + multiWindow( "SpectralVocal" ) def setWindow( name, value ): do( 'SetTrack: SpecPrefs=1 Name="Window Size '+value+'"' ) @@ -138,9 +146,9 @@ def spectro_imagesF(): #quickTest() -#spectro_imagesA() -#spectro_imagesB() -#spectro_imagesC() -#spectro_imagesD() -#spectro_imagesE() +spectro_imagesA() +spectro_imagesB() +spectro_imagesC() +spectro_imagesD() +spectro_imagesE() spectro_imagesF()