Old 12-25-2017, 12:21 PM   #1561
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,895
Default

Without it, script will make "ReaScript: Run" undo point. Even when an action, like Xenakios/SWS: Select next tracks, does not make undo point.

Only partial solution, in this case.
FnA is offline   Reply With Quote
Old 12-25-2017, 02:04 PM   #1562
Archie
Human being with feelings
 
Join Date: Oct 2017
Posts: 15
Default

Quote:
Originally Posted by FnA View Post
Without it, script will make "ReaScript: Run" undo point. Even when an action, like Xenakios/SWS: Select next tracks, does not make undo point.

Only partial solution, in this case.
now he was happy, he understood everything.
Thank you very much for your help !!!
Archie is offline   Reply With Quote
Old 12-26-2017, 08:41 AM   #1563
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,895
Default

You're welcome. Maybe there is another way. I don't know.
FnA is offline   Reply With Quote
Old 01-05-2018, 12:18 PM   #1564
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 219
Default

Yes! t seems I searched wrong words in action list. Thank you for quick help vanhaze

Solved.
__________________
The truth is not in the middle but exactly where it is.

Last edited by strachupl; 01-05-2018 at 12:27 PM.
strachupl is offline   Reply With Quote
Old 01-05-2018, 12:21 PM   #1565
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,230
Default

??

"Item navigation: Move cursor to start of items"

Or am i misunderstanding you ?
vanhaze is online now   Reply With Quote
Old 01-12-2018, 07:46 PM   #1566
J Reverb
Human being with feelings
 
J Reverb's Avatar
 
Join Date: Jul 2009
Posts: 466
Default

Can someone please help to put this script into the correct form in Lua as I have no idea how and would like to study the code based on what I have cobbled together in a hideous frankenstein fashion, yup it's a car crash.

Really looking forward to seeing how this SHOULD be done properly in Lua

Many many thanks.

Code:
--Split item, snap right item to nearest grid division, set previous items end to same grid division
--Then extend the right items edge backwards over the left item applying a crossfade
-- 

local item=reaper.GetSelectedMediaItem(0, 0) -- get first selected item
local time_editcursor=reaper.GetCursorPosition() -- get time of edit cursor
local pos =  reaper.BR_GetClosestGridDivision(time_editcursor)
if item ~= nil then
reaper.SplitMediaItem(item, time_editcursor) -- split the item at the time where edit cursor is
reaper.SetMediaItemSelected(item, 0) -- leave next item selected by setting item selection to 0 
end
local item=reaper.GetSelectedMediaItem(0, 0)
if item ~= nil then
reaper.SetMediaItemSelected(item, 1)
reaper.SetMediaItemPosition( item, pos, 0 ) --snaps item to nearest grid point
end
reaper.UpdateArrange()

reaper.Main_OnCommand(40416,0) --selects previous item ??? go on you can do it !!!
reaper.Main_OnCommand(40416,0) --selects previous item ??? dont know why this has to be done twice ? help lol
reaper.Main_OnCommand(41639,0) --sets item length to start of next item the first split(right)
reaper.Main_OnCommand(40417,0) --selects next item first split(right)
reaper.Main_OnCommand(40225,0) --Item edit: Grow left edge of items x fade backwards into previous item x 10 needs to be a user definable number or use the last crossfade settings ideally no pop up box
__________________
I've been imitated so well I've heard people copy my mistakes. - Jimi Hendrix
J Reverb is offline   Reply With Quote
Old 01-13-2018, 01:32 AM   #1567
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,745
Default

Quote:
Originally Posted by J Reverb View Post
Can someone please help to put this script into the correct form in Lua
To get correct form you probably should say correct what you want to do.

