Old 10-04-2019, 03:04 PM   #1
o_e
Human being with feelings
 
o_e's Avatar
 
Join Date: May 2016
Posts: 681
Default 'smart' cut of midi items possible?

Hi,

Is it possible to read out the positon of the cursor in an item and the length of Midi notes left and right from the cursor in a script? I asked myself if it is possible to write a 'smart' cut function for midi items, deleting the small chunks left and right of the cursor (see attached pict)?

o_e is offline   Reply With Quote
Old 10-04-2019, 04:06 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

yes it is possible. You can get midi content of midi item independant of the contect (arrange view, midi editor etc)
X-Raym is offline   Reply With Quote
Old 10-05-2019, 01:08 AM   #3
o_e
Human being with feelings
 
o_e's Avatar
 
Join Date: May 2016
Posts: 681
Default

Quote:
Originally Posted by X-Raym View Post
yes it is possible. You can get midi content of midi item independant of the contect (arrange view, midi editor etc)
Thanks for your answer!

So it would be possible to write a script which compares the length right and left of the cursor and delete the side which is shorter. Or delete one side if it falls under a certain length threshold or a certain percentage.
I'am willing to give a little bounty if someone is interested in writing such a script..

edit:
Before someone start working on that, in the german-speaking part of the forum solger delivered a script which does what I'am looking for
https://forum.cockos.com/showthread.php?t=225694 (in combination with other scripts)

Last edited by o_e; 10-05-2019 at 02:37 AM.
o_e is offline   Reply With Quote
Old 10-16-2019, 12:37 PM   #4
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,844
Default

The first version of the Smart split MIDI item script bundle is now up on ReaPack.

After install the following scripts will be available in the [Main] sections of the Action List:
  • Script: solger_Smart split MIDI item (trim left note parts at cursor).lua
  • Script: solger_Smart split MIDI item (trim right note parts at cursor).lua
  • Script: solger_Smart split MIDI item (trim shorter note parts at cursor).lua

The threshold length value determining which (of the left, right or shorter) note parts will be trimmed can be adjusted inside the scripts via the noteLength und noteMultiplier parameters - by default all notes are trimmed.
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 10-16-2019, 04:47 PM   #5
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Quote:
Originally Posted by solger View Post
The first version of the Smart split MIDI item script bundle is now up on ReaPack.

After install the following scripts will be available in the [Main] sections of the Action List:
  • Script: solger_Smart split MIDI item (trim left note parts at cursor).lua
  • Script: solger_Smart split MIDI item (trim right note parts at cursor).lua
  • Script: solger_Smart split MIDI item (trim shorter note parts at cursor).lua

The threshold length value determining which (of the left, right or shorter) note parts will be trimmed can be adjusted inside the scripts via the noteLength und noteMultiplier parameters - by default all notes are trimmed.
Very nice Solger!!

I'm wondering if you could make it so that it doesn't open the MIDI Editor? The functionality is great but when splitting items in the arrange window, I don't want to be forced into the MIDI Editor. Is that possible?
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 10-17-2019, 12:30 PM   #6
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,844
Default

Quote:
Originally Posted by Thonex View Post
I'm wondering if you could make it so that it doesn't open the MIDI Editor? The functionality is great but when splitting items in the arrange window, I don't want to be forced into the MIDI Editor. Is that possible?
Currently it's necessary for the script to work (correctly).
Not sure if it's possible otherwise, but I haven't had time yet to dig into this deeper since I wanted to get version 1.0 ready for release first
__________________
ReaLauncher

Last edited by solger; 10-17-2019 at 01:00 PM.
solger 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:36 AM.


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