Old 03-30-2016, 01:25 AM   #1321
BogdanS
Human being with feelings
 
Join Date: Aug 2013
Location: Ukraine
Posts: 36
Default

[QUOTE=X-Raym;1660873]@BogdanS
You are right

modifications for renaming:
-add numbers sequence (0x/00x/000x etc)
-change Case
-insert/replace text (prefix/suffix)
-add wildcard
Attached Images
File Type: jpg before.jpg (48.4 KB, 190 views)
File Type: jpg after.jpg (42.2 KB, 154 views)
BogdanS is offline   Reply With Quote
Old 04-01-2016, 09:47 AM   #1322
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@BogdanS
You can create text items from regions first by using my script Create text items on first selected track from regions
Scripts (LUA): Create Text Items Actions (various) - Cockos Confederated Forums

and you will be able to use my X-Raym_Add text to selected items notes (Items Notes Processor).lua and X-Raym_Search and replace in selected items notes.lua
Scripts (LUA): Text Items Formatting Actions (various) - Cockos Confederated Forums

You can also then consider using Heda's region manager from text item EEL script: Show/Hide Markers using Track's empty items with notes - Cockos Confederated Forums

Tell me if this works for you !
X-Raym is offline   Reply With Quote
Old 04-01-2016, 12:50 PM   #1323
BogdanS
Human being with feelings
 
Join Date: Aug 2013
Location: Ukraine
Posts: 36
Default

[QUOTE=X-Raym;1662331]
Thank you! Its work. But it is not enough add automatic numbering to notes.
BogdanS is offline   Reply With Quote
Old 04-01-2016, 01:39 PM   #1324
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@BogdanS
Cool !
I put some wildcard for naming according to item in selection, I think the wildcard is /E in one of these two scripts.
But it is only in X format not 0X or 00X.

Do you absolutely need 0X format ?

I simple mod could be made it is necessary.
X-Raym is offline   Reply With Quote
Old 04-05-2016, 12:21 AM   #1325
BogdanS
Human being with feelings
 
Join Date: Aug 2013
Location: Ukraine
Posts: 36
Default

Thank you, may simply X format
BogdanS is offline   Reply With Quote
Old 04-11-2016, 02:01 AM   #1326
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 416
Default

Script request :

Collapse all folders except the selected folder or child track.

This script should work in background and collape all folders except the focused one to have more space in arrange and mixer view.

I hope it is not complicated for script gurus.
Regards.
mehmethan is offline   Reply With Quote
Old 04-11-2016, 06:01 AM   #1327
Mottemania
Human being with feelings
 
Join Date: Apr 2016
Posts: 80
Default Request for Selection Script

Heyho,

I am almost brandnew to this whole reaperworld, migrating from cubase 8. At this point I try to make the shortcuts and functions I am use to from cubase to work in reaper. so far so good. and now comes the hard part.
in cubase is a shortcut p, where it makes the loop selection wether from the general selection or the itemborders.
this is actual not working in reaper.
in fact the script should be like "if no item is selected take the selection to the loop selection, if an item is selection use the item to loop selection". u know what i mean? so, the mindthing is done, but my programerskills are 10 years old and from turbopascal and delphi ... :/