Quote:
snap right item to nearest grid division
snap what? position, length? stretch to match grid? preserve looping?
Quote:
set previous items end to same grid division
same as what? since you have one grid per project. 'Set items end' means quantise item lengths to grid? extend or move or stretch? previous on timeline or on same track?
Quote:
extend the right items edge backwards over the left item applying a crossfade
items? they are right to each other
even if you do this with right-hand item you`ve got after split at edit cursor, you just get zero right item length. reverse? extend reversed item? preserve source start event(give offset to it)?
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 01-14-2018, 04:17 AM   #1568
J Reverb
Human being with feelings
 
J Reverb's Avatar
 
Join Date: Jul 2009
Posts: 466
Default

Hi mpl,

Yeah sorry for over complicating things.

It's basically SWS/AW: Split selected items at edit cursor w/crossfade on left
but the item start and previous items length snaps to the nearest grid division

Hope that makes sense ?

Thanks for your input btw.

J.
__________________
I've been imitated so well I've heard people copy my mistakes. - Jimi Hendrix
J Reverb is offline   Reply With Quote
Old 01-19-2018, 09:06 PM   #1569
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,895
Default

Maybe not so much over complicating things. More that additional questions will arise. Like: I didn't know what to do with multiple takes, so just did the same to all of them. I chose SnapToGrid because Breeder's function came out before swing grid, and doesn't work with it. It will use visible grid lines. The commented out lines are an effort to allow use of the grid line which is closest regardless of whether it is visible or not. So, no claim of completeness or infallibility, but something to check out...

Code:
-- jreverb split.lua

reaper.Undo_BeginBlock2(0)
fadelen = reaper.SNM_GetDoubleConfigVar("defsplitxfadelen", 0.01)--from prefs/Reaper.ini
curpos = reaper.GetCursorPosition()

--pgm = reaper.SNM_GetIntConfigVar("projgridmin", 666)--? save min pixels between grid lines.
--reaper.SNM_SetIntConfigVar("projgridmin", 0)--? use actual rather than visible grid, if applicable.
snap = reaper.GetToggleCommandState(1157, 0)-- snapping toggle action state
if snap == 0 then -- SnapToGrid doesn't work with snapping off
  reaper.Main_OnCommand(1157,0)
  grid = reaper.SnapToGrid(0, curpos)
  reaper.Main_OnCommand(1157,0)
else
  grid = reaper.SnapToGrid(0, curpos)
end
--reaper.SNM_SetIntConfigVar("projgridmin", pgm)--? restore min pixels between grid lines.

item = reaper.GetSelectedMediaItem(0,0)
if item then
  itempos = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
  if itempos < (grid - fadelen) then
  
    newitem = reaper.SplitMediaItem(item, curpos)
    if newitem then
      reaper.SetMediaItemPosition(newitem, grid - fadelen, false)
      reaper.SetMediaItemLength(newitem, reaper.GetMediaItemInfo_Value(newitem, "D_LENGTH") + fadelen, false)
      
      function Fn_Do_Take(take)
        offset = reaper.GetMediaItemTakeInfo_Value(take, "D_STARTOFFS")
        rate = reaper.GetMediaItemTakeInfo_Value(take, "D_PLAYRATE")
        reaper.SetMediaItemTakeInfo_Value(take, "D_STARTOFFS", offset - (fadelen*rate))
      end
      ct = reaper.CountTakes(newitem)
      if ct > 0 then
        for i = 0, ct-1 do --? do all takes equally?
          Fn_Do_Take(reaper.GetMediaItemTake(newitem, i))
        end
      end
      reaper.SetMediaItemInfo_Value(newitem, "D_FADEINLEN_AUTO", fadelen)
      
      reaper.SetMediaItemLength(item, grid - itempos, false)
      reaper.SetMediaItemInfo_Value(item, "D_FADEOUTLEN_AUTO", fadelen)
    end
  end
end

reaper.UpdateArrange()
reaper.Undo_EndBlock2(0, "jreverb split", -1)

Last edited by FnA; 01-20-2018 at 05:36 PM.
FnA is offline   Reply With Quote
Old 01-21-2018, 05:38 AM   #1570
J Reverb
Human being with feelings
 
J Reverb's Avatar
 
Join Date: Jul 2009
Posts: 466
Default

Thanks FnA

This gives me a fair bit to chew on.
reaper.SNM_GetDoubleConfigVar("defsplitxfadelen", 0.01)
That's really nifty.
Also taking swing grid into account is something that would have
gone straight over my head
I really think it would be a great idea to have a sticky for scripting newbies with fully commented code basics such as how to loop through items etc. etc.
I know x-raym has made an amazing effort to do this amongst others.

Really appreciate the help and insight.

Thanks again,

J.
__________________
I've been imitated so well I've heard people copy my mistakes. - Jimi Hendrix
J Reverb is offline   Reply With Quote
Old 01-21-2018, 08:39 AM   #1571
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,895
Default

I hear you. But the best I can say is look for existing scripts that do something similar for an example. Or just ask about some specific detail.
FnA is offline   Reply With Quote
Old 01-30-2018, 10:51 PM   #1572
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,666
Default

Quote:
Originally Posted by FnA View Post
Code:
reaper.SetMediaItemTakeInfo_Value(take, "D_STARTOFFS", offset - (fadelen*rate))
Just a heads up, "D_STARTOFFS" doesn't play nice if take contains stretch markers (as I learned the hard way):

https://forum.cockos.com/showthread.php?t=180571
nofish is offline   Reply With Quote
Old 01-31-2018, 06:28 AM   #1573
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,895
Default

Good info, thanks. Maybe can just set position and nudge or trim edge instead.
FnA is offline   Reply With Quote
Old 01-31-2018, 09:35 AM   #1574
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,666
Default

Or use the workaround mpl posted in that thread. Though probably slower as it iterates through the stretch markers (if any).
nofish is offline   Reply With Quote
Old 01-31-2018, 11:05 AM   #1575
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,745
Default

Stretch markers are item related data.
Startoffset is source related data.
So you`ll have to change stretch markers positions anyway since they should be changed in RPP chunk.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 01-31-2018, 02:02 PM   #1576
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 373
Default

