Quote:
Originally Posted by Pinknoise
It's not exactly what you are looking for but in that post:
https://forum.cockos.com/showthread.php?t=219267
The last macro posted has a series of action that I think would be similar to what you are trying to accomplish. You might want to check it out and edit to your liking.
|
Thank you, that was a good inspiration. For those, who are considering doing something similar, I gutted spk77 script from this comment:
https://forum.cockos.com/showthread.php?t=143902
The result looks like this:
Code:
// Add set points to take volume envelope
#new_chunk_header = "<TRACK_ENVELOPE_UNKNOWN
ACT 1
VIS 1 1 1
LANEHEIGHT 0 0
ARM 0
DEFSHAPE 0 -1 -1
";
#new_chunk_points = "";
#new_chunk_tail = ">
";
function get_set_envelope(take, envelope_name) local(env)
(
// if take's "take volume envelope" doesn't exist:
(env = GetTakeEnvelopeByName(take, envelope_name) == 0) ? (
envelope_name == "Volume" ? Main_OnCommand(NamedCommandLookup("_S&M_TAKEENV1"), 0); // show take volume envelope
);
// now it should exist -> get take's "take envelope pointer":
(env = GetTakeEnvelopeByName(take, envelope_name)) ? (
GetSetEnvelopeState(env, #new_chunk);
);
);
function generate_point_lines(take) local(i)
(
#new_chunk_points += "PT 2.2 1.000000 0\n";
#new_chunk_points += "PT 3.0 0.2500000 0\n";
);
function join_lines()
(
#new_chunk += #new_chunk_header;
#new_chunk += #new_chunk_points;
#new_chunk += #new_chunk_tail;
//msg_s(#new_chunk);
);
function main()
(
(take = GetActiveTake(GetSelectedMediaItem(0, 0))) ? (
generate_point_lines();
join_lines();
get_set_envelope(take, "Volume");
);
main();
You can set your own points in generate_point_lines() where the format is
Code:
PT time-in-seconds loudness