Old 09-03-2012, 09:10 AM   #1
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,497
Default Script Request Sticky?

Is it possible to make a "sticky thread" to make scripting requests from the scripting guys like Viente and Tim?

I see them doing a lot of that, quickly making new scripts to solve various issues, but all that stuff is kinda scattered all over the forum. It might be nice to go to one place and say...

"Hey! Can anyone create a quick script to _________?"

And have the scripts attached and listed there in one thread along with discussions about how they work.

I for one haven't devled into ReaScript much. The language doesn't look all that difficult for me having done Javascript and similar, but I assume to some others with no coding background at all it kinda looks like Greek.

Thanks.
Lawrence is offline   Reply With Quote
Old 09-03-2012, 09:16 AM   #2
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default

I would like to share. Though i'm a complete noob in ReaScript i have a bunch of usefull scripts people may like (Thanks to Tim, gofer and IXix)
Viente is offline   Reply With Quote
Old 09-14-2012, 12:47 PM   #3
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default quantisation of parameter automation values

Hey! Can anyone create a quick script to quantise parameter automation values?

I'm interested in both quantisation on the time scale (e.g. values should be shifted towards the nearest 16th note grid line, while preventing multiple values on the same position on the timeline) and/or on the value range (e.g. for a parameter that affects tuning with a range of -12 to 12 semi-tones, it should be able to divide the 0.0-1.0 range in 25 steps, i.e. 0.00, 0.04, 0.08, 0.12, ... 0.96, 1.00).
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
Banned is offline   Reply With Quote
Old 09-17-2012, 11:17 PM   #4
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default

Select all items with same colors and solo their tracks

https://stash.reaper.fm/v/14022/Selec...ame%20color.py

Viente is offline   Reply With Quote
Old 09-24-2012, 12:44 PM   #5
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,452
Default

I see there is GetCursorContext command.
Can anyone make a script that opens toolbar at each condition?
Sexan is offline   Reply With Quote
Old 09-24-2012, 12:58 PM   #6
gwok
Human being with feelings
 
gwok's Avatar
 
Join Date: Jun 2010
Location: Nelson, BC
Posts: 3,313
Default

I could really use "set selected items to one random custom color per track"
__________________
MacPro Xeon, 10.9.5
Reaper 5
gwok is offline   Reply With Quote
Old 10-27-2012, 11:36 AM   #7
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default

Awesome! Big ups, Veto! Those definitely looks small and simple enough to wrap my head around, so it looks like a perfect starting point for a bit of hacking. I owe you a beer or two. Or perhaps you prefer a good smoke, if you happen to come by Amsterdam some day.

