Old 10-04-2019, 03:04 PM   #1
o_e
Human being with feelings
 
Join Date: May 2016
Posts: 364
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: 6,056
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
 
Join Date: May 2016
Posts: 364
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: 3,790
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: 774
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
v5.983+dev0922 - September 22 2019 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
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: 3,790
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
Old 10-17-2019, 09:57 PM   #7
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 774
Default

Quote:
Originally Posted by solger View Post
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
I totally get it may be necessary to have it open in order to call ME script commands, but maybe there's a way to (at the end of the script) : Get Active MIDI Focus and Close Active Window or similar or simply use the "Script: Archie_MidiEditor; Close Midi Editor.lua" .

Just brainstorming.

Thanks.

Cheers,

Andrew K
__________________
Cheers,
Andrew K
v5.983+dev0922 - September 22 2019 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is offline   Reply With Quote
Old 10-18-2019, 11:37 PM   #8
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,790
Default

Quote:
Originally Posted by Thonex View Post
... but maybe there's a way to (at the end of the script) : Get Active MIDI Focus and Close Active Window or similar or simply use the "Script: Archie_MidiEditor; Close Midi Editor.lua" .
Thanks for the hint. I'll check out the 'close midi editor' script.
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 10-19-2019, 11:00 AM   #9
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 3,790
Default

Updated version 2.0 is now available
__________________
ReaLauncher
solger is offline   Reply With Quote
Old 10-19-2019, 12:17 PM   #10
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 774
Default

Quote:
Originally Posted by solger View Post
Updated version 2.0 is now available
Ooooh... promised wife I'd clear out the garage... but tomorrow I'll give it a shot!! Thanks so much Solger!!

Cheers,

Andrew K
__________________
Cheers,
Andrew K
v5.983+dev0922 - September 22 2019 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex 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 12:36 PM.


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