is there anyone who could script this for me? maybe this simple script gives me a good starting point for my own scripts (well, we'll see ...)

would be really great.

sry, for my school english @.@

greets motte
Mottemania is offline   Reply With Quote
Old 04-11-2016, 06:48 AM   #1328
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@Mottemania
Did you try the native action Time selection: Set time selection to item borders ?
this is what I mapped to P when I switched from Cubase.
X-Raym is offline   Reply With Quote
Old 04-11-2016, 06:51 AM   #1329
Mottemania
Human being with feelings
 
Join Date: Apr 2016
Posts: 80
Default

Quote:
Originally Posted by Mottemania View Post
Heyho,

I am almost brandnew to this whole reaperworld, migrating from cubase 8. At this point I try to make the shortcuts and functions I am use to from cubase to work in reaper. so far so good. and now comes the hard part.
in cubase is a shortcut p, where it makes the loop selection wether from the general selection or the itemborders.
this is actual not working in reaper.
in fact the script should be like "if no item is selected take the selection to the loop selection, if an item is selection use the item to loop selection". u know what i mean? so, the mindthing is done, but my programerskills are 10 years old and from turbopascal and delphi ... :/

is there anyone who could script this for me? maybe this simple script gives me a good starting point for my own scripts (well, we'll see ...)

would be really great.

sry, for my school english @.@

greets motte
Quote:
Originally Posted by X-Raym View Post
@Mottemania
Did you try the native action Time selection: Set time selection to item borders ?
this is what I mapped to P when I switched from Cubase.
totally. but what I need is, that in any case reaper makes a loop out of i. if there is a item selected, then with the item borders and if there is a normal selection, do the loop from there.
Mottemania is offline   Reply With Quote
Old 04-14-2016, 03:43 PM   #1330
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 410
Default Envelope scripts request

Hey Guys,

A couple of scripts I could really use.

1) A script that can select envelope points within current time selection based on a user input value range. So for example if I enter 0.025 in one field
and .050 in another field it would select all points in that range.
It would be nice if it worked on any type of envelope(track, take).

2) A script that can place markers at selected envelope points.
Also would be great if it worked on all envelope types.

The two scripts should be separate.

Ooh.., just thought of one more that would be nice.
A script that can select every nth point within a time selection starting from either the point that the mouse is hovering over or the currently selected point.

If you know where I can already find such scripts or don't mind coding them that would be awesome!

Thank you

Last edited by NextLevel; 04-14-2016 at 03:59 PM.
NextLevel is offline   Reply With Quote
Old 04-15-2016, 04:20 PM   #1331
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,171
Default

Motte? I think maybe if there was no scripts you could use macro:

1.Copy time selection to loop points. (action named wrong )
2.Set loop points to items.

Always does #1...

This one you can edit
--reaper.SetEditCurPos(gcp, false, false)
to
reaper.SetEditCurPos(gcp, false, false)

moves cursor back to where it was rather than to start of item. Like save/restore. Otherwise have to write longer script. It's fast! Who cares? Well, macro fast too.

Code:
-- motte.lua

function Fn_SetLoop()
  csi = reaper.CountSelectedMediaItems(0)
  if csi > 0 then
    gcp = reaper.GetCursorPosition() -- only needed for optional seteditcurpos line
    reaper.Main_OnCommand(41039,0) -- action to set loop to items. this moves cursor.
    --reaper.SetEditCurPos(gcp, false, false) -- remove '--' at start to allow reset edit cursor to position before running script.
  else
    TS_start,TS_end = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false) -- get time selection time values
    reaper.GetSet_LoopTimeRange(true, true, TS_start, TS_end, false) -- set loop points to time selection time values
    --reaper.SetEditCurPos(TS_start, false, false) -- remove '--' at start to move edit cursor to time selection start.
  end
end

reaper.defer(Fn_SetLoop) -- this prevents undo point. is used in other ways too.

Last edited by FnA; 04-15-2016 at 04:34 PM. Reason: made it neater. add option to move to TS if wanted.
FnA is offline   Reply With Quote
Old 04-16-2016, 12:25 AM   #1332
Mottemania
Human being with feelings
 
Join Date: Apr 2016
Posts: 80
Default

That's it. Thanks man, you kinda saved my workflow
Mottemania is offline   Reply With Quote
Old 04-16-2016, 05:23 AM   #1333
memyselfandus
Human being with feelings
 
memyselfandus's Avatar
 
Join Date: Oct 2008
Posts: 1,598
Default

Great thread!
memyselfandus is offline   Reply With Quote
Old 04-17-2016, 04:16 AM   #1334
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 530
Default

