1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-27 15:50:10 +01:00

Shorter command names. General tidying.

-More commands now have shorter names for parameters.
-New scripts for generating images.
-Several old-style commands retired.
This commit is contained in:
James Crook
2018-02-24 12:56:58 +00:00
committed by Paul Licameli
parent 62ca1cce26
commit 5d36890cb0
13 changed files with 215 additions and 160 deletions

View File

@@ -66,141 +66,163 @@ def quickTest() :
def setup() :
global path
global sample
path = '\"C:/Users/James Crook/\"'
sample ='\"C:\\Users\\Public\\Music\\Sample Music\\Concerto.mp3\"'
do( 'SetProject: X=10 Y=10 Width=850 Height=800' )
def makeWayForTracks( ) :
do( 'SelectTracks: FirstTrack=0 LastTrack=20' )
do( 'Select: First=0 Last=20' )
do( 'RemoveTracks' )
def capture( what ) :
def capture( name, what ) :
global path
do( 'Screenshot: Path='+path+' CaptureWhat=' + what )
do( 'Screenshot: Path='+path+name+' CaptureWhat=' + what )
def makeMonoTracks( num ) :
makeWayForTracks( )
for i in range( 0, num ):
do( 'NewMonoTrack' )
do( 'SetTrack: TrackIndex=0 Name="Foxy Lady"')
do( 'SelectTime: StartTime=0 EndTime=30' )
do( 'SelectTracks: FirstTrack=0 LastTrack=' + str(num-1) )
do( 'SetTrack: Track=0 Name="Foxy Lady"')
do( 'Select: Start=0 End=30 First=0 Last=' + str(num-1) )
do( 'Chirp: StartAmp=0.5' )
do( 'Wahwah' )
do( 'FitInWindow' )
do( 'SelectTime: StartTime=11 EndTime=14')
do( 'Select: Start=11 End=14')
def loadStereoTrack():
global sample
makeWayForTracks( )
do( 'Import2: Filename='+sample )
do( 'Select: Start=0 End=150')
do( 'ZoomSel' )
do( 'SetTrack: Track=0 Name="The Poodle Podcast"')
def makeStereoTracks( num ) :
makeWayForTracks( )
if( num == 1 ):
loadStereoTrack()
return
for i in range( 0, num ):
do( 'NewStereoTrack' )
do( 'SetTrack: TrackIndex=0 Name="Voodoo Children IN STEREO"')
do( 'SelectTime: StartTime=0 EndTime=30' )
do( 'SelectTracks: FirstTrack=0 LastTrack=' + str(num*2-1) )
do( 'SetTrack: Track=0 Name="Voodoo Children IN STEREO"')
do( 'Select: Start=0 End=30 First=0 Last=' + str(num*2-1) )
do( 'Chirp: StartAmp=0.5' )
do( 'Wahwah' )
do( 'FitInWindow' )
do( 'SelectTime: StartTime=11 EndTime=14')
do( 'Select: Start=55 End=70')
def addLabels():
do( 'SelectTime: StartTime=0 EndTime=1' )
do( 'Select: Start=0 End=1' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'SetLabel: LabelIndex=0 Text="Homweward Bound" Start=1 End=1 ')
do( 'SetLabel: LabelIndex=1 Text="Silver Dagger" Start=7 End=7 ')
do( 'SetLabel: LabelIndex=2 Selected=1 Text="NOISE" Start=9 End=12 ')
do( 'SetLabel: LabelIndex=3 Text="Blood in These Veins" Start=16 End=16 ')
do( 'SelectTime: StartTime=9 EndTime=12' )
do( 'SetLabel: Label=0 Text="Homweward Bound" Start=1 End=1 ')
do( 'SetLabel: Label=1 Text="Silver Dagger" Start=35 End=35 ')
do( 'SetLabel: Label=2 Selected=1 Text="NOISE" Start=45 End=60 ')
do( 'SetLabel: Label=3 Text="Blood in These Veins" Start=80 End=80 ')
do( 'Select: Start=45 End=60' )
def addLabels2():
do( 'SelectTime: StartTime=0 EndTime=1' )
do( 'Select: Start=0 End=1' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'NewLabelTrack' )
#do( 'SelectTracks: FirstTrack=2 LastTrack=2' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'AddLabel' )
do( 'SetLabel: LabelIndex=0 Selected=0 Text="intro" Start=0.1 End=0.1 ')
do( 'SetLabel: LabelIndex=1 Text="thoughtpiece" Start=3 End=3 ')
do( 'SetLabel: LabelIndex=2 Text="discussion" Start=12 End=12 ')
do( 'SetLabel: LabelIndex=3 Text="summary" Start=20 End=20 ')
do( 'SetLabel: LabelIndex=4 Text="credits" Start=25 End=25 ')
do( 'SetLabel: LabelIndex=5 Selected=0 Text="Bach" Start=0.1 End=0.1 ')
do( 'SetLabel: LabelIndex=6 Text="Vivaldi" Start=6 End=6 ')
do( 'SetLabel: LabelIndex=7 Text="Mozart" Start=12 End=12 ')
do( 'SetLabel: LabelIndex=8 Text="Satie" Start=18 End=18 ')
do( 'SetLabel: LabelIndex=9 Text="Chopin" Start=24 End=24 ')
do( 'SelectTracks: FirstTrack=3 LastTrack=3' )
do( 'SetLabel: Label=0 Selected=0 Text="intro" Start=0.5 End=0.5 ')
do( 'SetLabel: Label=1 Text="thought piece" Start=15 End=15 ')
do( 'SetLabel: Label=2 Text="discussion" Start=60 End=60 ')
do( 'SetLabel: Label=3 Text="summary" Start=100 End=100 ')
do( 'SetLabel: Label=4 Text="credits" Start=125 End=125 ')
do( 'SetLabel: Label=5 Selected=0 Text="Bach" Start=0.5 End=0.5 ')
do( 'SetLabel: Label=6 Text="Vivaldi" Start=30 End=30 ')
do( 'SetLabel: Label=7 Text="Mozart" Start=60 End=60 ')
do( 'SetLabel: Label=8 Text="Satie" Start=90 End=90 ')
do( 'SetLabel: Label=9 Text="Chopin" Start=120 End=120 ')
do( 'Select: First=3 Last=3' )
# A stero track with four labels.
def image1() :
makeStereoTracks(1)
addLabels()
capture( 'First_Two_Tracks' )
do( "Select: Start=0 End=0" )
capture( 'AutoLabels001.png', 'First_Two_Tracks' )
# Removing a label with delete (fraud - we used split delete)
def image2() :
makeStereoTracks(1)
addLabels()
do( "SelectTime: StartTime=8.9 EndTime=12.1" )
do( "SelectTracks: FirstTrack=2 LastTrack=2" )
do( "Select: Start=44.5 End=60.5 First=2 Last=2" )
do( "SplitDelete" )
do( "SelectTime: StartTime=0 EndTime=0" )
do( "SelectTracks: FirstTrack=0 LastTrack=2" )
capture( 'First_Two_Tracks' )
do( "Select: Start=0 End=0 First=0 Last=2" )
capture( 'AutoLabels002.png','First_Two_Tracks' )
# Removing a label with split-delete step 1
def image3() :
makeStereoTracks(1)
addLabels()
do( "SelectTime: StartTime=8.9 EndTime=12.1" )
do( "SelectTracks: FirstTrack=2 LastTrack=2" )
capture( 'First_Two_Tracks' )
do( "Select: Start=44.5 End=60.5 First=2 Last=2" )
capture( 'AutoLabels003.png','First_Two_Tracks' )
# Removing a label with split-delete step 1
def image4() :
makeStereoTracks(1)
addLabels()
do( "SelectTime: StartTime=8.9 EndTime=12.1" )
do( "SelectTracks: FirstTrack=2 LastTrack=2" )
do( "Select: Start=44.5 End=60.5 First=2 Last=2" )
do( "SplitDelete" )
capture( 'First_Two_Tracks' )
capture( 'AutoLabels004.png','First_Two_Tracks' )
def image5() :
makeStereoTracks(1)
addLabels2()
do( "SelectTime: StartTime=0 EndTime=0" )
capture( 'First_Three_Tracks' )
do( "Select: Start=0 End=0" )
capture( 'AutoLabels005.png','First_Three_Tracks' )
def image6() :
makeStereoTracks(1)
addLabels2()
do( "SelectTime: StartTime=5.7 EndTime=11.7" )
capture( 'First_Three_Tracks' )
do( "Select: Start=28.5 End=58.5" )
capture( 'AutoLabels006.png','First_Three_Tracks' )
def image7() :
makeStereoTracks(1)
addLabels2()
do( "SelectTime: StartTime=5.7 EndTime=11.7" )
do( "Select: Start=28.5 End=58.5" )
do( "Delete" )
do( "SelectTime: StartTime=0 EndTime=0" )
capture( 'First_Three_Tracks' )
do( "Select: Start=0 End=0" )
capture( 'AutoLabels007.png','First_Three_Tracks' )
def image8to10() :
makeStereoTracks(1)
addLabels2()
do( "Select: First=2 Last=2 Start=100 End=125" )
do( "AddLabel" )
do( 'SetLabel: Label=9 Text="Clap" selected=0 Start=110 End=118 ')
do( 'Select: First=0 Last=3 Start=0 End=0')
capture( 'AutoLabels008.png','First_Three_Tracks' )
do( 'SetLabel: Label=9 Text="Clap" selected=1 Start=110 End=118 ')
do( 'Select: First=0 Last=3 Start=110 End=118')
capture( 'AutoLabels009.png','First_Three_Tracks' )
do( 'Delete' )
capture( 'AutoLabels010.png','First_Three_Tracks' )
#quickTest()
setup()
image1()
image2()
image3()
image4()
image5()
image6()
image7()
#image1()
#image2()
#image3()
#image4()
#image5()
#image6()
#image7()
image8to10()

