AudioMasters
 
  User Info & Key Stats   
Welcome, Guest. Please login or register.

Login with username, password and session length
November 26, 2007, 03:47:56 AM
62368 Posts in 6177 Topics by 2129 Members
Latest Member: Gonzo
News:   | Forum Rules
+  AudioMasters
|-+  Audio Software
| |-+  Previous Versions
| | |-+  Cool Edit 2.0 & 2.1, Audition 1.0 & 1.5
| | | |-+  Scripting - moving the cursor position absolutely
  « previous next »
Pages: [1] Print
Author
Topic: Scripting - moving the cursor position absolutely  (Read 679 times)
« on: December 18, 2005, 01:21:19 PM »
ryclark Offline
Member
*****
Posts: 275



I have been trying for some time to record scripts in Audition and assign them to a keyboard shortcut that make repetitive tasks quicker and easier. Like, I suspect, many others I have been frustrated by the problems of making the cursor go where you want in the file you are working on. A script recorded whilst working on one WAV file doesn't move the cursor correctly in a different file. But now I think I have found the answer. Cheesy

Firstly, when you record a script incorporating a cursor movement a line is generated thus:

   Selected: none at x scaled y SR z

where x is the amount the cursor moves, y is the length of the file in samples and z is the sample rate in samples/sec.

For instance a script that moves the cursor forward by .5 of a second in a file lasting 1 minute recorded at 48K produces this:

   Selected: none at 24000 scaled 2880000 SR 48000

This will only work on that length of file at that sample rate. In any other file the cursor will not end up in the correct place. The larger the difference in size between the original file and the new one the larger is the cursor's positional error.

However yesterday, in an Eureka moment, I discovered that if you edit the value of the scaled factor y to be 0 then the cursor will move the correct amount whatever the size of the file. ie.:

   Selected: none at 24000 scaled 0 SR 48000

This will always move the cursor exactly .5 sec forward regardless of the length of the WAV file. So now the amount of movement is solely dependant on the sample rate z.

   Amount cursor moves in samples = x/z secs.

In fact it turns out that it doesn't matter whether the value of z is the same as the real sample rate of your audio file or not.

   Selected: none at 50 scaled 0 SR 100

works just as well. So now it seems that you can move the cursor accurately anywhere you want in a script for use on a file of any length at any sample rate.


Here is a small example of a complete script that selects an area .5 sec ahead of the cursor without altering the file length and silences it. Ideal for setting a clean in point to an audio cue.


Collection: test

Title: SilenceMinusHalfSecond
Description:
Mode: 2
Undo: 1

Selected: none at 0 scaled 0 SR 48000
Freq: Off
cmd: Channel Both

Selected: -24000 to 0 scaled 0 SR 48000
Freq: Off
cmd: Silence

End:


This would seem to open up endless possibilities for scripting in Audition. But I suggest you do some experimenting yourselves to make sure I haven't made any fundamental errors in my tests.

Good Scripting and a Happy Christmas.
Logged
Reply #1
« on: December 18, 2005, 07:36:27 PM »
noddy Offline
Member
*****
Posts: 277

WWW

Ryclark,
If this works (and I'll be checking it out when I get to work this morning), I reckon you'll be one popular dude! Smiley
This has come up before, at least once that I know of months/years ago.
Logged

Cheers,
Bruce.
Audio2u
The home of quality podcasts, including "Building the pod (Understanding Adobe Audition)" and "Sine Language", a discussion on all things audio.
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS! Ig-Oh Theme by koni.