Script to route drums?

decrink wrote on 6/6/2003, 12:34 AM
Because of time constraints and traveling musicians, I have a series of songs that require drums to be recorded after most other tracking has been completed. Backwards from what I usually do but here is my question:

Is there a way to set up the same drum tracks in a dozen songs without having to place and name every track ie. snare, kick, leftOH, rightOH, etc. AND route their inputs. I have the sessions coming up soon and I'm trying to figure a way to save hundreds of mouse clicks.

I usually do drums near the beginning of sessions from a saved template...

Any ideas?

Comments

jetdv wrote on 6/6/2003, 8:23 AM
Adding and naming tracks is very easy:

For example:

Mtrack = new VideoTrack(0, "Snare");
Vegas.Project.Tracks.Add(Mtrack);

You can also use a similar method for adding bus tracks. Once the bus tracks are added, you can then sepecify the bus each track points to.

For coding purposes, I would probably create the bus tracks first and then, while using the above lines to create a new track, add a third line designating which bus track to use.
decrink wrote on 6/6/2003, 10:17 AM
This is great, but since I know nothing about code (but I'm willing to learn) is there anything (or anyone?) out there that can show me how to do it?

Is that little bit of code you wrote all that is needed to add tracks and then I'd set it up over and over in the same script for each drum part needed?

Very cool if I could get this happening. The drummer that I didn't think was going to be available has decided to replace programmed tracks with 'live' stuff. Hooray!

Thanks for the help.
jetdv wrote on 6/6/2003, 12:10 PM
OK, how about this as a starting point. Just add as many busses as needed. Then add as many tracks as needed assigning them to the proper bus. If you don't mind, post your final result.


/**
* This script will add busses and tracks assigned to those busses
* Test bus and track script
* Written by: Edward Troxel
* 06/06/2003
**/

import System;
import System.IO;
import System.Windows.Forms;
import SonicFoundry.Vegas;


try {

//Add a new bus
var Bus1 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus1);

//Add a second new bus
var Bus2 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus2);

//Add a track assigned to the first bus
var Snare = new AudioTrack(0, "Snare");
Vegas.Project.Tracks.Add(Snare);
Snare.BusTrack = Bus1;

//Add a second track assigned to the first bus
var Snare2 = new AudioTrack(0, "Snare 2");
Vegas.Project.Tracks.Add(Snare2);
Snare2.BusTrack = Bus1;

//Add a third track assigned to the second buss
var Kick = new AudioTrack(0, "Kick");
Vegas.Project.Tracks.Add(Kick);
Kick.BusTrack = Bus2;



} catch (e) {
MessageBox.Show(e);
}
johnmeyer wrote on 6/6/2003, 4:02 PM
I just went through the learning experience myself. I am a sometimes programmer and have run several software companies, so I know something about the subject, but nothing about jscript. The big problem in learning any programming language is to learn all the arcane specifics of that language. The fastest way to learn and to create something useful is to get lots of examples and then start by "cutting and pasting" codes segments from these examples to get what you want.

The best places to find Vegas script examples (other than this forum) are:

Creative Cow Scripting Examples

From jetdv (Edward Troxel, the gentleman who generously provided you the example scripts in this thread):

Vegas Video Tips, Tricks & Scripts

and finally,

Sundance Media Group .VEG and .JS examples

As a side note, the Vegas example files on this last site are a real eye opener. They helped me understand a lot more of what Vegas can do, especially in the area of titles.

Finally, I would also urge you to visit the Microsoft site that has information on the actual scripting language itself. This will help you understand the basic syntax. Here's the link:

Microsoft jscript Reference

Hopefully this information will be useful to others that want to begin scripting with Vegas.

John
decrink wrote on 6/6/2003, 4:16 PM
I'll give this scripting a try and see if I can route these drums. Of course it will probably take me three times longer than if I just set up the drums in every song but heck...I'll learn something along the way.

I'll post what happens.
Thanks jet and others
decrink wrote on 6/7/2003, 12:53 AM
Jet:
I tried this script and get an :
error on line 2
Expecting more source characters

What do I need to do? Oh and by the way, I've been checking out scripting now for the first time. I knew I wanted to try it but not on projects that I was finishing. Didn't want to mess things up. But, its very cool.