View File

@@ -66,119 +66,130 @@ def quickTest() :
def setup() :
global path
path = '\"C:/Users/James Crook/\"'
global sample
path = 'C:\\Users\\James Crook\\'
sample ='C:\\Users\\James Crook\\Music\\The Poodle Podcast.wav'
do( 'SetProject: X=10 Y=10 Width=850 Height=800' )
def makeWayForTracks( ) :
do( 'SelectTracks: FirstTrack=0 LastTrack=20' )
do( 'SelectTracks: First=0 Last=20' )
do( 'RemoveTracks' )
def capture( name, what ) :
global path
do( 'Screenshot: Path="'+path+name+'" CaptureWhat=' + what )
def loadMonoTrack():
global sample
makeWayForTracks( )
do( 'Import2: Filename="'+sample+'"' )
do( 'Select: First=0 Last=0 Start=0 End=150')
do( 'Trim')
do( 'ZoomSel' )
def loadMonoTracks( num ) :
makeWayForTracks( )
loadMonoTrack()
do( 'SetTrack: Track=0 Name="Foxy Lady"')
for i in range( 0, num-1 ):
do( 'Duplicate' )
do( 'FitInWindow' )
do( 'Select: Start=55 End=70')
def makeMonoTracks( num ) :
makeWayForTracks( )
for i in range( 0, num ):
do( 'NewMonoTrack' )
do( 'SetTrack: TrackIndex=0 Name="Foxy Lady"')
do( 'SelectTime: StartTime=0 EndTime=30' )
do( 'SelectTracks: FirstTrack=0 LastTrack=' + str(num-1) )
do( 'SetTrack: Track=0 Name="Foxy Lady"')
do( 'Select: Start=0 End=150 First=0 Last=' + str(num-1) )
do( 'Chirp: StartAmp=0.5' )
do( 'Wahwah' )
do( 'FitInWindow' )
do( 'SelectTime: StartTime=11 EndTime=14')
do( 'Select: Start=55 End=70')
def makeStereoTracks( num ) :
makeWayForTracks( )
for i in range( 0, num ):
do( 'NewStereoTrack' )
do( 'SetTrack: TrackIndex=0 Name="Voodoo Children IN STEREO"')
do( 'SelectTime: StartTime=0 EndTime=30' )
do( 'SelectTracks: FirstTrack=0 LastTrack=' + str(num*2-1) )
do( 'SetTrack: Track=0 Name="Voodoo Children IN STEREO"')
do( 'Select: Start=0 End=150 First=0 Last=' + str(num*2-1) )
do( 'Chirp: StartAmp=0.5' )
do( 'Wahwah' )
do( 'FitInWindow' )
do( 'SelectTime: StartTime=11 EndTime=14')
do( 'Select: Start=55 End=70')
# A mono track complete with ruler
def image1() :
global path
makeMonoTracks(1)
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track_Plus' )
loadMonoTracks(1)
capture( 'AutoTracks001.png', 'First_Track_Plus' )
# A stereo track, with its name on the track
def image2() :
global path
makeStereoTracks(1)
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
capture( 'AutoTracks002.png', 'First_Track' )
# Four colours of track
def image3() :
global path
makeMonoTracks( 4 )
do( 'SetTrack: TrackIndex=0 Name="Instrument 1" Height=122 Color=Color0')
do( 'SetTrack: TrackIndex=1 Name="Instrument 2" Height=122 Color=Color1')
do( 'SetTrack: TrackIndex=2 Name="Instrument 3" Height=122 Color=Color2')
do( 'SetTrack: TrackIndex=3 Name="Instrument 4" Height=122 Color=Color3')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Four_Tracks' )
loadMonoTracks( 4 )
do( 'SetTrack: Track=0 Name="Instrument 1" Height=122 Color=Color0')
do( 'SetTrack: Track=1 Name="Instrument 2" Height=122 Color=Color1')
do( 'SetTrack: Track=2 Name="Instrument 3" Height=122 Color=Color2')
do( 'SetTrack: Track=3 Name="Instrument 4" Height=122 Color=Color3')
capture( 'AutoTracks003.png', 'First_Four_Tracks' )
# Two Tracks, ready to make stereo
def image4():
global path
makeMonoTracks(2)
do( 'SetTrack: TrackIndex=0 Name="Left Track" Height=80')
do( 'SetTrack: TrackIndex=1 Name="Right Track" Height=80')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Two_Tracks' )
loadMonoTracks(2)
do( 'SetTrack: Track=0 Name="Left Track" Height=80')
do( 'SetTrack: Track=1 Name="Right Track" Height=80')
capture( 'AutoTracks004.png', 'First_Two_Tracks' )
# Mono tracks made stereo
def image5():
global path
makeMonoTracks(2)
do( 'SetTrack: TrackIndex=0 Pan=-1 Height=80')
do( 'SetTrack: TrackIndex=1 Pan=1 Height=80')
loadMonoTracks(2)
do( 'SetTrack: Track=0 Pan=-1 Height=80')
do( 'SetTrack: Track=1 Pan=1 Height=80')
do( 'MixAndRender' )
do( 'SetTrack: TrackIndex=0 Name="Combined" Height=80')
do( 'SetTrack: TrackIndex=1 Height=80')
do( 'SelectTracks: FirstTrack=0 LastTrack=1' )
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
do( 'SetTrack: Track=0 Name="Combined" Height=80')
do( 'SetTrack: Track=1 Height=80')
do( 'Select: First=0 Last=1' )
capture( 'AutoTracks005.png', 'First_Track' )
# A stereo track, with different sized channels
def image6() :
global path
makeStereoTracks(1)
do( 'SetTrack: TrackIndex=0 Height=80')
do( 'SetTrack: TrackIndex=1 Height=180')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
do( 'SetTrack: Track=0 Height=80')
do( 'SetTrack: Track=1 Height=180')
capture( 'AutoTracks006.png', 'First_Track' )
# Two mono tracks of different sizes
def image7() :
global path
makeMonoTracks(2)
do( 'SetTrack: TrackIndex=0 Height=80')
do( 'SetTrack: TrackIndex=1 Height=180')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Two_Tracks' )
loadMonoTracks(2)
do( 'SetTrack: Track=0 Height=180')
do( 'SetTrack: Track=1 Height=80')
capture( 'AutoTracks007.png', 'First_Two_Tracks' )
# Mono with arrow at start.
def image8() :
global path
makeMonoTracks(1)
do( 'SetClip: ClipIndex=0 Start=-4.0')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
loadMonoTracks(1)
do( 'SetClip: Clip=0 Start=-4.0')
capture( 'AutoTracks008.png', 'First_Track' )
# Zoomed in to show points stem-plot
def image9() :
global path
#make rather than load. We want an artificial track.
makeMonoTracks(1)
do( 'SelectTime: StartTime=0 EndTime=0.003' )
do( 'Select: Start=0 End=0.003' )
do( 'ZoomSel' );
do( 'Amplify: Ratio=3.0' )
do( 'SetPreference: Name=/GUI/SampleView Value=1 Reload=1')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
capture( 'AutoTracks009.png', 'First_Track' )
# Zoomed in to show points stem-plot and then no stem plot
def image9and10() :
global path
image9()
do( 'SetPreference: Name=/GUI/SampleView Value=0 Reload=1')
do( 'Screenshot: Path='+path+' CaptureWhat=First_Track' )
capture( 'AutoTracks010.png', 'First_Track' )
#quickTest()
setup()