I have some MIDI editor utility script requests that would make life a lot easier:

-move edit cursor to nearest grid line (MIDI editor)
-save grid (MIDI editor)
-restore grid (MIDI editor)
-move cursor to nearest measure start (MIDI editor)
Arthur McArthur is offline   Reply With Quote
Old 02-09-2018, 12:35 AM   #1577
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

a cosmetic one:
is it possible to align items
according to their colors in the Free item position mode via script?
would helpful i believe!
timbralzoom is offline   Reply With Quote
Old 02-09-2018, 12:48 AM   #1578
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,842
Default

Quote:
Originally Posted by timbralzoom View Post
a cosmetic one:
is it possible to align items
according to their colors in the Free item position mode via script?
would helpful i believe!
One lane per unique color?
cfillion is offline   Reply With Quote
Old 02-09-2018, 01:00 AM   #1579
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by cfillion View Post
One lane per unique color?
yes!
just in case:
timbralzoom is offline   Reply With Quote
Old 02-09-2018, 02:13 AM   #1580
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,842
Default

Done! "Move items to one FIPM lane per color on selected tracks" in ReaPack (it uses item color, not take color).


Last edited by cfillion; 02-09-2018 at 02:19 AM.
cfillion is offline   Reply With Quote
Old 02-09-2018, 03:15 AM   #1581
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by cfillion View Post
Done! "Move items to one FIPM lane per color on selected tracks" in ReaPack (it uses item color, not take color).

that was fast than i expect
did the job done!

two things
-only for selected items?
-is it possible to obey tracks current height also?

even both not possible,
Thank you so much!
timbralzoom is offline   Reply With Quote
Old 02-09-2018, 09:32 PM   #1582
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,842
Default

Quote:
Originally Posted by timbralzoom View Post
two things
-only for selected items?
-is it possible to obey tracks current height also?
Added "Move selected items to one FIPM lane per color" to ReaPack. I'll probably remove the previous one if this one works for you.

