|
|
|
08-11-2017, 08:48 AM
|
#1
|
Human being with feelings
Join Date: Nov 2016
Posts: 79
|
Stretch Midi Notes Custom Action?
Hi guys,
I wanna create a shortcut to stretch selected midi notes 2x and 1/2 in the same way the mouse modifier (opt) streches notes. So the notes position is altered with the time stretch and not only the note length shortend or streched. I couldn't find any custom action or script for that :O
Any ideas on how to do that, would be greatly appreciated.
|
|
|
08-11-2017, 08:13 PM
|
#2
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
That seems complicated. Why can't you just use the mouse modifier?
|
|
|
08-12-2017, 05:38 AM
|
#3
|
Human being with feelings
Join Date: Nov 2016
Posts: 79
|
yeah you're right i could ^^. but in terms of workflow it would be easier and faster for me to have a shortcut for that.
|
|
|
08-12-2017, 05:57 AM
|
#4
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Quote:
Originally Posted by foxAsteria
That seems complicated.
|
Not really:
Code:
x = 2
for key in pairs(reaper) do _G[key]=reaper[key] end
function StretchSelectedNotes()
local midieditor = MIDIEditor_GetActive()
if not midieditor then return end
local take = MIDIEditor_GetTake( midieditor )
if not take or not TakeIsMIDI(take) then return end
local t = {}
local str = ""
for i = 1, ({MIDI_CountEvts( take ) })[2] do
t[#t+1] = ({reaper.MIDI_GetNote( take, i-1 ) })
if i == 1 then strtppq = t[1][4] end
reaper.MIDI_SetNote( take, i-1, t[i][2],--sel
t[i][3],--mutedInOptional,
(t[i][4]-strtppq)*x+strtppq,--startppqposInOptional,
(t[i][4]-strtppq)*x+strtppq+(t[i][5]-t[i][4])*x,--endppqposInOptional,
t[i][6],--chanInOptional,
t[i][7],--pitchInOptional,
t[i][8],--velInOptional,
true)--noSortInOptional )
end
reaper.MIDI_Sort( take )
end
StretchSelectedNotes()
|
|
|
08-12-2017, 06:08 AM
|
#5
|
Human being with feelings
Join Date: Feb 2014
Posts: 834
|
Nice code Michael
Thank you
|
|
|
08-12-2017, 06:24 AM
|
#6
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Quote:
Originally Posted by mpl
Not really:
Code:
x = 2
for key in pairs(reaper) do _G[key]=reaper[key] end
function StretchSelectedNotes()
local midieditor = MIDIEditor_GetActive()
if not midieditor then return end
local take = MIDIEditor_GetTake( midieditor )
if not take or not TakeIsMIDI(take) then return end
local t = {}
local str = ""
for i = 1, ({MIDI_CountEvts( take ) })[2] do
t[#t+1] = ({reaper.MIDI_GetNote( take, i-1 ) })
if i == 1 then strtppq = t[1][4] end
reaper.MIDI_SetNote( take, i-1, t[i][2],--sel
t[i][3],--mutedInOptional,
(t[i][4]-strtppq)*x+strtppq,--startppqposInOptional,
(t[i][4]-strtppq)*x+strtppq+(t[i][5]-t[i][4])*x,--endppqposInOptional,
t[i][6],--chanInOptional,
t[i][7],--pitchInOptional,
t[i][8],--velInOptional,
true)--noSortInOptional )
end
reaper.MIDI_Sort( take )
end
StretchSelectedNotes()
|
Hi mpl, great !
Could you pls add this to ReaPack ?
Thx in advance!
|
|
|
08-12-2017, 07:31 AM
|
#7
|
Human being with feelings
Join Date: Feb 2014
Posts: 834
|
I tested the script , It stretches all notes not the selected ones.
|
|
|
08-12-2017, 08:55 AM
|
#8
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
Аh yep, didn't test it. I will add to ReaPack some versions later (too much alcohol inside now .
|
|
|
08-12-2017, 11:52 AM
|
#9
|
Human being with feelings
Join Date: Nov 2016
Posts: 79
|
ooh, thats sweet
thnx mpl!
|
|
|
08-12-2017, 11:56 AM
|
#10
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Quote:
Originally Posted by mpl
Аh yep, didn't test it. I will add to ReaPack some versions later (too much alcohol inside now .
|
LOL, enjoy and thank you mpl !
|
|
|
08-12-2017, 11:57 AM
|
#11
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Quote:
Originally Posted by mpl
Not really:
Code:
x = 2...
incomprehensible syntactical gobbeldegook
...
|
Lol, mpl, do you have any idea how complicated that shit looks to us common folk? You coders make me feel like a damned monkey who knows a little bit of sign language.
|
|
|
08-12-2017, 05:26 PM
|
#12
|
Human being with feelings
Join Date: Feb 2014
Posts: 834
|
Quote:
Originally Posted by mpl
Аh yep, didn't test it. I will add to ReaPack some versions later (too much alcohol inside now .
|
Alcohol and coding is a no no!
have a good time
|
|
|
08-13-2017, 12:22 AM
|
#13
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
ReaPack/MIDI editor/mpl_Stretch selected MIDI notes positions by x0.5
ReaPack/MIDI editor/mpl_Stretch selected MIDI notes positions by x2
ReaPack/MIDI editor/mpl_Stretch selected MIDI notes positions by custom x
Custom x can be like: - "2" means "y = x*2"
- "*2" means "y = x*2"
- "/3" means "y = x/3"
|
|
|
08-13-2017, 12:35 AM
|
#14
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Works great, thanks very much mpl !
|
|
|
08-13-2017, 06:06 AM
|
#15
|
Human being with feelings
Join Date: Dec 2014
Posts: 417
|
These will be useful, spasibo MPL.
|
|
|
08-14-2017, 06:53 AM
|
#16
|
Human being with feelings
Join Date: Jul 2017
Location: Hackensack
Posts: 347
|
Another easy solution is to make a button for the Midi Editor using the "Edit: Event Properties" action.
(Which you can also access with the default Ctrl+F2 keystroke.)
|
|
|
12-31-2021, 01:54 PM
|
#17
|
Human being with feelings
Join Date: Jun 2021
Posts: 16
|
Stretch selected MIDI Note tp the CURSOR POSITION
Hi guys!
Please, I am looking for a way to slice a beat and adjust the transient points (cuts, actually) in a way that the MIDI produced by the slicer (Dynamic Split) can be adjusted, too.
I mean, I always need to fix the point of some drum hit points to get them properly before the actual "transient" point. So I preserve the "click".
But, doing this, I move the start point of that slice and I need the corresponding MIDI note to be edited just like the audio start point - may be in parallel.
I was looking for an alternative that can provide this method.
Even if I can turn the audio slices START into MIDI notes or something that I could convert to a MIDI note.
The perfect world would give me the option to move the slices poles BEFORE pushing the "SPLIT" button, so the MIDI notes start points and audio sliced points would be the same. But all we have is a single option to slice on many wrong places and adjust them only AFTER that. So the MIDI notes start points will be wrong, too. But I can't move them and the audio start points together, only the audio stuff...
That's the problem.
Maybe an action to stretch selected MIDI Note tp the CURSOR POSITION could get the job done...
Any idea how could I do that, please?
|
|
|
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 04:57 AM.
|