Quote:
Originally Posted by heda View Post
here is a lua script I've made that removes all bypassed FX
you need REAPER 5 and SWS extensions installed.
https://stash.reaper.fm/26131/HeDa_RemoveBypassedFX.lua
Just found this today ;-) Very cool for cleaning before archiving or to speed launching project.
Thank you Heda.
Sumalc is offline   Reply With Quote
Old 04-17-2016, 10:40 AM   #1335
aspiringSynthesisingAlch
Human being with feelings
 
Join Date: Feb 2014
Posts: 277
Default JSFX, Reaper5, deprecation, SWS & x64

I've just found this thread, and wondered if everything still works, and whether any/much of this is in SWS...

I seee a lot of .pythons as well as .eels, will these work out of the box, or do you need Python setup on your comp?

Also, I remember trying some stash presets that referenced some jsfx (I think) that weren't in reaper5, but were in reaper4... I'm wondering if there's a good reason (deprecation, better way of doing it these days...), and if it's possible just to copy any reaper4 JSFX (or maybe it's an architecture thing, ie some plugins aren't packaged with the x64 edition)...


UPDATE:
I just did a quick compare of file contents in effects folders... on an old reaper4 build vs latest reaper =

236 v 216




Sorry if this is off-topic

Last edited by aspiringSynthesisingAlch; 04-17-2016 at 10:46 AM.
aspiringSynthesisingAlch is offline   Reply With Quote
Old 04-17-2016, 11:09 AM   #1336
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

Only .py files need Python to be installed. EEL and Lua scripts work out of the box (REAPER v5+ is needed for Lua, and some scripts may require SWS).

And yes, if you'd like to keep using some of the old JS effects from v4, you can just copy them over to your new v5 installation.

Last edited by cfillion; 04-17-2016 at 12:15 PM.
cfillion is offline   Reply With Quote
Old 04-17-2016, 11:33 AM   #1337
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,171
Default

For now it's a one shot action. I don't see any means of dealing with mixer folder button, so it's only for TCP.

Better script here. Post five:

https://forum.cockos.com/showthread.php?t=200940

Last edited by FnA; 12-24-2017 at 03:44 PM.
FnA is offline   Reply With Quote
Old 04-17-2016, 12:06 PM   #1338
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 416
Default

Quote:
Originally Posted by FnA View Post
For now it's a one shot action. I don't see any means of dealing with mixer folder button, so it's only for TCP.

Code:
-- crunch all folders but selected.lua

