Old 06-05-2015, 04:43 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,115
Default Scripts: Ripple edit in MIDI Editor

Hi !

Here are scripts that came to an answer of the FR:
FR: Ripple Editing in MIDI Editor
Native solutions could be better (with mouse drags etc...) but meanwhile, here is custom workaround.

This ripple edit works with note under mouse and edit cursor.

For the moment, I only made ripple edit from note under mouse edges, as I think it is the most important.

  • X-Raym_Trim MIDI note under mouse end to edit cursor and ripple edit.lua
  • X-Raym_Trim MIDI note under mouse start to edit cursor and ripple edit.lua
Demo:





Infos:
  • select note under mouse
  • offset based on note under mouse end and edit cursor
  • offset propagated to all selected note length
  • all notes after note under mouse moved in position by the offset amount
Concerns:
  • No way to properly move CC ans Sysex as they are not cached
  • I consider the item as block in which we do things, so the scripts doesn't extend the item edges. I plan another version (using br set item edges function would be perfect for this :P). Actually, notes that go beyond item edges are truncated or deleted.

Want to test it ?
It is on my script pack already
(note: you will need v5 pre).
X-Raym is offline   Reply With Quote
Old 06-05-2015, 04:52 AM   #2
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,225
Default

Quote:
Originally Posted by X-Raym View Post
  • No way to properly move CC ans Sysex as they are not cached

Why use FNG stuff here? You can use native API with noSortInOptional flag set as true (and then use MIDI_Sort() when done)...and you can use it for all events, not just notes.

Anyway, this looks ok, but it would still be much better to have actions that simply extend event length by current grid. It's counter-productive to expect from the user to move edit cursor all the time just to resize notes. It also kills any possibility of ripple editing multiple notes at various positions (for example, resizing every second 8th note to 4th note).

It would also be nice to have the option to "extend" the empty space between notes by the same amounts (like ripple editing pauses). Not really sure how much doable is this in all scenarios, but worth thinking about it...

Last edited by Breeder; 06-05-2015 at 05:03 AM.
Breeder is offline   Reply With Quote
Old 06-05-2015, 05:11 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,115
Default

NoSort will work ? Oh ok !
Not very experimented in REAPER MIDI related scripting, I will do it right away and tell you when it will be updated.

I use cursor because it allow to place it anywere you want, grid or not, across several grid sections, with swing or not, or in "free time".

Of course a mod to make it works to next grid sections could be done, but we (with FNA) already had trouble with this kind of functionalities for complex grids.
X-Raym is offline   Reply With Quote
Old 06-05-2015, 05:13 AM   #4
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,225
Default

Quote:
Originally Posted by X-Raym View Post
Of course a mod to make it works to next grid sections could be done, but we (with FNA) already had trouble with this kind of functionalities for complex grids.
You don't have to find the grid line...You just have to use current grid value to determine by how much the length will increase/decrease (and in case the length ends up shorter than current grid division, you just skip that note). Occam's razor principle

If I had more free time, I would do this for SWS, but I'm terribly busy with real life stuff. Maybe in a month or so I will give it a go (but I still need to update ReaSyntax before v5 becomes official and I want to have code completion for all flavors (py, lua and eel) of ReaScript)

Last edited by Breeder; 06-05-2015 at 05:20 AM.
Breeder is offline   Reply With Quote
Old 06-05-2015, 05:38 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,115
Default

@Breeder
Oh, good luck for reasynthax, there is a lot of new functions to define !

I don't plan a more complex thins with ripple pauses...


Hmm, having trouble with the CCs for the moment. It seems to act only on first selected event of each CC...

PHP Code:
            -- CCs
            
for 0ccs do
                
retvalselmutedstartchanmsgchanmsg2msg3 reaper.MIDI_GetCC(takei)
                if 
start >= end_note then 
                    reaper
.MIDI_SetCC(takeiselmutedstart offsetchanmsgchanmsg2msg3true)
                
end
            end 
-- END OF CCs 
I deleted the conditions and set sel as true to this that.

Frustration. ^^
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:06 AM.


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