Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 04-02-2020, 05:06 AM   #1
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default how to "compact" MIDI note sequence to legato and common note length?

Is there a script that can note-lenght-quantize and then "compact" an existing MIDI melody? I'd like to convert a sequence of notes in a way that all notes have the same note length (maybe selectable) and all overlapping and all spaces between them get removed, just preserving the notes' intervals.

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-11-2020, 06:49 AM   #2
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

so this is only doable manually?

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-18-2020, 12:37 PM   #3
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

wow, so I actually found the first thing ever entirely impossible in Reaper? What a bummer! I'll be switching to Cubase then.

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-18-2020, 04:38 PM   #4
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 518
Default

Can you give an example before and after screenshot? Making the effect should be easy if it's not already built in.
Dex is offline   Reply With Quote
Old 04-18-2020, 04:57 PM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,093
Default

All notes the same length can be done via Notes Properties window.
nofish is offline   Reply With Quote
Old 04-18-2020, 05:06 PM   #6
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I expect that there is a combination of two or three native actions that can achieve this, and that you can combine into a custom action, but personally I would simply use the Multi Tool to zap them into place:

juliansader is offline   Reply With Quote
Old 04-18-2020, 05:55 PM   #7
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

thanks for taking your time to reply, folks!

let's say you have a monophonic MIDI note melody incl. pauses/gaps between notes and also overlapping notes. My aim is to get all notes to a common length (like 1/8 or 1/16), then remove any overlapping and finally remove all spaces between the notes so that the entire sequence of notes has the same length and no pauses.

I'd first trigger a note length action that will set all note lengths to a value smaller that that of the shortest note of the melody. 1/64 or 1/128 will probably always work for me. This will remove any existing overlapping. Then, all notes except for the first note would need to get shifted to the left (keeping their pitch) until they hit the end of their preceding neighbour. Finally, I would stretch the entire MIDI item by a factor of 3 or 4 to get a sequence of 1/4 notes.

Here's how it looks:



Upper left editor shows the original melody. Upper right editor shows melody after triggering note length action. Bottom editor shows compacted note sequence.

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-18-2020, 06:09 PM   #8
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

To convert to a series of quarter notes:

juliansader is offline   Reply With Quote
Old 04-18-2020, 06:14 PM   #9
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

looks good, julian. What's going on?

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-18-2020, 11:52 PM   #10
brynolf
Human being with feelings
 
Join Date: Jan 2015
Posts: 162
Default

I use the following MIDI editor actions: "set note length to grid size" and "set note ends to start of next note"
"correct overlapping notes" takes care of the overlaps.

Easy to create a custom action from these three

Edit: oh, you meant overlaps on different notes. That I'm not sure how to solve.

Last edited by brynolf; 04-18-2020 at 11:58 PM.
brynolf is offline   Reply With Quote
Old 04-19-2020, 08:22 PM   #11
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

Quote:
Originally Posted by juliansader View Post
To convert to a series of quarter notes:

Would you mind sharing how you are accomplishing this, julian? It seems to be exactly what I'm looking for, doesn't it?

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-19-2020, 09:08 PM   #12
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 518
Default

Quote:
Originally Posted by juliansader View Post
I expect that there is a combination of two or three native actions that can achieve this, and that you can combine into a custom action, but personally I would simply use the Multi Tool to zap them into place:

I'm curious about what's going on in this one. What exactly is the tool and the action used?
Dex is offline   Reply With Quote
Old 04-19-2020, 09:32 PM   #13
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by SonicAxiom View Post
Would you mind sharing how you are accomplishing this, julian? It seems to be exactly what I'm looking for, doesn't it?
I am using standard functions of the "Multi Tool" script, which can be installed via ReaPack for the MIDI editor.

I click-drag on the left (Stretch) zone to stretch the notes to the grid (snap-to-grid is enabled), then mousewheel in the middle (Warp) zone to evenly space the notes, and lastly click-drag on the right stretch zone to stretch to grid again. The Multi Tool has several other functions, some of which are demonstrated here:


Last edited by juliansader; 04-19-2020 at 09:38 PM.
juliansader is offline   Reply With Quote
Old 04-20-2020, 07:50 AM   #14
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

ok, I finally got it working. Thanks, julian!

I tried the multi-tool but it didn't work until I re-sync'ed ReaPack and oviously got the updated version of the script. Now it works like in your screenshot and does exactly what I asked for.

I hereby withdraw my fulmination of quitting Reaper for another daw and also my statement that something would not be feasible in Reaper

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-25-2020, 12:00 PM   #15
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 518
Default

I'm pretty new to REAPER scripting and I decided I wanted to learn the API a bit better, so I went ahead and wrote a script that does exactly what you want with a single action. Just hotkey this action as a MIDI Editor action and run it with an open midi editor. It only acts on the notes you have selected, and it fits the notes to whatever grid you have. It even works with a swing grid!

https://stash.reaper.fm/38964/Fit%20...0%28Dex%29.lua
Dex is offline   Reply With Quote
Old 04-25-2020, 12:30 PM   #16
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

Awesome!

Thanks a bunch for sharing this cool script, Dex!

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-25-2020, 12:35 PM   #17
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

small feature request

would it be possible to add an undo name to the script in order to identify it in the undo history?

Edit: Maybe this thread helps (I'm no coder): https://forum.cockos.com/showthread.php?t=145178

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 04-25-2020, 01:14 PM   #18
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 518
Default

I think I got it working. Same filename and location, just re-download it.

https://stash.reaper.fm/v/38964/Fit%...0%28Dex%29.lua
Dex is offline   Reply With Quote
Old 04-25-2020, 01:27 PM   #19
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,005
Default

PERFECT! Thank you so much, Dex!

Looking forward to see more of your stuff in the future

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom 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 09:22 PM.


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