mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-18 16:41:14 +02:00
Script work
Add Envelope script Add Clips and Boundaries Scripts. Add docimages_oddments.py for the weirder cases. Add make html script. Add more spectral images Add Dark versions of spectrograms (paul's comment) Clean up oddments script. - This commit also adds an option NOT to bring Audacity to the top when screenshotting. -- That's because QuickPlay will disappear if you do -because you lose mouse capture. - Also allow negative window IDs in the drag command. - Registration names of align commands sorted. They had &, : and / in them. - Fixed bug in SetTrackInfo where bFocused was being ignored - Fixed bug where command manager ignored multi-commands. - Commit docimages_oddments.py again, to fix line endings.
This commit is contained in:
committed by
Paul Licameli
parent
4724c6a131
commit
fa49d94530
@@ -8,6 +8,8 @@
|
||||
#load and run the common core.
|
||||
exec( open("docimages_core.py" ).read() )
|
||||
|
||||
import math
|
||||
import time
|
||||
|
||||
|
||||
# 11 2KHz tones, of decreasing amplitude.
|
||||
@@ -32,29 +34,139 @@ def makeStepper():
|
||||
do( 'Select: Start=0 End=0')
|
||||
|
||||
|
||||
def spectro_image1and2() :
|
||||
def spectro_imagesA() :
|
||||
loadStereoTracks(1)
|
||||
# A stereo track
|
||||
capture( 'Spectral001.png', 'First_Track' )
|
||||
# As spectrogram.
|
||||
do( 'SetTrack: Track=0 Display=Spectrogram')
|
||||
do( 'Select: Start=55 End=70 First=0 Last=1')
|
||||
capture( 'Spectral002.png', 'First_Track' )
|
||||
capture( 'Spectral002.png', 'All_Tracks' )
|
||||
# Half spectrogram, half wave.
|
||||
do( 'SetTrack: Channel=1 Display=Waveform')
|
||||
capture( 'MixedMode.png', 'First_Track' )
|
||||
capture( 'MixedMode.png', 'All_Tracks' )
|
||||
|
||||
def spectro_image3and4():
|
||||
def spectro_imagesB():
|
||||
makeStepper();
|
||||
# Stepper tone, viewed in dB.
|
||||
do( 'SetTrack: Scale=dB')
|
||||
capture( 'Spectral003.png', 'First_Two_Tracks' )
|
||||
capture( 'Spectral003.png', 'All_Tracks' )
|
||||
# As spectrogram.
|
||||
do( 'SetTrack: Display=Spectrogram')
|
||||
capture( 'Spectral004.png', 'First_Two_Tracks' )
|
||||
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+'"' )
|
||||
do( 'SetPreference: Name="/Spectrum/FFTSize" Reload=1 Value='+value )
|
||||
do( 'SetTrack: Track=0 Display=Spectrogram' )
|
||||
capture( name + postfix + value + '.png', 'All_Tracks' )
|
||||
|
||||
|
||||
def multiWindow( name ) :
|
||||
setWindow( name, "256" )
|
||||
setWindow( name, "512" )
|
||||
setWindow( name, "2048" )
|
||||
setWindow( name, "4096" )
|
||||
setWindow( name, "8192" )
|
||||
setWindow( name, "1024" ) # done last so we restore the default.
|
||||
|
||||
|
||||
def spectro_imagesD():
|
||||
makeWayForTracks()
|
||||
do( 'NewMonoTrack' )
|
||||
do( 'Select: Start=0.7 End=1.3')
|
||||
do( 'Silence' ) #Just so we can watch.
|
||||
do( 'Select: Start=0.8 End=1.2')
|
||||
do( 'ZoomSel')
|
||||
do( 'Select: Start=0.7 End=1.3')
|
||||
do( 'Tone: Frequency=3000 Amplitude=0.8' )
|
||||
do( 'Select: Start=0.99 End=0.99005' )
|
||||
do( 'Tone: Frequency=12000 Amplitude=0.9' )
|
||||
do( 'Select: Start=1.01 End=1.01005' )
|
||||
do( 'Tone: Frequency=12000 Amplitude=0.9' )
|
||||
do( 'Select: Start=0 End=0' )
|
||||
multiWindow( 'SpectralAt' )
|
||||
|
||||
def spectro_imagesE():
|
||||
makeWayForTracks()
|
||||
do( 'NewMonoTrack' )
|
||||
do( 'Select: Start=0 End=1.2')
|
||||
do( 'ZoomSel')
|
||||
do( 'Pluck' )
|
||||
do( 'Select: Start=0.1 End=1.0')
|
||||
do( 'ZoomSel')
|
||||
multiWindow( 'SpectralNote' )
|
||||
|
||||
def makeScale( start, end, count ) :
|
||||
a = math.exp( math.log( end/start) /(count-1 ))
|
||||
makeWayForTracks()
|
||||
do( 'NewMonoTrack' )
|
||||
do( 'Select: Start=0 End=' + str( count/10 ))
|
||||
do( 'Silence' ) #To see it happen...
|
||||
do( 'SetTrack: Track=0 SpecPrefs=1 Display=Spectrogram' )
|
||||
do( 'ZoomSel' )
|
||||
#do( 'SetTrack: Track=0 Display=Spectrogram' )
|
||||
for i in range( 0 , count , 2 ):
|
||||
note = start * ( a ** i )
|
||||
#print( note )
|
||||
do( 'Select: Start=' + str( i / 10) + ' End=' + str( (i+1)/10 ))
|
||||
do( 'Tone: Frequency=' +str( note ) )
|
||||
do( 'Select: Start=' + str( i / 10) + ' End=' + str( ( i / 10) +0.05))
|
||||
do( 'FadeIn' )
|
||||
do( 'Select: Start=' + str( (i+1) / 10 -0.05) + ' End=' + str( (i+1) / 10 ))
|
||||
do( 'FadeOut' )
|
||||
do( 'FitInWindow' )
|
||||
#do( 'Select: Start=0 End=' + str( count/10 ))
|
||||
#do( 'Join' )
|
||||
do( 'Select: Start=0 End=0')
|
||||
|
||||
|
||||
def spectro_imagesF():
|
||||
makeScale( 200, 4000, 100 )
|
||||
do( 'SetTrack: Track=0 Display=Spectrogram' )
|
||||
capture( 'ScaleLin.png', 'All_Tracks' )
|
||||
do( 'SetPreference: Name=/Spectrum/ScaleType Value=1 Reload=1')
|
||||
capture( 'ScaleLog.png', 'All_Tracks' )
|
||||
do( 'SetPreference: Name=/Spectrum/ScaleType Value=0 Reload=1')
|
||||
|
||||
|
||||
#quickTest()
|
||||
|
||||
spectro_image1and2()
|
||||
spectro_image3and4()
|
||||
do( 'SetPreference: Name="/GUI/Theme" Value=light Reload=1' )
|
||||
|
||||
|
||||
postfix = ''
|
||||
spectro_imagesA()
|
||||
spectro_imagesB()
|
||||
spectro_imagesC()
|
||||
spectro_imagesD()
|
||||
spectro_imagesE()
|
||||
spectro_imagesF()
|
||||
|
||||
do( 'SetPreference: Name="/GUI/Theme" Value=dark Reload=1' )
|
||||
|
||||
postfix = 'Dark'
|
||||
spectro_imagesA()
|
||||
spectro_imagesB()
|
||||
spectro_imagesC()
|
||||
spectro_imagesD()
|
||||
spectro_imagesE()
|
||||
spectro_imagesF()
|
||||
|
||||
do( 'SetPreference: Name="/GUI/Theme" Value=light Reload=1' )
|
||||
|
Reference in New Issue
Block a user