I hope to have some time this weekend to study them more intensively (I'm currently on a flakey smartphone connection and have older versions of SWS - downloading new one now… slowly - and Python (2.7.2). And I think I should do a proper system backup before messing with that…)
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
Banned is offline   Reply With Quote
Old 10-27-2012, 04:47 PM   #8
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default

Quote:
Originally Posted by Veto View Post
oh Banned wait a sec, before you're downloading hours for nothing, Python 2.7.2 wont work, sorry. There are some methods in the scripts which probably only work with the 3.x versions.

Just ask if you need help in any way about the scripts. And if you're like me, prefering a quantize dialog, be sure to check out that new script.

haha thanks i'm not such a big fan of both, but i'd love to see Amsterdam some day and when one happens to be in Amsterdam...
Let me know whenever you happen to be in the neighbourhood.

Yeah, I already had Python 2.7.2 installed (came with OS 10.8), but figured it might not work (and it didn't), so I grabbed the 3.2.3 version. But I couldn't get REAPER to work with it at first. In Preferences > ReaScript > Force Python to use dylib; I had entered
Code:
/Library/Frameworks/Python.framework/Versions/3.2/lib/libpython3.2.dylib
but REAPER told me its an incompatible version.

When I clicked the .dylib path button, the location of Python 2.x showed up - so I figured the description of Preferences > ReaScript > Custom path to dll directory must be wrong: on a Mac, there are typically no .dll files, so I started reading "dll" as ".dylib" instead. Then I removed the line from "Force Python to use dylib", and entered the path:
Code:
/Library/Frameworks/Python.framework/Versions/3.2/lib/
in the "Custom path to dll directory". Yay, REAPER now tells me: libpython3.2.dylib installed. (I have no idea why the first didn't work, but the second did. I tried this in both 32 and 64 bit versions of REAPER, with the same results. Perhaps this should be filed as a bug?)

However, I still get the same script execution error as before, it seems to fail to import the python functions from the SWS extension:

Code:
Traceback (most recent call last):
  File "Quantize selected points.py", line 7, in <module>
    from sws_python import *
ImportError: No module named sws_python
I do have SWS/S&M Extension 2.3.0 Build #7 installed now, btw. Perhaps I need a system reboot or such? I'll have another go at it tomorrow for sure. Also, staring at the code until it makes enough sense is already *very* useful for me at this point.
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
Banned is offline   Reply With Quote
Old 10-28-2012, 05:19 AM   #9
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default

Quote:
Originally Posted by Veto View Post
i'm sorry, i really wish i would actually know more than nothing about ReaScript on OS
I hope that some of the mac folks here can advise you with their experience.

Do you find a "sws_python.py" module in programs/REAPER/plugins (? for Mac).
Did you had the SWS module working with 2.7.2 ? If so, it would be no hassle to write the scripts to work with that version if thats okay.
Just out of interest, when Reaper says the py-lib is installed, does f.e.
PHP Code:
from reaper_python import *
RPR_APITest() 
gives you success?

Nevertheless i really think this qualifies as a bug on both sides, Reaper and SWS.
No, I had the same error when REAPER was using Python 2.7.2.

On my system that file is located here:
Code:
~/Library/Application Support/REAPER/Scripts/sws_python.py
There is a folder named "Plugins" only at:
Code:
/Applications/REAPER.app/Contents/Plugins
(But I don't think I'm supposed to mess with the contents of the app bundle, even though that might work as a workaround.)

A Test.py script containing just the lines you pasted works fine: "test ok".

No worries, I'm sure one of the Mac users will chime in at some point, and I'm not in a hurry. Thanks again for your help anyway, much appreciated.
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
Banned is offline   Reply With Quote
Old 05-14-2013, 04:21 AM   #10
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Posts: 542
Default Midi script to +2 to program change message - to control jamstix

Hey -

Mod please relocate if needed...

I need a script or JS "script" (do I call it that?) to run on a track that will pass all midi except program change.
When program change message is received at script,
add 2 to the number.

PC0 received
PC2 output to track

I will only need it active on one midi input.
My podXT Live.
I am trying to control Jamstix "liveloop"
My podxt live abcd buttons
are pc0, pc1,pc2, pc3.
In jamstix pc0 does nothing, pc1 is usually the intro.
This leaves only two left in front of me.
If I add 2 to the pc message that will give me four patterns to play with without banking.
I can do this with an autohotkey script, but want something that will work within reaper instead and not need virtual midi ports to do it.

Thanks much!
__________________
KeyMce/GenMce - pc keyboard/midi to Mackie control emulation (built with ahk). Also - an ahk script to build your own midi programs.

Last edited by flipotto; 05-14-2013 at 01:03 PM. Reason: Change to include JS plugin "script"???? Can someone help me?
flipotto is online now   Reply With Quote
Old 05-14-2013, 11:31 AM   #11
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

Isn't that more of a JS request? I'm not sure a script can monitor, rather it can only be executed.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 05-14-2013, 08:47 PM   #12
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 1,648
Default separate copy and paste item values

being a complete noob to reascript, i could use two VERY simple example scripts to start to see how things work.

1. copy an item's (not take) volume

2. paste that value to selected items.

i see this as a two action process, selecting one item to copy, then, after
copying its volume, selecting some other items and applying the copied volume to them.

would be really helpful to me to see how this works. then i could adapt it to do other things.

thanks,
BabaG
babag is offline   Reply With Quote
Old 06-01-2013, 03:56 AM   #13
harmonicaman
Human being with feelings
 
harmonicaman's Avatar
 
Join Date: Oct 2011
Posts: 134
Default

This thread is awesome !
Is it possible with a script to move up and down (and create points with it), to a given value, an automation segment of a time selection lenght, without selecting the envelope in the track, or even showing it ?
I dont know if I'm clear, so a simple example : whole track has no pan envelope, it's panned by default to the middle. I make a track selection, I press a key shorcut and it's pan the segment to like 75% left (I could make copies of the scripts with differents values, hard left, middle, 30% right, etc)
Well in fact I thought mostly using it for panning . It would be great, and like wonderful to be able to do it without selecting a track, the script running to the track under the mouse when you press a shortcut.
Maybe other would prefer it to be applied to the lenght of selected item(s) or item under the mouse.

Edit: problem solved with a new set of actions added to select envelopes

Last edited by harmonicaman; 06-17-2013 at 09:31 AM.
harmonicaman is offline   Reply With Quote
Old 06-26-2013, 02:47 PM   #14
WyattRice
Human being with feelings
 
WyattRice's Avatar
 
Join Date: Sep 2009
Location: Virginia
Posts: 1,909
Default

Hi Reascripters,
I have a request if at all possible.

I know we have an action " Track: Select track under mouse"

Would it be possible to select a track at what track the mouse cursor is at in the arrange area, instead of underneath?

From the reasript api we have:
GetCursorPositionEx(ReaProject* proj)
SetTrackSelected(MediaTrack* track, bool selected)

Thanks, Wyatt
WyattRice is offline   Reply With Quote
Old 06-04-2014, 10:10 PM   #15
nymusicman
Human being with feelings
 
Join Date: Jun 2014
Posts: 6
Default

I need a script (unless there is another way to do it) that creates a marker every 3 minutes until the end of a file.

Thanks!
nymusicman is offline   Reply With Quote
Old 06-05-2014, 04:20 AM   #16
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,137
Default

Quote:
Originally Posted by nymusicman View Post
I need a script (unless there is another way to do it) that creates a marker every 3 minutes until the end of a file.

Thanks!
Not sure if you want to create marker over selected items or whole project but here's the EEL script that does the whole project:
Code:
function GetEndOfProject (markers, regions)
(
	projEnd = 0;

	i = 0;
	loop (GetNumTracks(),

		track   = GetTrack(0, i);
		item    = GetTrackMediaItem(track, GetTrackNumMediaItems(track) - 1);

		itemEnd = GetMediaItemInfo_Value(item, "D_POSITION") + GetMediaItemInfo_Value(item, "D_LENGTH");
		(itemEnd > projEnd) ? projEnd = itemEnd;
		i += 1;
	);

	(markers || regions) ?
	(
		i = 0;
		while (i = EnumProjectMarkers(i, region, start, end, 0, 0))
		(
			(regions) ? (region && end > projEnd)    ? projEnd = end;
			(markers) ? (!region && start > projEnd) ? projEnd = start;
		);
	);

	projEnd;
);


projectEnd = GetEndOfProject(0, 1);
markerPos  = 0;
while (markerPos <= projectEnd)
(
	AddProjectMarker(0, 0, markerPos, 0, "", -1);
	markerPos += 60*3;
);
Breeder is offline   Reply With Quote
Old 06-05-2014, 04:09 PM   #17
nymusicman
Human being with feelings
 
Join Date: Jun 2014
Posts: 6
Default

Thank you so very much. It's exactly what I need and I really appreciate it.
nymusicman is offline   Reply With Quote
Old 06-08-2014, 09:34 AM   #18
nymusicman
Human being with feelings
 
Join Date: Jun 2014
Posts: 6
Default

Is there a reason why an .eel script would be greyed out on a mac?
nymusicman is offline   Reply With Quote
Old 06-08-2014, 11:26 AM   #19
nymusicman
Human being with feelings
 
Join Date: Jun 2014
Posts: 6
Default

Quote:
Originally Posted by nymusicman View Post
Is there a reason why an .eel script would be greyed out on a mac?
Nevermind, just needed to use a real text editor that didn't add extensions to my files.

Thanks again for your help!
nymusicman is offline   Reply With Quote
Old 10-20-2014, 11:27 AM   #20
playitbackwards
Human being with feelings
 
Join Date: Sep 2012
Location: Brooklyn
Posts: 1
Default Record on Transient Detection

Hi, I'm a long time lurker. Just now finding out about the power of ReaScript and I am amazed and excited about the possibilities. The script I'd like to write functions like this:

If an armed track receives audio input over a specified threshold(e.g. -12.0 Db), it records a clip for a specified time (e.g. 5 minutes) BONUS have the clip preroll for 10 seconds.

Is this too complicated for a newbie? Is this already implemented in the actions list? Is there any threads you can suggest I look at to get a better idea of how this would work?
Thanks so much for your time.
playitbackwards is offline   Reply With Quote
Old 10-21-2014, 07:29 AM   #21
Oldguy
Human being with feelings
 
Join Date: Oct 2014
Posts: 2
Default

I would like a script (or plug-in, if somebody knows of something that can already do this) that does the following:

For each MIDI note received, compare the pitch with the previous note. If the interval is below a user-specified threshold (in semitones), pass it on.

If the interval is above the threshold, wait a user-specified amount of time (range about 1 to 100 milliseconds). If no new note is received within the time limit, pass the note on. If a new note is received within the time limit, discard the note that's "paused", and pass on the new note.

Background information: Using the Akai EWI wind controller, you change octaves by using a series of thumb rollers. When you play across the octave, if your thumb roll is not precisely co-ordinated with your note fingering, you get a very obvious and objectionable "blip" - a little grace note that's an octave above or below the intended note.

Can anybody help with this?
Oldguy is offline   Reply With Quote
Old 10-21-2014, 09:56 AM   #22
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Quote:
Originally Posted by playitbackwards View Post
Hi, I'm a long time lurker. Just now finding out about the power of ReaScript and I am amazed and excited about the possibilities. The script I'd like to write functions like this:

If an armed track receives audio input over a specified threshold(e.g. -12.0 Db), it records a clip for a specified time (e.g. 5 minutes) BONUS have the clip preroll for 10 seconds.

Is this too complicated for a newbie? Is this already implemented in the actions list? Is there any threads you can suggest I look at to get a better idea of how this would work?
Thanks so much for your time.
Hi,
We can't manipulate/get the audio stream with ReaScript Python/EEL - I'm afraid that this is not possible.

...If an armed track receives audio input over a specified threshold(e.g. -12.0 Db)...
This part is possible with JSFX, but I'm not sure if JSFX is capable to trigger actions from the action list (the script could for example trigger the action - Transport: Record when input > -12dB etc.).

There's this little "gap" between ReaScript and JSFX




Quote:
Originally Posted by Oldguy View Post
I would like a script (or plug-in, if somebody knows of something that can already do this) that does the following:

For each MIDI note received, compare the pitch with the previous note. If the interval is below a user-specified threshold (in semitones), pass it on.

If the interval is above the threshold, wait a user-specified amount of time (range about 1 to 100 milliseconds). If no new note is received within the time limit, pass the note on. If a new note is received within the time limit, discard the note that's "paused", and pass on the new note.

Background information: Using the Akai EWI wind controller, you change octaves by using a series of thumb rollers. When you play across the octave, if your thumb roll is not precisely co-ordinated with your note fingering, you get a very obvious and objectionable "blip" - a little grace note that's an octave above or below the intended note.

Can anybody help with this?
This should be possible with JSFX (I don't know much about JSFX, but there are many people in this forum who might know how to make this JSFX).
spk77 is offline   Reply With Quote
Old 10-21-2014, 12:40 PM   #23
Oldguy
Human being with feelings
 
Join Date: Oct 2014
Posts: 2
Default

I hope so.

Actually, since posting this, I've thought of lots of circumstances where doing this would actually make matters worse: If your intention was to play a D in the second octave followed by a G in the first octave and your thumb roll was late, then the "blip" note would only be five semitones away from the D, whereas the low G that you intended to play would be a whole octave away from the blip note, so the blip note would actually get held and be even more obvious.

Nevertheless, if somebody would be willing to help make this, I'd still like to try it.
Oldguy is offline   Reply With Quote
Old 10-30-2014, 12:44 PM   #24
tbdroye
Human being with feelings
 
Join Date: Mar 2012
Posts: 10
Default LOSER/Exciter

Hello there,

I'm wondering if it would be possible to add a low-pass filter to the "LOSER/Exciter" plug in. Ideally, the LPF would go immediately after the HPF (before the harmonics are added). This would allow a little bit more control of the harmonics that are synthesized. How difficult would this be to do?

Thank you so much!
tbdroye is offline   Reply With Quote
Old 11-27-2014, 09:07 AM   #25
kuus0
Human being with feelings
 
Join Date: Feb 2011
Posts: 159
Default Filled polygons for JS

It would be great if anyone had fast routines for these.

Just triangles is OK, quads even better. Arbitrary polygons would of course be great
kuus0 is offline   Reply With Quote
Old 11-27-2014, 10:37 AM   #26
mete0r
Human being with feelings
 
Join Date: Jul 2013
Posts: 115
Default

I wonder if it's possible to make a script that pastes envelopes always like the first time and not the second time:



It should probably do something like:

1. add an envelope point immediately after the cursor, equal to the value of the envelope at the cursor, if there isn't already an eenvelope point at the cursor
2. copy all the other points immediately afterwards

If noone can help I'm going to try to learn reascript and do it
mete0r is offline   Reply With Quote
Old 11-27-2014, 11:02 AM   #27
kuus0
Human being with feelings
 
Join Date: Feb 2011
Posts: 159
Default

Quote:
Originally Posted by mete0r View Post
I wonder if it's possible to make a script that pastes envelopes always like the first time and not the second time:



It should probably do something like:

1. add an envelope point immediately after the cursor, equal to the value of the envelope at the cursor, if there isn't already an eenvelope point at the cursor
2. copy all the other points immediately afterwards

If noone can help I'm going to try to learn reascript and do it
Looks like a bug to me. I would post it on the Bug Report forum:

http://forum.cockos.com/forumdisplay.php?f=22
kuus0 is offline   Reply With Quote
Old 11-27-2014, 11:21 AM   #28
mete0r
Human being with feelings
 
Join Date: Jul 2013
Posts: 115
Default

Thank you, I posted a bug report.
mete0r is offline   Reply With Quote
Old 05-10-2015, 08:26 PM   #29
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 1,931
Default REQ: archive track

Hey guys,

There's a part of my workflow that I think could be condensed into a single script.
Would someone have time to whip this up in EEL, please?


Duplicate track(s)
Add "UNTUNED - " to track name
Set track volume to -inf
Remove all track FX
Remove all track sends
Offline all item FX
Offline all items
Move track(s) to end of project
Hide track(s)
on original track(s): Select all items, then glue items

(Since I will run this from a toolbar button, the last action should be 41682 (close toolbar) )


Thank you so much!
And remember, I'm happy to offer some of my time in return.

Cheers!
Dax.
__________________
Dax Liniere
London's newest premium studio complex! (Facebook)
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GT710, UAD2-OCTO, FireFaceUFX, REAPER x64]

Last edited by daxliniere; 05-10-2015 at 08:35 PM.
daxliniere is offline   Reply With Quote
Old 05-11-2015, 05:14 AM   #30
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Quote:
Originally Posted by daxliniere View Post
Hey guys,

There's a part of my workflow that I think could be condensed into a single script.
Would someone have time to whip this up in EEL, please?


Duplicate track(s)
Add "UNTUNED - " to track name
Set track volume to -inf
Remove all track FX
Remove all track sends
Offline all item FX
Offline all items
Move track(s) to end of project
Hide track(s)
on original track(s): Select all items, then glue items

(Since I will run this from a toolbar button, the last action should be 41682 (close toolbar) )


Thank you so much!
And remember, I'm happy to offer some of my time in return.

Cheers!
Dax.
I hope this works:

Download from the stash...
https://stash.reaper.fm/24076/Dax%20-...e%20tracks.eel

...or copy this:
Code:
// http://forum.cockos.com/showthread.php?p=1520042 (double click the link to go to the thread)

duplicate_tracks = 40062;
cut_tracks = 40337;
paste_tracks = 40058;
set_first_sel_tr_to_last_touched = 40914;
//remove_track_fxs = "_S&M_REMOVE_FX";
remove_sends = "_S&M_SENDS6";

sel_items_on_tracks = 40421;
set_take_fxs_offline = "_S&M_TAKEFX_OFFLINE";
set_media_offline = 40440;

hide_tracks = 41593;
unselect_all = 40769;
glue = 41588;
close_toolbar4 = 41682; 

tr_id_array = 10000;
tr_id_array_len = 0;

function collect_tracks() local(i, tr)
(
  i = 0;
  loop(CountSelectedTracks(),
    (tr = GetSelectedTrack(0, i)) ? (
      tr_id_array[i] = tr;
      tr_id_array_len += 1;
    );
    i += 1;
  );
  tr_id_array_len;
);

 
function duplicate() local(tr, i)
(
  collect_tracks() ? (
    Undo_BeginBlock2(0);
    CountSelectedTracks() ? (
      PreventUIRefresh(1);
      Main_OnCommandEx(duplicate_tracks, 0, 0);
      Main_OnCommandEx(cut_tracks, 0, 0);
      tr = GetTrack(0, CountTracks(0)-1);
      SetOnlyTrackSelected(tr);
      Main_OnCommandEx(set_first_sel_tr_to_last_touched, 0, 0);
      Main_OnCommandEx(paste_tracks, 0, 0);
      Main_OnCommandEx(NamedCommandLookup("_S&M_SENDS6"), 0, 0);
  
      i = 0;
      loop(CountSelectedTracks(),
        (tr = GetSelectedTrack(0, i)) ? (
          #new_name = "UNTUNED - ";
          GetSetMediaTrackInfo_String(tr, "P_NAME", #tr_name, 0);
          #new_name += #tr_name;
          GetSetMediaTrackInfo_String(tr, "P_NAME", #new_name, 1);
          SetMediaTrackInfo_Value(tr, "D_VOL", 0.0);
          loop(TrackFX_GetCount(tr),
            Main_OnCommandEx(NamedCommandLookup("_S&M_REMOVE_FX"), 0, 0);
          );
        );
        i += 1;
      );
      
      Main_OnCommandEx(sel_items_on_tracks, 0, 0);
      Main_OnCommandEx(NamedCommandLookup(set_take_fxs_offline), 0, 0);
      Main_OnCommandEx(set_media_offline, 0, 0);
      Main_OnCommandEx(hide_tracks, 0, 0);
 
      Main_OnCommandEx(unselect_all, 0, 0);
      
      // Original tracks:
      i = 0;
      loop(tr_id_array_len,
        SetTrackSelected(tr_id_array[i], 1);
        i += 1;
      );
      Main_OnCommandEx(sel_items_on_tracks, 0, 0);
      Main_OnCommandEx(glue, 0, 0);
      Main_OnCommandEx(close_toolbar4, 0, 0);

      PreventUIRefresh(-1);
    );
    Undo_EndBlock2(0, "Dax - custom duplicate", -1);
  ) : ShowConsoleMsg("Please selected tracks first");
);

defer("duplicate()"); // don't add an undo point if 0 tracks selected

Last edited by spk77; 05-11-2015 at 05:40 AM. Reason: global variables to local
spk77 is offline   Reply With Quote
Old 05-11-2015, 05:24 AM   #31
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,412
Default

it looks great spk77
Maybe we could put all the tracks inside a folder instead of being always at the end, so you could put the folder collapsed anywhere you want, and the script should find the folder track by the name, for example "UNTUNED tracks" and then move the tracks to that folder. Just an idea.
heda is offline   Reply With Quote
Old 05-11-2015, 05:33 AM   #32
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Quote:
Originally Posted by heda View Post
it looks great spk77
Maybe we could put all the tracks inside a folder instead of being always at the end, so you could put the folder collapsed anywhere you want, and the script should find the folder track by the name, for example "UNTUNED tracks" and then move the tracks to that folder. Just an idea.
Nice idea!
spk77 is offline   Reply With Quote
Old 05-11-2015, 06:03 AM   #33
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Two things I noticed while making the "duplicate script":
  • Track routing is not preserved when cut/pasting tracks - that's why there's "SWS: Cut selected tracks (with routing)"
  • It's a nice day outside.
spk77 is offline   Reply With Quote
Old 05-13-2015, 07:07 PM   #34
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 1,931
Default

Quote:
Originally Posted by spk77 View Post
I hope this works:
Download from the stash...
Thankyou spk77, that's really awesome. Thanks for your time and expertise!!

All the best,
Dax.
__________________
Dax Liniere
London's newest premium studio complex! (Facebook)
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GT710, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 05-16-2015, 03:04 AM   #35
syntetic
Human being with feelings
 
syntetic's Avatar
 
Join Date: May 2014
Posts: 160
Default

another noob question from me:
how can i convert value for examle 1.023756 to float;
i use match("%f", #stringname, newfloat) but i get 1.024 only.
I tried to automate rate by plugin but I hear crackles,probably because I can't change rate to small values.

Last edited by syntetic; 05-16-2015 at 04:13 AM.
syntetic is offline   Reply With Quote
Old 05-16-2015, 04:14 AM   #36
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,514
Default

Quote:
Originally Posted by syntetic View Post
another noob question from me:
how can i convert value for examle 1.023756 to float;
i tried to use match("%f", #stringname, newfloat) but i get 1.024 only.

EDIT: Tested - didn't work.

Didn't test, but this should work:

Code:
#stringname = "1.023756";

match("%0.10f", #stringname, newfloat); // show 10 digits after decimal point

Last edited by spk77; 05-16-2015 at 04:28 AM.
spk77 is offline   Reply With Quote
Old 05-16-2015, 04:17 AM   #37
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,412
Default

Quote:
Originally Posted by syntetic View Post
I tried to automate rate by plugin but I hear crackles,probably because I can't change rate to small values.
Are you trying to automate the rate while playing an item? Or just at the beginning of the item as a more convenient way to change the rate of the items?
heda is offline   Reply With Quote
Old 09-06-2015, 10:08 AM   #38
khelra
Human being with feelings
 
Join Date: Sep 2015
Posts: 3
Default Batch Process Files?

Hey all,

I'm really new to both Reaper (and programming), my knowledge consists of how to use my plug-ins and how to say Hello World in three languages...not the most useful.

I'm looking for a way to batch process VO files the following way:

* Take a file in "Folder 1" and add it to a track
* Add a short file from "Folder 2" before it
* Add a short file from "Folder 3" after it
* Use a specific plug-in on all of it for an effect
* Export the new file to "Folder 4" with the same name as the file in "Folder 1"


Is any of this possible in Lua and Reaper? I know that is probably a stupid question to ask what the constraints of programming are...I just feel like if I can see it done (or be pointed in the direction) than I could learn to understand what I'm seeing in Lua...C++ is a little too much to expect to understand any time soon.
khelra is offline   Reply With Quote
Old 09-10-2015, 10:06 PM   #39
Edufighter
Human being with feelings
 
Join Date: Feb 2012
Location: Canada
Posts: 35
Default Importing files in a track and snap them to regions

Hi,
I am wondering if it's possible to read a folder with, let's say 30 files, import them all in a single track and snap those files to regions that have the same filename (the session has those regions previously created with other script a friend did for me).
e.g.
1) I have a session with 30 regions called: "file01" "file 02" "file03"...etc.
2) I run a script and I point the script to read a folder containing files called "file01.wav" "file02.wav" file03.wav" etc.
3) all the files in the folder get imported to the same track in Reaper and the left border of each file is snap to the beginning of the region with the same name.
4) files with names different from existing region names could be either discarded or sent to the end of the project.
Edufighter is offline   Reply With Quote
Old 09-10-2015, 11:31 PM   #40
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,032
Default

@khelra, @Edufighter
This is surely possible in some ways but these are very specific requests, maybe too specific for investing all time required to code them (at least for me)...
Are you ready to learn Lua coding ?
All required functions are avaible in the API or here.

Last edited by X-Raym; 09-10-2015 at 11:41 PM.
X-Raym is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.