function Fn_Crunch()
  reaper.Undo_BeginBlock2(0)
  reaper.PreventUIRefresh(1)
  local t_f = {}
  local t_f_tf = {}
  local dc = 0
  local ct = reaper.CountTracks(0)
  for i=1,ct do
    local trk = reaper.GetTrack(0, i-1)
    local d = reaper.GetMediaTrackInfo_Value(trk, "I_FOLDERDEPTH")
    if d == 0 then
      if dc > 0 then
        if reaper.IsTrackSelected(trk) == true then
          t_f_tf[#t_f_tf] = true 
        end
      end
    elseif d == 1 then
      table.insert(t_f, trk)
      if reaper.IsTrackSelected(trk) == true then
        table.insert(t_f_tf, true)
      else
        table.insert(t_f_tf, false)
      end
      dc = dc+d
    else
      if reaper.IsTrackSelected(trk) == true then
        t_f_tf[#t_f_tf] = true
      end
      dc = dc+d
    end
  end
  local len = #t_f
  while len > 0 do
    if t_f_tf[len] == true then
      local ft = t_f[len]
      parent = reaper.GetParentTrack(ft)
      if parent then
        local w = 0
        while w < (len-1) do
          trk2 = t_f[len-w]
          if trk2 == parent then
            t_f_tf[len-w] = true
            w = len
          end
          w = w+1
        end
      end
      reaper.SetMediaTrackInfo_Value(ft, "I_FOLDERCOMPACT", 0)
    else
      reaper.SetMediaTrackInfo_Value(t_f[len], "I_FOLDERCOMPACT", 2)
    end
    len = len-1
  end
  reaper.PreventUIRefresh(-1)
  reaper.Undo_EndBlock2(0, "crunch all folders but selected", -1)
end

Fn_Crunch()
Hi thanks for the script. I wonder if it is possible to make it "always work in background" also for MCP. So we don't need any shortcut for the script.
We already can do the same thing of your script with using custom actions,too.

Regards
mehmethan is offline   Reply With Quote
Old 04-17-2016, 12:47 PM   #1339
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,171
Default

I said above that I don't see any means of dealing with the mixer folder button. No actions, no API. It doesn't show up as "hidden" in Track Manager or with IsTrackVisible script function.

The getting and processing of the folder state information is fast. The slowness comes in with the change in graphics. PreventUIRefresh function helps a lot with this. I don't know if it is wise to put it in a repeating deferred script. It should probably have some limits. A counter is one way. Checking undo history is another but might not be applicable. It could check if transport is recording, and not do it then, etc. Maybe someone has some input on that. But if you want to risk it as is, I'll make it run in the background. You can be the guinea pig.

Yes, I know you can do something kind of like this with actions. I've done so myself. Can you do it without changing selection temporarily? We try to avoid that when scripting. I think mainly because it can get ugly when auto rec arm is on.
FnA is offline   Reply With Quote
Old 04-17-2016, 03:14 PM   #1340
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,171
Default

Well, here's a stab at it. Like I said, experimental. May need some additions. Runs main function once every 5 repetitions, and only if changes are needed to "folder buttons." It runs the comparing functions once every 5 regardless, but I think that load is small.

Better script here. Post five:
https://forum.cockos.com/showthread.php?t=200940

Last edited by FnA; 12-24-2017 at 03:45 PM.
FnA is offline   Reply With Quote
Old 04-18-2016, 08:13 PM   #1341
BenK-msx
Human being with feelings
 
BenK-msx's Avatar
 
Join Date: Jun 2008
Location: Whales, UK
Posts: 5,525
Default Undo history scripts?

Hello scripters, I bow before thee.

I am wondering if it is possible to have ourselves something like a per track(s) undo history:

Example: I select drum vsti track that is full of midi, and I tell (script) that I want a seperate undo history for that track, so I can call it and view it at any stage and review or revert ONLY changes I made to this specific track, and/or specific aspects of it -e.g the midi, Without any risk of undoing something any where else.

I think many like me fear going too far back in undo history to try and undo one specific set of things, as the risk of also undoing important good stuff is too high.

This doable?
BenK-msx is offline   Reply With Quote
Old 04-24-2016, 11:55 PM   #1342
tomfrankly
Human being with feelings
 
Join Date: Oct 2012
Posts: 59
Default

I don't have time to search right now, so if this exists already, kindly point me in that direction and I'll be on my way.

I'd like to have an action that will 1) insert a new track above the topmost selected track, and 2) make all selected tracks children of the newly inserted track. Even better would be to have it work based on selected tracks as well as selected media items.

Another action I'd love would be to insert a new track as a child of the currently selected track.

If anyone can help me find or create these, I'd be very grateful.
tomfrankly is offline   Reply With Quote
Old 04-25-2016, 03:09 AM   #1343
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@tomfranky
http://forum.cockos.com/showthread.php?t=158243

:P

For the first feature request, it is a bit more complicated, I don't thibk there is existing solution.
X-Raym is offline   Reply With Quote
Old 04-25-2016, 08:19 PM   #1344
tomfrankly
Human being with feelings
 
Join Date: Oct 2012
Posts: 59
Default

Quote:
Originally Posted by X-Raym View Post
Thank you so much!
tomfrankly is offline   Reply With Quote
Old 04-30-2016, 03:02 AM   #1345
junh1024
Human being with feelings
 
Join Date: Feb 2014
Posts: 124
Default

Hi,

Can someone please make a multichannel (6ch) delay-compensation in a single JSFX with separately adjustable delay-compensation for each channel pair (1&2, 3&4, 5&6)? Delay units should be in samples, I only need up to 1024 samples for each pair.

Thank you :>

NB: I've spent some hours trying to make my own by hacking time_adjustment but most things I do seem to turn to custard due to PDC and reaper's quirky memory management.

Last edited by junh1024; 04-30-2016 at 03:37 AM.
junh1024 is offline   Reply With Quote
Old 05-09-2016, 03:22 AM   #1346
Alex Philipp
Human being with feelings
 
Alex Philipp's Avatar
 
Join Date: Mar 2015
Posts: 33
Default

@X-Raym
Found your script "X-Raym_Convert selected looped items into items and pooled midi.eel"
for making simple copied midi items to pooled (if I understand correctly) but it returns me mistake
__________________________________________________ ___________
Warning: @import could not open '../Functions/X-Raym_Functions - console debug messages.eel'

Error: /Users/AlexPhilipp/Library/Application Support/REAPER/Scripts/X-Raym_Convert selected looped items into items and pooled midi.eel:18: 'msg_clean' undefined: 'msg_clean()'
__________________________________________________ ____________

Mac REAPER 5.20rc4.
Alex Philipp is offline   Reply With Quote
Old 05-25-2016, 04:11 AM   #1347
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 416
Default

Help me please!

REQUEST 1 : Unselect tracks which have receives from current track selection

REQUEST 2 : select tracks which have receives
mehmethan is offline   Reply With Quote
Old 05-25-2016, 04:56 AM   #1348
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@Alex Philipp
Did you download my whole script pack or just this script ?
It need another scripts to be executed.
It may be better to delete the dependency but I can't do that right now.
X-Raym is offline   Reply With Quote
Old 05-25-2016, 10:41 AM   #1349
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,495
Default

Quote:
Originally Posted by mehmethan View Post
Help me please!

REQUEST 1 : Unselect tracks which have receives from current track selection
Here:
Code:
-- Unselect tracks which have receives from current track selection

function get_sel_tracks(sel_tr_count)
  local t = {}
  for i=1, sel_tr_count do
    local tr = reaper.GetSelectedTrack(0, i-1)
    if tr ~= nil then
      if reaper.GetTrackNumSends(tr, -1) > 0 then
        t[#t+1] = tr
      end
    end
  end 
  return t
end

function unselect_tracks(track_table)
  for i=1, #track_table do
    reaper.SetTrackSelected(track_table[i], false)
  end
end

function main()
  local sel_tr_count = reaper.CountSelectedTracks(0)
  if sel_tr_count == 0 then return end
  local t = get_sel_tracks(sel_tr_count)
  if #t == 0 then return end
  unselect_tracks(t)
  reaper.Undo_OnStateChangeEx("Unselect receiving tracks", -1, -1)
end

reaper.defer(main)
Quote:
Originally Posted by mehmethan
Hi spk77

http://forum.cockos.com/showthread.php?t=176312


Could you please take a look at this script and modify it to work with volume envelope of folder track ?

Regards
I tried this, but I think it didn't work too well (too inaccurate etc.)

Last edited by spk77; 05-25-2016 at 10:58 AM.
spk77 is offline   Reply With Quote
Old 05-25-2016, 10:57 AM   #1350
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,495
Default

Quote:
Originally Posted by mehmethan View Post
Help me please!

REQUEST 2 : select tracks which have receives
...and here:
Code:
-- Select tracks which have receives

function get_tracks(tr_count)
  local t = {}
  for i=1, tr_count do
    local tr = reaper.GetTrack(0, i-1)
    if tr ~= nil then
      if reaper.GetTrackNumSends(tr, -1) > 0 then
        t[#t+1] = tr
      end
    end
  end 
  return t
end

function select_tracks(track_table)
  for i=1, #track_table do
    reaper.SetTrackSelected(track_table[i], true)
  end
end

function main()
  local tr_count = reaper.CountTracks(0)
  if tr_count == 0 then return end
  
  local t = get_tracks(tr_count)
  if #t == 0 then return end
  reaper.Main_OnCommand(40297, 0)
  select_tracks(t)
  reaper.Undo_OnStateChangeEx("Select receiving tracks", -1, -1)
end

reaper.defer(main)
spk77 is offline   Reply With Quote
Old 05-27-2016, 03:53 PM   #1351
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 416
Default

Hi Spk77,
Thanks for the scripts. Scripts are working correctly when I use them alone . But when I put them inside a custom action they don't work.

I'm tryin to make a custom action for nudging all my track's volume down correctly.(to avoid cliping in master) So my custom action is like this :

- SWS : Select all folders (parents only)
- Xenakios/SWS : Nudge volume of selected tracks down
- SWS : Select all non-folders
* Script: Unselect tracks which have receives from the current track selection.lua
- Xenakios/SWS : Nudge Volume of selected tracks down
- Track: Unselect all tracks

(I'm using post-fader sends)
(I also have this script working in background. http://forum.cockos.com/showthread.php?t=176312)

In this custom action it is not working. Could you please take a look at it?

Last edited by mehmethan; 05-27-2016 at 04:24 PM.
mehmethan is offline   Reply With Quote
Old 05-28-2016, 03:53 AM   #1352
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,495
Default

Quote:
Originally Posted by mehmethan View Post
Hi Spk77,
Thanks for the scripts. Scripts are working correctly when I use them alone . But when I put them inside a custom action they don't work.

I'm tryin to make a custom action for nudging all my track's volume down correctly.(to avoid cliping in master) So my custom action is like this :

- SWS : Select all folders (parents only)
- Xenakios/SWS : Nudge volume of selected tracks down
- SWS : Select all non-folders
* Script: Unselect tracks which have receives from the current track selection.lua
- Xenakios/SWS : Nudge Volume of selected tracks down
- Track: Unselect all tracks

(I'm using post-fader sends)
(I also have this script working in background. http://forum.cockos.com/showthread.php?t=176312)

In this custom action it is not working. Could you please take a look at it?
Hi,
It seems that this doesn't work:

(this is some custom action)
  • select tracks
  • run action for selected tracks
  • unselect tracks

... when there's a background script which does something to the selected tracks





I don't know if this would work for you, but try to change this code in the bFooz's script:

change this line
Code:
--if the track is selected folder
if (reaper.GetMediaTrackInfo_Value(track, "I_FOLDERDEPTH")==1 and reaper.IsTrackSelected(track) )  then
to
Code:
--if the track is selected folder
if reaper.GetMediaTrackInfo_Value(track, "I_FOLDERDEPTH")==1 then
spk77 is offline   Reply With Quote
Old 05-30-2016, 02:51 PM   #1353
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 1,627
Default req: series of simple envelope state scripts

1 - set volume envelope on selected tracks to active
2 - set volume envelope on selected tracks to inactive
3 - set volume envelope on selected tracks to visible
4 - set volume envelope on selected tracks to not visible
5 - set volume envelope on selected tracks to armed
6 - set volume envelope on selected tracks to unarmed

i'd also like the same set of scripts for pan envelopes. if someone shows me how, i can probably make the adaptations to turn one generic script (or maybe a couple) to fill all these niches. i've looked but the actions list seems to only have 'toggle', not 'set'.

thanks,
BabaG
babag is offline   Reply With Quote
Old 05-30-2016, 03:12 PM   #1354
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

This script is a script template I made to answer Feature request like you exposed :
REAPER-ReaScripts/X-Raym_Toggle certain envelopes properties.lua at master · X-Raym/REAPER-ReaScripts

With it, you can toggle or set different properties, based on a certain value.

You just need to download it, make your own custom mod and donation to support community-made template sharing, and it should be all good ! :P
X-Raym is offline   Reply With Quote
Old 05-30-2016, 04:39 PM   #1355
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 1,627
Default

thanks, x. downloaded and currently trying to figure out how to read it and get it adapted. could take me a ridiculous amount of time and work.
babag is offline   Reply With Quote
Old 05-31-2016, 03:11 AM   #1356
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

@babag
Code:
-- ------ USER CONFIG AREA =====>
-- here you can customize the script
dest_env_name = "Volume"

-- Envelope Output Properties
active_out = nil -- true or false or nil for toggle
-- <===== USER CONFIG AREA ------
If you set active°out = nil, the action will be a toggle,
if you set it to True, it will be a Set inactive,
if you set it to false, it will be a Set inactive

If needed, you can change the way envelope candidate are choosen:
Code:
local active, visible, armed, inLane, laneHeight, defaultShape, minValue, maxValue, centerValue, type, faderScaling = reaper.BR_EnvGetProperties(br_env, true, true, true, true, 0, 0, 0, 0, 0, 0, true)
-- IF ENVELOPE IS A CANDIDATE
  if visible == true and armed == true then
by changing the condition.
X-Raym is offline   Reply With Quote
Old 05-31-2016, 10:15 AM   #1357
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 1,627
Default

thanks x.

took me a few hours of fiddling with it but i managed to figure those things out for myself before i saw your last post. funnily enough, in doing that, i realized that the original script:

X-Raym_Reset envelope with default value.lua

that i'd asked about had a similar conditional statement in it and that, by commenting it, i could make these additional scripts unnecessary.

thanks again,
BabaG
babag is offline   Reply With Quote
Old 06-01-2016, 09:50 AM   #1358
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,229
Default

Script REQ:
I'd like a script to:
Copy track items start/end/fades (time or beat-position)
Paste the same to another track.

Typical I have a vocal-track, trimmed, split etc.
Then doing another track, it would be convenient to paste from previous track.

__________________
Reaper x64, win 8.1
G-Sun.no - Music Blog - My music
G-Sun is offline   Reply With Quote
Old 06-01-2016, 12:51 PM   #1359
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,495
Default

Edit: Probably not working at the moment -> "new take source offset" is not calculated...

Quote:
Originally Posted by G-Sun View Post
Script REQ:
I'd like a script to:
Copy track items start/end/fades (time or beat-position)
Paste the same to another track.

Typical I have a vocal-track, trimmed, split etc.
Then doing another track, it would be convenient to paste from previous track.

Here's my attempt on this:

1) Select a source track and run this script:
Store and restore item parameters (part 1 - store).lua
Code:
--[[
  * ReaScript Name: Store and restore item parameters (part 1 - store)
  * Description:
  * Instructions: 
  * Screenshot: 
  * Notes: 
  * Category: 
  * Author: spk77
  * Author URI: http://forum.cockos.com/member.php?u=49553
  * Licence: GPL v3
  * Forum Thread: 
  * Forum Thread URL: http://forum.cockos.com/showpost.php?p=1689255&postcount=1367
  * Version: 1.0
  * REAPER:
  * Extensions:
]]
 

--[[
 Changelog:
 * v1.0 (2015-06-01)
    + Initial Release
]]

local r = reaper
function main()
  local source_tr_id = r.GetSelectedTrack(0,0)
  if source_tr_id == nil then return end
  local source_tr_guid = reaper.GetTrackGUID(source_tr_id)
  r.SetExtState("spk77_Store and restore item parameters", "source_track_guid", source_tr_guid, false)
end

r.defer(main)
2) Select a destination track and run this:
Store and restore item parameters (part 1 - store).lua
Code:
--[[
  * ReaScript Name: Store and restore item parameters (part 1 - store)
  * Description: 
  * Instructions:
  * Screenshot: 
  * Notes: 
  * Category: 
  * Author: spk77
  * Author URI: http://forum.cockos.com/member.php?u=49553
  * Licence: GPL v3
  * Forum Thread: 
  * Forum Thread URL: http://forum.cockos.com/showpost.php?p=1689255&postcount=1367
  * Version: 1.0
  * REAPER:
  * Extensions:
]]
 

--[[
 Changelog:
 * v1.0 (2015-06-01)
    + Initial Release
]]

local r = reaper

function get_item_properties(item)
  local t = {}
  t.pos = r.GetMediaItemInfo_Value(item, "D_POSITION")
  t.len = r.GetMediaItemInfo_Value(item, "D_LENGTH")
  t.end_pos = t.pos + t.len
  t.fade_in_len = r.GetMediaItemInfo_Value(item, "D_FADEINLEN")
  t.fade_out_len = r.GetMediaItemInfo_Value(item, "D_FADEOUTLEN")
  --[[
  r.GetMediaItemInfo_Value(item, "C_FADEINSHAPE")
  r.GetMediaItemInfo_Value(item, "C_FADEOUTSHAPE")
  r.GetMediaItemInfo_Value(item, "D_SNAPOFFSET")
  --]]
  return t
end


function set_item_properties(item, item_property_tbl)
  local t = item_property_tbl
  r.SetMediaItemInfo_Value(item, "D_POSITION", t.pos)
  r.SetMediaItemInfo_Value(item, "D_LENGTH", t.len)
  r.SetMediaItemInfo_Value(item, "D_FADEINLEN", t.fade_in_len)
  r.SetMediaItemInfo_Value(item, "D_FADEOUTLEN", t.fade_out_len)
  --[[
  r.SetMediaItemInfo_Value(item, "C_FADEINSHAPE")
  r.SetMediaItemInfo_Value(item, "C_FADEOUTSHAPE")
  r.SetMediaItemInfo_Value(item, "D_SNAPOFFSET")
  --]]
end
  
  
function main()
  if not r.HasExtState("spk77_Store and restore item parameters", "source_track_guid") then
    return
  end
  local source_tr_guid = r.GetExtState("spk77_Store and restore item parameters", "source_track_guid")
  local source_tr_id = reaper.BR_GetMediaTrackByGUID(0, source_tr_guid)
  if not r.ValidatePtr2(0, source_tr_id, "MediaTrack*") then -- source track still exists?
    return
  end
  
  local destination_tr_id = r.GetSelectedTrack(0,0)
  if destination_tr_id == nil then return end
  if source_tr_id == destination_tr_id then return end
  
  local s_tr_item_count = r.CountTrackMediaItems(source_tr_id)
  if s_tr_item_count == 0 then return end
  local d_tr_item_count = r.CountTrackMediaItems(destination_tr_id)
  if d_tr_item_count == 0 then return end
  
  for i=1, s_tr_item_count do
    if i > d_tr_item_count then
      break
    end
    local curr_source_item = r.GetTrackMediaItem(source_tr_id, i-1)
    local curr_dest_item = r.GetTrackMediaItem(destination_tr_id, i-1)
    if curr_source_item ~= nil and curr_dest_item ~= nil then
      local source_item_property_tbl = get_item_properties(curr_source_item)
      set_item_properties(curr_dest_item, source_item_property_tbl)
    end
  end
  reaper.Undo_OnStateChangeEx("Restore item parameters", -1, -1)
end


r.defer(main)

Last edited by spk77; 06-01-2016 at 01:00 PM.
spk77 is offline   Reply With Quote
Old 06-01-2016, 01:02 PM   #1360
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,229
Default

Wow,
late now, I'll try tomorrow.

Will it split as well?
__________________
Reaper x64, win 8.1
G-Sun.no - Music Blog - My music
G-Sun 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 02:23 AM.


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