QuickEnvelope 1.1

roger_74 wrote on 3/4/2003, 8:46 AM
QuickEnvelope 1.1 is now available.

You can now choose to have settings pop up everytime you want to add points, or run settings separately.

The volume slider now uses a logarithmic scale, so you can see the volume in dB now. I hope I got that part right, I'm not much of a mathematician.

The filenames have changed, so if you've made any keyboardshortcuts you have to change them (Ctrl + Shift + Number).

Comments

Grazie wrote on 3/4/2003, 10:44 AM
Downloading now!
JohnnyRoy wrote on 3/4/2003, 11:52 AM
Roger,

Man you are fast. This is a great enhancement. Some of us will want to specify the amount each time (like myself) and its nice not to have to run two scripts to do that.

Now comes the harder part, bullet proofing the code. Some suggestions: (don’t you just love when other programmers critique your code... NOT! I mean these with the best of intentions.)

In FindSelectedTrack() you might want to check that the track is not only selected, but is also an audio track (e.g., track.IsAudio()). This way if both a video and audio track are selected (and you know the video will be on top), you don’t get an error message like "Error: bad envelope type". I would then change the name of the function to FindFirstSelectedAudioTrack() to be more descriptive of what its doing. Alternately you could just rename it FindFirstSelectTrack() and pass in the type of track you want as an argument like you did with FindEnvelope(). (I think I like that approach better as a generic reusable function now that I think about it)

In QEAddPoints() after you call FindSelectedTrack() add:

if (selectedTrack == null) throw "You must select an Audio track first.";

This will eliminate the "Error: Object reference not set to an instance of an object" error if no tracks are selected at all.

If you don’t make a timeline select you get a very confusing error: "Error: failed to add envelope point (point may already exist at that location". To eliminate this when there is no selection, add the following check after you declare and get the SelectionLength:

if (SelectionLength.FrameCount == 0) throw "You must make a Timeline selection first.";

You will still get this error if there is already a point at the location but at least it will be an accurate error message.

There is one side-effect that I think may be a bug in the API. When you select more than one Audio track, an envelope is added to ALL of the selected tracks although the volume dip is only processed in the first one as intended. There is nothing in your code that could have caused this that I can see. Very strange.

Overall a great script. I learned a lot from looking at it and understanding it. Now you’re gonna get ME writing ‘em. Then you get to critique my code.

BTW, thanks for the honorable mention in the header comments. ;-)

~jr
roger_74 wrote on 3/4/2003, 12:33 PM
I've always been lazy when it comes to errorhandling... but I'm working on it right now. Thanks for the suggestions. I've already put in multitrack support and made som optimizations, so the next version will be very useful I think (not available for download yet).

Sorry for all the releases, this is a learning process for me. I didn't think I'd be able to pull half of this off, but it's coming along nicely.

And I just discovered that the API Summary I've been looking at was for the Beta - Doh! Lots more fun stuff in the release.
PAW wrote on 3/4/2003, 2:32 PM

First time I have seen this script - thanks it's awesome
Grazie wrote on 3/5/2003, 3:31 AM
Roger,

I can get Envelope 1.1 to change the audio BUT I'm not getting the "QuickEnvelop11_Settings.js" to work - it come back with a large Error message starting with:

"System.ComponentModel.Win32Exception: This function is not supported on this system
at System.Windows.Forms.WindowsClass.RegisterClass()
at System.Windows.Forms.WindowsClass.Create(String className, Int32 classStyle)
.
.
.

and so on. There is another 10 lines of error messaging....

Sorry

Grazie
roger_74 wrote on 3/5/2003, 3:50 AM
Were you able to save settings in the fixed QuickEnvelope 1.0?
Grazie wrote on 3/5/2003, 6:36 AM
Yes - Absolutely - QE 1.0 settings no problem, that works great.
roger_74 wrote on 3/5/2003, 8:02 AM
Strange, I've tried 1.1 on WinXP and 98SE without problems.

When you're using Vegas, are you disabling any services? That shouldn't be a problem, but just in case.

It would be great if you could provide the whole error message, maybe a screenshot.
Grazie wrote on 3/5/2003, 9:33 AM
Hi Roger,

1 - "are you disabling any services? " what do you mean exactly?

2 - Yes a can get a screenshot ready, where/how do I send it to you? I need your email and I'll send it as a jpg or tif or bmp or whatever - yeah? I can do it in seconds. - That I can do ;-)

Grazie
Grazie wrote on 3/7/2003, 5:29 PM
Roger - THANK YOU! Perfection to a "T" . . . All I gotta to do now is figure out how to "assign" a Key-Stroke.

Thanks again . . . Grazie ;-)
roger_74 wrote on 3/7/2003, 6:46 PM
Finally :-)

The cool new thing about 1.2 (besides that it works) is that you can select several tracks simultaneously. I edited a short action movie a while back, and this function would have been very useful for editing shootouts where you have several audiotracks constantly playing the various gunsounds from different takes, but sometimes want to lower some of them as the video cuts to different places.
Grazie wrote on 3/7/2003, 6:53 PM
Yeah - I got it! Neat . . .

If I come up with any real-world places where I use it I'll tell you - yeah?

Thanks again Roger. Only you know what you did - For me, I wouldn't even have a clue!

All it need would need now is a type of "Toolbox" floater - so that one could just click on it and Bingo! it's done . . . no need for keystrokes! Or even an assigned CSP button to fire at an audio clip,

Grazie
roger_74 wrote on 3/7/2003, 7:17 PM
To assign a script to a key, select Tools -> Scripting -> Set script 1.
Now the script you choose is assigned to Ctrl+1. To make a button out of it, select Options -> Customize Toolbar. At the bottom of Available buttons are your scriptbuttons, add it to the toolbar. Very nicely done by SF!
Grazie wrote on 3/8/2003, 2:03 AM
Roger - It's Saturday morning - I've just got up - AND there you are! A solution right in front of me - you are Tooooo Excellent! Really Roger you are brilliant!

When I've properly "surfaced" later this morning I'm gonna give what you taught me, and give it a go. I do feel liberated,

Grazie