It contains two actions:
  • cfillion_Move selected items to one FIPM lane per color.lua
  • cfillion_Move selected items to one FIPM lane per color (preserve height).lua
cfillion is offline   Reply With Quote
Old 02-10-2018, 08:05 AM   #1583
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by cfillion View Post
Added "Move selected items to one FIPM lane per color" to ReaPack. I'll probably remove the previous one if this one works for you.

It contains two actions:
  • cfillion_Move selected items to one FIPM lane per color.lua
  • cfillion_Move selected items to one FIPM lane per color (preserve height).lua
cfillion_Move selected items to one FIPM lane per color.lua

is perfect to me!

Thank you so much!
please check your PM.
timbralzoom is offline   Reply With Quote
Old 02-16-2018, 05:44 PM   #1584
tusitala
Human being with feelings
 
tusitala's Avatar
 
Join Date: Apr 2010
Posts: 297
Default Option to automatically record arm a track inside the midi edito

Hi guys, here's a gif I made to explain what I would like to achieve:



As you can see I managed to choose the option of automatically selecting the track when clicking on a region, which combined with "automatically record-arm selected track" gives me the exact behaviour I want.

What I wish I could do is the same inside the midi editor, but I can't manage to do it: when clicking on the track list they just get selected but not record armed.

Is there a way of getting this behaviour?

And in addition, it would be cool to be able to click on a note inside the midi editor and having reaper automatically record arm its track.

I'm borrowing these behaviours from logic, as I'm so used to them I would love to recreate them.


Hope there's a way of implementing this, it would be extremely handy!

Thanks!
-t
tusitala is offline   Reply With Quote
Old 02-24-2018, 10:32 AM   #1585
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 4,657
Default

looking for something that can quantize/snap tail end of items to the grid using stretching.

Example workflow

- Split items at transients
- Quantize item position to grid
- Stretch item ends to grid.

must work with item grouping.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
EpicSounds is offline   Reply With Quote
Old 02-24-2018, 10:12 PM   #1586
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Hi,
Arrange view
Split Midi item at note starts is it possible?

timbralzoom is offline   Reply With Quote
Old 02-25-2018, 04:17 AM   #1587
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

You could create a custom action:

- Item Navigation: Move cursor to next transient in items
- Item: Split items at play cursor

EDIT:
forget about the approach above. Use the SWS extension with this function:
- Xenakios/SWS: Split items at transients

Last edited by _Stevie_; 02-25-2018 at 04:34 AM.
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 04:24 AM   #1588
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

Quote:
Originally Posted by EpicSounds View Post
looking for something that can quantize/snap tail end of items to the grid using stretching.

Example workflow

- Split items at transients
- Quantize item position to grid
- Stretch item ends to grid.

must work with item grouping.
That would indeed be a great script. Not sure if I haven't already seen something like that...
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 07:41 AM   #1589
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by _Stevie_ View Post
You could create a custom action:

- Item Navigation: Move cursor to next transient in items
- Item: Split items at play cursor

EDIT:
forget about the approach above. Use the SWS extension with this function:
- Xenakios/SWS: Split items at transients
Thanks Stevie!
tried both but they just didn't work.. probably they are just for the audio item?
timbralzoom is offline   Reply With Quote
Old 02-25-2018, 07:47 AM   #1590
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

That's really strange, have you selected the MIDI event?

Check here, how I did it: https://i.imgur.com/NyUVTw5.gif
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 08:07 AM   #1591
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by _Stevie_ View Post
That's really strange, have you selected the MIDI event?

Check here, how I did it: https://i.imgur.com/NyUVTw5.gif
very strange!
here is mine

timbralzoom is offline   Reply With Quote
Old 02-25-2018, 08:09 AM   #1592
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

Wow okay, that doesn't do anything in your case :O
Can you upload the project somehwere? I will check if it does the same here.
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 08:28 AM   #1593
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Quote:
Originally Posted by _Stevie_ View Post
Wow okay, that doesn't do anything in your case :O
Can you upload the project somehwere? I will check if it does the same here.