Thanks for helping me learn this.
jetdv wrote on 6/7/2003, 6:38 AM
I tested it before pasting it so I know it is right. Make sure you copy EVERYTHING between the two lines of equal signs. If you still can't get it to work, I can send you the script via e-mail.


Script begins here:
=====================================



/**
* This script will add busses and tracks assigned to those busses
* Test bus and track script
* Written by: Edward Troxel
* 06/06/2003
**/
import System;
import System.IO;
import System.Windows.Forms;
import SonicFoundry.Vegas;
try {
var Bus1 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus1);
var Bus2 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus2);
var Snare = new AudioTrack(0, "Snare");
Vegas.Project.Tracks.Add(Snare);
Snare.BusTrack = Bus1;
var Snare2 = new AudioTrack(0, "Snare 2");
Vegas.Project.Tracks.Add(Snare2);
Snare2.BusTrack = Bus1;
var Kick = new AudioTrack(0, "Kick");
Vegas.Project.Tracks.Add(Kick);
Kick.BusTrack = Bus2;
} catch (e) {
MessageBox.Show(e);
}


===========================================
Script is done.
jetdv wrote on 6/7/2003, 12:26 PM
I have saved a known working version at:

Drums Script

Just save this file to your hard drive and eliminate the ending ".txt" so that it ends with ".js".
decrink wrote on 6/7/2003, 5:30 PM
Brilliant! It does exactly what I need it to do and now I can see how it works. I can set up as many lines of code and it will do the whole drum kit, just as I wanted.

Three cheers for jetdv, Edward Troxel! I appreciate your sticking with me on this question.
Bill
risenwithhim wrote on 6/9/2003, 4:02 PM
You use Vegas to track/mix music? Which interface are you using?

Why are you tracking music on Vegas?

Just curious :)
roger_74 wrote on 6/9/2003, 6:09 PM
I have to know... Why not? That's what Vegas was made for.
SonyJEV wrote on 6/10/2003, 12:17 AM
"Three cheers for jetdv, Edward Troxel! I appreciate your sticking with me on this question"

And not even one cheer for me who suggested it might solve your problem :(

Just Kidding

I'm very happy you found a solution.

--j
CDM wrote on 6/11/2003, 5:58 PM
yeah, why wouldn't you track in Vegas??
decrink wrote on 6/16/2003, 7:05 PM
and two cheers for SonicJEV for suggesting it! I think you did that in the audio forum eh?

Oh, and I track in Vegas all the time. Of course. Why not? It works great. I'm not sure I understand the question. Maybe a return question as to why you don't?
risenwithhim wrote on 6/28/2003, 8:56 AM
I track to tape (DA-38). I stay completely outside of the computer with tracking and mixing music. Mostly because i don't have the $$ to do it right with I/O, so I don't want to compromise.

Hats off to you guys for making Vegas work as a music NLE. Down with the ivory tower nay-sayers, I guess. Heh heh.

On another note though, I've struggled through a number of books and tutorials on JavaScript, and my brain just cannot follow the logic. I'm afraid I just can't comprehend it well enough to enjoy the scripting benefit of Vegas, to my chagrin. I wish there were some way that someone could communicate JavaScript to me in a way I could just grab ahold of.
decrink wrote on 7/16/2003, 1:13 PM
I've been using this script with great joy. Now I'm wondering if there is a line that could also name the buss tracks rather than just having them come up as G-H-I or whatever is next in line. I'd love to be able to include a line in this script that would name the busses ie., snare, OH Left, cymbals, kick, tomsLeft, etc.

Any ideas from you script masters for making this happen?
Bill
jetdv wrote on 7/16/2003, 1:26 PM
How about changing:

var Bus1 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus1);


To

var Bus1 = new AudioBusTrack();
Vegas.Project.BusTracks.Add(Bus1);
Bus1.Description = "Cymbals";


Will that do what you want? (Naturally, repeat for all added busses.)
decrink wrote on 7/16/2003, 3:20 PM
Fantastic! That does the trick. Just needed the Bus Description.
Thank you, Ed

Bill
TalawaMan wrote on 3/27/2005, 6:41 PM
Sorry to bring up an old topic, but the original question also asked if there was a way to "route the inputs for a track". I didn't how the provided solution gave this ability. I have also looked through the abstract track class and don't see any attribute to set that will allow setting the input for a track programicly.

Is there a way to do this?

Jacob Christ
www.SweetNannyGoat.com