|
|
|
10-08-2017, 02:36 AM
|
#1521
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Quote:
Originally Posted by vanhaze
my wishful script just cuts selected notes in half, without bringing up a dialog window.
|
Replace
Code:
_, div_ret = reaper.GetUserInputs('Split selected notes to equal parts', 1, 'Divide each notes by', '')
div = tonumber(div_ret)
by
|
|
|
10-08-2017, 02:37 AM
|
#1522
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Yeah works ! Fantastic mpl, thank you for your help !
|
|
|
10-15-2017, 02:26 AM
|
#1523
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Script Request: nudge selected Track(s) volume up/down .5 db
I do miss this currently:
nudge selected Track(s) volume up 0.5db
nudge selected Track(s) volume down 0.5db
If there are any scripters in for this, thx alot !
|
|
|
10-17-2017, 04:05 PM
|
#1524
|
Human being with feelings
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
|
Quote:
Originally Posted by vanhaze
I do miss this currently:
nudge selected Track(s) volume up 0.5db
nudge selected Track(s) volume down 0.5db
If there are any scripters in for this, thx alot !
|
Nudge tracks volume up 0.5 db.lua
Nudge tracks volume down 0.5 db.lua
|
|
|
10-17-2017, 10:39 PM
|
#1525
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Excellent, thanks a bunch me2beats !
Warm Regards.
|
|
|
11-02-2017, 03:30 PM
|
#1526
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Hey all,
I would love to have a script that "selects MIDI notes under edit cursor" to include it in various macros.
That includes also notes that start before the edit cursor and go beyond it.
is that possible?
Cheers,
Stevie
|
|
|
11-03-2017, 05:05 PM
|
#1527
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Quote:
Originally Posted by _Stevie_
That includes also notes that start before the edit cursor and go beyond it.
|
The MIDI Editor action-
Edit: Select all notes in time selection
works like that on all editable items.
So I figured a really really short time selection would be almost the same as "under the edit cursor." Seems to work, but not tested a whole lot.
Code:
GetSet_LoopTimeRange(0, 0, ts1, ts2, 0); // save
gcp = GetCursorPosition();
GetSet_LoopTimeRange(1, 0, gcp, gcp + 0.005, 0); // set
MIDIEditor_LastFocused_OnCommand(40746, 0); // select all notes in time selection
GetSet_LoopTimeRange(1, 0, ts1, ts2, 0); // restore
First and last line are a save and restore existing time selection thing which is not essential to the note selection.
It's a .eel script.
edit. hm, looks like it needs to be about a tick long to catch notes that start on the same grid line as the cursor. 0.005 works here at 30 bpm 4/4 960 tpq.
Last edited by FnA; 11-03-2017 at 05:38 PM.
|
|
|
11-03-2017, 06:23 PM
|
#1528
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Hey FnA!
Wow that's exactly what I needed. It works perfectly, thank you!
Definitely put it in ReaPack, this will be very handy.
Cheers,
Stevie
|
|
|
11-03-2017, 06:31 PM
|
#1529
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
hehe. Well, I'm glad you like it. Did you see that I edited the post and script to 0.005? I'm a little surprised that a smaller value would fail...
edit. maybe it's something to stop the end from catching a note on when people snap time selection to grid.
Last edited by FnA; 11-03-2017 at 06:41 PM.
|
|
|
11-03-2017, 06:34 PM
|
#1530
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Yep saw that :-D
I guess there is an internal limit in Reaper. 0.005 is really fine with me ;-)
I really need to get into scripting!
|
|
|
11-03-2017, 07:09 PM
|
#1531
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Yeah, seems like it could still be usable even if there's a bit of slop in it. Have to think about it a little. I guess scripts like that are a good place to start. Just a handful of functions to look at. To do it with MIDI functions would be more involved. Hurt my head probably. And there's not really any API for getting editable items.
|
|
|
11-11-2017, 11:51 AM
|
#1532
|
Human being with feelings
Join Date: Jul 2014
Posts: 634
|
Change MIDI Notes Pitch via MIDI External Keyboard Controller
Hi I wrote this in General Discussion, but post here again just in case it`s possible to script and any of you has time and want to do it:
"Hi ¡¡¡
I have a friend of mine using Reaper ¡¡¡
Of course he's in love with but miss a midi option he used to use in cubase.
I'll try to explain it:
After you have (let's say a melody) recorded in MIDI , you "rewrite" that melody vía Midi Keyboard Controller in a similar way like "Step recording mode".
It means..There's a selected note, you push a key and that note pitch is changed and automatically edit cursor goes to the next note and auto select it for re pitch it , and so on ...
The two of us have been checking posts, tutoriasl, manual and found nothing about it.
We don't know it that option exists in Reaper or may be can be done using any MIDI plugins or vía Script.
Any way here's a video that he made so you can check better what I'm trying to explain :
https://drive.google.com/file/d/1JGA...uOaVXkSVf/view
THANKS FOR ANY KIND OF HELP ¡¡
"
This is the original post's link:
https://forum.cockos.com/showthread.php?t=199422
Thanks a lot for every thing you do ¡¡
Last edited by Javier Robledo; 11-11-2017 at 11:52 AM.
Reason: Tittle
|
|
|
11-26-2017, 01:33 AM
|
#1533
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
JSFX: Instance Name in a String
In my project, I need to transfer a unique text or any instance of a JSFX plugin to a peripheral device via midi.
For this, I did a gfx based text line editor and store the string in multiple hidden sliders.
Works nicely, but it would be a lot less complex if I just would have been able to access the instance name as a constant string.
Michael
|
|
|
12-03-2017, 01:40 AM
|
#1534
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Dear all,
I was looking for a Script that does the following:
In a Project, Render all Take FX to new Takes and crop those Takes.
I often have Projects that have many Take FX on Items.(including Take FX parameter automation).
I then experience that those Projects become CPU hogs, so thats the moment i just want to render all those Take FX into new takes and let those takes be cropped so they become the only takes in the corresponding Items.
Maybe i miss something in Reaper that can do this "natively"
Otherwise, a Script for this would be really handy.
Thx in advance and Warm Regards.
|
|
|
12-03-2017, 02:33 AM
|
#1535
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
Can "Consolidate" with appropriate settings not do something similar ?
-Michael
|
|
|
12-03-2017, 02:35 AM
|
#1536
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Hi Michael, thank you for helping me !
I never thought about that Consolidate feature cause i never have used that.
Will try !
|
|
|
12-06-2017, 10:36 PM
|
#1537
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Is it possible to make such glue action:
|
|
|
12-07-2017, 02:33 AM
|
#1538
|
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
|
|
|
12-07-2017, 03:02 AM
|
#1539
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Quote:
Originally Posted by fundorin
|
Thanks, unfortunately no.
|
|
|
12-07-2017, 04:37 AM
|
#1540
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@strachupl
There is some attempts:
Join only adjacent/overlapping notes (help! I don't know what am I doing!)
https://forums.cockos.com/showpost.p...52&postcount=7
(also, Fna version below)
JulianSader (on the same thread) told he was also trying to make his own version, but I don't know if he found a way to overpass the bugs he faced. Maybe you should ask him there, if the scripts already posted don't work as expected.
|
|
|
12-07-2017, 08:40 AM
|
#1541
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Quote:
Originally Posted by X-Raym
@strachupl
There is some attempts:
Join only adjacent/overlapping notes (help! I don't know what am I doing!)
https://forums.cockos.com/showpost.p...52&postcount=7
(also, Fna version below)
JulianSader (on the same thread) told he was also trying to make his own version, but I don't know if he found a way to overpass the bugs he faced. Maybe you should ask him there, if the scripts already posted don't work as expected.
|
Thank you very much.
The Fna script. Awesome.
This is the best solution and works quite no problem. I have a question if can I remove part of code to bypass "Max space" window to use always 0? Why this script wasn't in ReaPack?
Also I think this kind join behavior should be default for joining notes. Who the hell would need actual join behavior?
|
|
|
12-07-2017, 09:31 AM
|
#1542
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@strachupl
https://forums.cockos.com/showpost.p...0&postcount=24
This one as no popup.
Quote:
Why this script wasn't in ReaPack?
|
We wait for FnA to create his repo or to propose it to ReaTeam pack. But sure, I can see how this script can be handy for a lot of people.
Quote:
Also I think this kind join behavior should be default for joining notes. Who the hell would need actual join behavior?
|
Very good questions, but people make crazy things with MIDI ^^
|
|
|
12-07-2017, 09:34 AM
|
#1543
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Quote:
Originally Posted by X-Raym
@strachupl
https://forums.cockos.com/showpost.p...0&postcount=24
This one as no popup.
We wait for FnA to create his repo or to propose it to ReaTeam pack. But sure, I can see how this script can be handy for a lot of people.
Very good questions, but people make crazy things with MIDI ^^
|
Thanks, all clear.
|
|
|
12-24-2017, 05:01 PM
|
#1544
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
I recently read a post where the OP wanted a way to have and see markers of some kind in the item.
Planetnine suggested rendering the item so it will show markers as cue's in the file... which works 'ok'...
but it left me wondering is there could be a lua or whatever that would add cue's to a file directly?
not possible???? or....
|
|
|
12-24-2017, 06:59 PM
|
#1545
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Quote:
Originally Posted by Archie
Next Select the items/tracks/envelope points (depending on focus)
|
Like these actions?
Item
SWS: Select next item (across tracks)
or
SWS: Select next item, keeping current selection (across tracks)
or...
Track
Track: Go to next track (leaving other tracks selected)
or
Xenakios/SWS: Select next tracks
or...
Envelope
SWS/BR: Expand envelope point selection to the right
or
SWS/BR: Select next envelope point
or...
but on one shortcut? Pick one of each, or another from the list for each context. Then we can probably use this:
Code:
C: int GetCursorContext()
EEL: int GetCursorContext()
Lua: integer reaper.GetCursorContext()
Python: Int RPR_GetCursorContext()
return the current cursor context: 0 if track panels, 1 if items, 2 if envelopes, otherwise unknown
Last edited by FnA; 12-24-2017 at 07:30 PM.
|
|
|
12-25-2017, 09:30 AM
|
#1546
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Code:
-- select next item track envelope point depending on context.lua
gcc = reaper.GetCursorContext2(true)
if gcc == 0 then
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELNEXTTRACK"),0)-- Xenakios/SWS: Select next tracks
elseif gcc == 1 then
reaper.Main_OnCommand(40417,0)-- Select and move to next item
elseif gcc == 2 then
reaper.Main_OnCommand(reaper.NamedCommandLookup("_BR_ENV_SEL_NEXT_POINT"),0)-- SWS/BR: Select next envelope point
end
function NoUndo() end
reaper.defer(NoUndo)
Integer for built in actions. You have to use NamedCommandLookup("_BlaBla fdetr4w34t4wtr") for custom actions, SWS, and scripts, to get that integer. It varies at times.
When script uses defer() it won't make an undo point unless something else calls it. Some actions have undo point built in like that. Looks like the item and envelope point ones, but not the track action in this case. --edit. another thing. Sometimes when rapid firing these actions that have defer in them, you might get a pop-up saying it's running in the background. In this case you can probably pick "terminate instances" and "remember this...".
Last edited by FnA; 12-25-2017 at 09:49 AM.
|
|
|
12-25-2017, 11:54 AM
|
#1547
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Quote:
Originally Posted by Archie
Thank you very much what was needed! But that's how I realized
function NoUndo() end
reaper.defer(NoUndo)
will not make a rollback point,and the script still does a rollback point
|
That translates to English a little ambiguously.
The script does not make the undo point. The item and envelope actions do. Try from Action List, to see. I believe, you can't stop it. Maybe pick other action/script, for item/envelope point? Xenakios/SWS: Select next tracks does not make undo point, in script OR Action List.
|
|
|
12-25-2017, 12:21 PM
|
#1548
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
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.
|
|
|
12-26-2017, 08:41 AM
|
#1549
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
You're welcome. Maybe there is another way. I don't know.
|
|
|
01-05-2018, 12:18 PM
|
#1550
|
Human being with feelings
Join Date: Jan 2013
Posts: 648
|
Yes! t seems I searched wrong words in action list. Thank you for quick help vanhaze
Solved.
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
Last edited by strachupl; 01-05-2018 at 12:27 PM.
|
|
|
01-05-2018, 12:21 PM
|
#1551
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
??
"Item navigation: Move cursor to start of items"
Or am i misunderstanding you ?
|
|
|
01-12-2018, 07:46 PM
|
#1552
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
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
|
|
|
01-13-2018, 01:32 AM
|
#1553
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Quote:
Originally Posted by J Reverb
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)?
|
|
|
01-14-2018, 04:17 AM
|
#1554
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
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.
|
|
|
01-19-2018, 09:06 PM
|
#1555
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
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.
|
|
|
01-21-2018, 05:38 AM
|
#1556
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
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.
|
|
|
01-21-2018, 08:39 AM
|
#1557
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
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.
|
|
|
01-30-2018, 10:51 PM
|
#1558
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by FnA
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
|
|
|
01-31-2018, 06:28 AM
|
#1559
|
Human being with feelings
Join Date: Jun 2012
Posts: 2,173
|
Good info, thanks. Maybe can just set position and nudge or trim edge instead.
|
|
|
01-31-2018, 09:35 AM
|
#1560
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Or use the workaround mpl posted in that thread. Though probably slower as it iterates through the stretch markers (if any).
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 07:11 AM.
|