here is the project
https://drive.google.com/open?id=1AP...N5IPh9a6E9RfmH

a little more info what i am trying to do..
mpl_Export selected items to RS5k on selected track(drum mode)
after this action executed

would be great:
one action to
1-Set note length in selected items (for example 1/32)
2-Split selected items at note starts
at once
..
then Xenakios Shuffle order of selected items
timbralzoom is offline   Reply With Quote
Old 02-25-2018, 08:42 AM   #1594
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

Hey timbralzoom,

I just tried that with my Reaper installation and it works as expected:
https://i.imgur.com/XYszxvR.gif

Then random shuffle:
https://i.imgur.com/EIqQvGN.gif

have you tried with a portable installation? Maybe something in your preferences is broken. That's at least, what I suspect.
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 09:04 AM   #1595
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,230
Default

timbralzoom !

Check this out:

1) Open Reaper Preferences > Editing Behaviour.
2) Checkmark the setting: "tab through midi notes"

Now, Try the split Action again !
vanhaze is online now   Reply With Quote
Old 02-25-2018, 09:06 AM   #1596
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 456
Default

Ahhhhhh! Now I remember, that there was a preference!
_Stevie_ is online now   Reply With Quote
Old 02-25-2018, 09:09 AM   #1597
timbralzoom
Human being with feelings
 
timbralzoom's Avatar
 
Join Date: Apr 2010
Location: Turkey/Istanbul
Posts: 1,419
Default

Thank you both of you!!

timbralzoom is offline   Reply With Quote
Old 02-26-2018, 12:50 AM   #1598
Macc
Human being with feelings
 
Join Date: Feb 2017
Posts: 59
Default

Ehhhh, so I started a new thread for this and completely overlooked this sticky. Ahem. Sorry about that... copy-pasted below.

I'm a mastering engineer, and love being able to queue rendering for the end of the day when I'm tired. Unfortunately I don't trust the render queue, I have problems. Clicks, dropouts, etc in the first second or so in some exported files (it seems random), when exporting regions.

I have to go through every file exported via the render queue and check the first few seconds, then manually re-render any with problems. Or just export every project manually one by one, which works fine. Annoying and time-consuming.

Would there be a script-based way to make Reaper open a queued project, actually play audio for a few seconds, before then going ahead with the render? And so on for each queued render? I've tried the 'delay to allow samples to load' thing but it makes no difference. It seems I need to actually do something in the project (ie play audio) and then it exports fine. Need to fill buffers on certain plugins, or something like that.

BTW I saw this thread - https://forum.cockos.com/showthread....39#post1952839 but think that's a different issue.

Would pay for this, if it's possible of course. It would be a great help and make my life a LOT easier. Of course if there's some other solution then please point me in the right direction.

Thank you!
Macc is offline   Reply With Quote
Old 02-26-2018, 09:14 AM   #1599
Esteban_M
Human being with feelings
 
Esteban_M's Avatar
 
Join Date: Feb 2018
Location: Costa Rica
Posts: 3
Default Move selected MIDI message values to a different MIDI message

Hey guys! I'm new to the forum so I hope I'm on the right thread to request a script (or to ask if someone knows of something already created for this).

- In the MIDI Editor: Move selected MIDI message values to a different MIDI message (ex: move Pitch Bend values to CC21).

I currently do this by hand in the Event Properties window, I'm just looking to see if this can be automated with an action. The closer script I've seen for this is from _Stevie_ for moving specific MIDI CC values to different specific MIDI CC values.

Thanks!
Esteban_M is offline   Reply With Quote
Old 02-26-2018, 10:00 AM   #1600
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,609
Default

SE has variouss cript like that you can mod.

Script: sr_Move CC1 to CC2.lua

https://forums.cockos.com/showthread.php?p=1923923
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 06:18 AM.


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