Comments

jetdv wrote on 9/26/2005, 6:37 AM
You can definitely write a script the places markers on the timeline based on a specific time interval.

Marker Interval script
JohnnyRoy wrote on 9/26/2005, 6:50 AM
Sure. What I would do in the script is to set the ruler format to measures and beats. Then dropping markers at the start of each measure like this:
/** 
* Program: MeasureMarkers.js
* Description: This script will set markers at measure boundaries
* Author: Johnny (Roy) Rofrano jrofrano at vasst.com
* Date: September 26, 2005
*
**/
import System.Windows.Forms;
import Sony.Vegas;

var maxMeasures : int = 10;

try
{
// always save anything we intent to change
var savedRulerFormat : RulerFormat = Vegas.Project.Ruler.Format;
// set the ruler format to measures and beats
Vegas.Project.Ruler.Format = RulerFormat.MeasuresAndBeats;

var count : int = 0;
for(var i : int = 1; i <= maxMeasures; i++)
{
var position : String = String.Format("{0}.1.000", i);
var measure : Marker = new Marker(new Timecode(position), position);
try
{
Vegas.Project.Markers.Add(measure);
count++;
}
catch(err)
{
MessageBox.Show("Marker already exists at: " + position);
}
}

// restore project ruler format to what it was
Vegas.Project.Ruler.Format = savedRulerFormat;
// give feedback
MessageBox.Show(count + " measure markers added.");
}
catch (e)
{
MessageBox.Show(e);
}
~jr
mangooo wrote on 9/26/2005, 11:23 PM
JohnnyRoy

Your script is fantastic. Since u are the master now i have one more question :)

If i want to ad markers on each beat "like on 1 2 3 4 instead off (1) 2 3 4 (1) 2 3 4, what do i need to change in the script then ?

/M
jetdv wrote on 9/27/2005, 5:07 PM
Here's a modification to John's script that should do what you want:


/**
* Program: MeasureMarkers.js
* Description: This script will set markers at measure boundaries
* Author: Johnny (Roy) Rofrano jrofrano at vasst.com
* Date: September 26, 2005
*
**/

import System.Windows.Forms;
import Sony.Vegas;

var maxMeasures : int = 10;

try
{
// always save anything we intent to change
var savedRulerFormat : RulerFormat = Vegas.Project.Ruler.Format;
// set the ruler format to measures and beats
Vegas.Project.Ruler.Format = RulerFormat.MeasuresAndBeats;
var count : int = 0;
for(var i : int = 1; i <= maxMeasures; i++)
{
for(var j : int = 1; j <= 4; j++)
{
var position : String = String.Format("{0}.{1}.000", i, j);
var measure : Marker = new Marker(new Timecode(position), position);
try
{
Vegas.Project.Markers.Add(measure);
count++;
}
catch(err)
{
MessageBox.Show("Marker already exists at: " + position);
}
}
}

// restore project ruler format to what it was
Vegas.Project.Ruler.Format = savedRulerFormat;
// give feedback
MessageBox.Show(count + " measure markers added.");
}
catch (e)
{
MessageBox.Show(e);
}
mangooo wrote on 9/28/2005, 12:32 AM


Big thanks master jetdv. Perfect, works super duper great :)

Any one knows if it is possible to change colors of the markers ?
jetdv wrote on 9/28/2005, 6:54 AM
All the "Markers" will be the same color - orange. Now you can also have Command Markers which are blue and Regions which are Green. The script could be modified to use one of them instead.
mangooo wrote on 9/29/2005, 2:46 AM
Wondering if it is possible to have all nr 1 green and the 2 3 4 orange ? ?

Would be cool to mark out all the nr 1 in the beet with green and the rest orange.
like

1 2 3 4 1 2 3 4
g o o o g o o o

realy helpfull when programming drums.

/
jetdv wrote on 9/29/2005, 7:17 AM
Ok, here's a GOOOGOOOGOOO version:


/**
* Program: MeasureMarkers.js
* Description: This script will set markers at measure boundaries
* Author: Johnny (Roy) Rofrano jrofrano at vasst.com
* Date: September 26, 2005
*
**/

import System.Windows.Forms;
import Sony.Vegas;

var maxMeasures : int = 10;

try
{
// always save anything we intent to change
var savedRulerFormat : RulerFormat = Vegas.Project.Ruler.Format;
// set the ruler format to measures and beats
Vegas.Project.Ruler.Format = RulerFormat.MeasuresAndBeats;
var count : int = 0;
for(var i : int = 1; i <= maxMeasures; i++)
{
for(var j : int = 1; j <= 4; j++)
{
var position : String = String.Format("{0}.{1}.000", i, j);
if (j == 1)
{
var Rmeasure : Region = new Region(new Timecode(position), new Timecode("0.0.001"), position);
try
{
Vegas.Project.Regions.Add(Rmeasure);
Rmeasure.Length = new Timecode(0);
count++;
}
catch(err)
{
MessageBox.Show("Region already exists at: " + position);
}
}
else
{
var measure : Marker = new Marker(new Timecode(position), position);
try
{
Vegas.Project.Markers.Add(measure);
count++;
}
catch(err)
{
MessageBox.Show("Marker already exists at: " + position);
}
}
}
}

// restore project ruler format to what it was
Vegas.Project.Ruler.Format = savedRulerFormat;
// give feedback
MessageBox.Show(count + " measure markers added.");
}
catch (e)
{
MessageBox.Show(e);
}
mangooo wrote on 9/29/2005, 11:27 PM
Yeah !!!!! :) :) This is so so so good.

Big thanks master jetdv and master JohnnyRoy.

U helped me alot

Peace

/M