Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 08-28-2015, 08:33 AM   #1
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default MPL QuantizeTool - align anything to anything

QuantizeTool is a Lua script for REAPER.

It is designed to do some simple operations with internal objects. There are a lot of user cases, like:
- align MIDI notes to stretch markers
- implode items into edit cursor
- align envelope points to project markers
- etc...

Basic usage is:
1) Setup preset
2) select reference stuff
3) click "Get anchor points"
4) select stuff to align
5) click "Get targets"
6) tweak the knob

Requirements:
REAPER 5.95+
ReaPack 1.2+
Download: ReaPack.com (MPL`s repository is embedded into default ReaPack configuration)

Install:
  • run ActionList > ReaPack: Browse packages...
  • navigate and install (rightclick) QuantizeTool and Various_functions packages, then click 'Apply'
  • run ActionList > ReaPack: Synchronize packages

Telegram channel for MPL scripts: http://t.me/mplscripts_chat

Attached Images
File Type: jpg Untitled.jpg (59.1 KB, 3825 views)

Last edited by mpl; 06-15-2022 at 02:59 PM.
mpl is offline   Reply With Quote
Old 08-28-2015, 09:31 AM   #2
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
Default

And big thanks to you also Michael, you've made a nice tool here.
xpander is offline   Reply With Quote
Old 08-28-2015, 10:36 AM   #3
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 7,595
Default

Looks really cool and an enormous amount of work.

couldn't see a download button on that page so I copied and pasted into a text file. That site gets really unresponsive when selecting text, kinda weird.



edit - quick test on OSX
script makes reaper really slow to scroll, zoom or do anything
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog

Last edited by EpicSounds; 08-28-2015 at 10:45 AM.
EpicSounds is offline   Reply With Quote
Old 08-28-2015, 11:24 AM   #4
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

looking great!
good work!

I have a small suggestion for better code. It will make your life easier to update the texts:
For example to define the help1 variable. if you use this [===[ text ]===] you don't need to concatenate all the lines and insert \n at each line. example:

Code:
help1 = [===[
---------------- EN ----------------
1. What is it?
It`s LUA script for REAPER. I suppose you to have installed 
last version of REAPER and SWS/S&M extension (minimum REAPER
5.0 + SWS 2.8.0)
... etc
]===]
heda is offline   Reply With Quote
Old 08-28-2015, 05:01 PM   #5
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

This looks amazing. I can't wait to try this out.
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 08-29-2015, 12:58 AM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Thanks, heda, really didn`t knew that.
SmajjL, thank you too, I will think about how to realize this better (maybe like timesearch on long videos on youtube).

Last edited by mpl; 08-29-2015 at 01:14 AM.
mpl is offline   Reply With Quote
Old 08-29-2015, 03:59 AM   #7
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 5,074
Default

Quote:
Originally Posted by SmajjL View Post
Holy shit! mpl that is some work! thank you so much for sharing!
Thankfully someone typed this for me +1
__________________
Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x
"If I can hear well, then everything I do is right" (Allen Sides)
beingmf is offline   Reply With Quote
Old 08-29-2015, 05:06 AM   #8
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Amazing tool! Absolutely top job and brilliant work!

can't wait to try it out and spread the word!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-29-2015, 02:18 PM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

A big bravo to mpl : you totally nailed it
You now to have a swinging song on your soundcloud as a demo of this tool :P
X-Raym is offline   Reply With Quote
Old 08-29-2015, 05:05 PM   #10
Stevie
Human being with feelings
 
Stevie's Avatar
 
Join Date: Feb 2015
Posts: 258
Default

well done body
maybe some day it's gonna be a new vocalign for a Reaperppl, atleast i hope so

Last edited by Stevie; 08-29-2015 at 05:24 PM.
Stevie is online now   Reply With Quote
Old 09-11-2015, 08:51 AM   #11
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Tried 1.1

Stuttering after close.
Had a crash, but not sure it was the script.

No way to select only in time-selection? (That's a big one when working with stretch-markers)
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp

Last edited by G-Sun; 09-11-2015 at 08:58 AM.
G-Sun is offline   Reply With Quote
Old 09-11-2015, 09:29 AM   #12
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

1.1 could return error.
1.101 should works right.
Check options in options page for destination/reference stretch markers.
mpl is offline   Reply With Quote
Old 09-11-2015, 09:34 AM   #13
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 317
Default

Finally I donated! Feeling better now :-) !!!! Hey, 1000 thanks for your great work! Looking forward to all thats coming!

Martin
MCCY is offline   Reply With Quote
Old 09-11-2015, 10:07 AM   #14
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,672
Default

the script was failing to launch with error quoted below

...tor\AppData\Roaming\REAPER\Scripts\mpl_Quantize _Tool.lua:4: unexpected symbol near '<'

as described by mpl on page one, this is common for people who aren't used to saving scripts

Quote:
Javi_Metal, you didn`t copypaste script right.
I see a lot of times people ask this question, but don`t understand where and how they copy the code to get this error. There is no "<" symbol in the fourth line ever, as you can see clicking on link in the first post. What I using - open link in first post, then rightclick in browser under text and press Save As or something like this and save it directly as mpl_Quantize_Tool.lua (of course without .txt extension)

Last edited by mccrabney; 09-11-2015 at 01:56 PM.
mccrabney is offline   Reply With Quote
Old 09-11-2015, 10:20 AM   #15
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Quote:
Originally Posted by mpl View Post
1.101 should works right.
Was using 1.102

Getting error on "Get selected only" / "Time selection"


Things are quickly getting buggy when reselecting stretch markers.

Managed to change settings without the above dialog,
but unabel to select stretch-markers in time-selection.

I'm not to good at reading you detailed manual. Just trying things
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp

Last edited by G-Sun; 09-11-2015 at 10:26 AM.
G-Sun is offline   Reply With Quote
Old 09-11-2015, 01:30 PM   #16
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

G-Sun , try 1.103. I rebuilt swing engine so it should works better. But if you still have bugs, let me know how to reproduce this bug.

Last edited by mpl; 09-12-2015 at 12:30 AM.
mpl is offline   Reply With Quote
Old 09-11-2015, 01:56 PM   #17
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,672
Default

this is so good. thank you so much for the osc/midi control. i've been wanting controller control over strength/swing in reaper forever.

may we have cc/osc control over custom grid as well please? ideally with adjustable floor/ceiling values, so i can use the entire fader to move between commonly used values?
mccrabney is offline   Reply With Quote
Old 09-12-2015, 02:09 AM   #18
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Quote:
Originally Posted by mpl View Post
G-Sun , try 1.103. I rebuilt swing engine so it should works better. But if you still have bugs, let me know how to reproduce this bug.
Tested now. No bug.
Even managed to find the correct settings for stretch markers in time-selection only Wonderful

Some non-critical suggestions:
- When wanting to reference to project-grid (the most used option for me I guess), it's hard to choose it without going into custom grid. Could there be a radio-button or something?
(Project grid <> Custom grid)
- Remember last settings /store as default would indeed be handy
- I can see myself using 1-6 settings (options, what, where-to). It would be handy to have some shortcuts, or presets for that, as it's so many options. Simple <> advanced gui, or split up gui for different usage could also be smart.
- The help-file is fabulous. But as my left ind has taken a long vacation, the info for my right mind is just a pile of dots on the screen. I really have to concentrate to access it. Anything with more visual structure would help.

I'll test User Groove and Q to stretch markers in other item.

Thanks again!
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 09-17-2015, 02:05 AM   #19
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Had some serious problems today,
tracked it down to this script.

Had freezes, dropouts and crash.

In matter of fact, I was not using it,
and Reaper was restarted.
Yet, I found the track/time that caused my problems, and it was the end of an quantized audio-item.

Trimmed project here:
https://www.dropbox.com/s/qyno8oqf3f..._Qbug.zip?dl=0

Win 8.1 64, Reaper 5.01 32

Users should not use this script in production-environment before this is fixed imo.
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 09-17-2015, 04:04 AM   #20
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Quote:
save as rgt groove (moved from display)
That means it's compatible with fingers Groove tool ?
edit:
Yes, missed on the previous page:
Quote:
User Groove (import .rgt files for SWS Fingers Groove Tool)
Nice.

This tool is impressive btw., thank you.

Last edited by nofish; 09-17-2015 at 04:57 AM.
nofish is offline   Reply With Quote
Old 09-17-2015, 05:49 AM   #21
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

G-Sun, Ok. Yes, this bug came from script.
Good news is I know where it comes from. Bad news it is really hard to guess what user will do with markers, from developer side. And thats why I wrote in manual, that you should quantize stretch markers VERY carefully. However, I`ll try to make stretch markers quantize engine more safety this week.

It would be very useful if you tell what you did to get stretch markers with negative coefficient. Gif is better.
Also just to say, I use my tool really often and yes, with big projects. Never got something like this.

nofish, didn`t tested much, but should be compatible.

Last edited by mpl; 09-17-2015 at 02:36 PM.
mpl is offline   Reply With Quote
Old 09-17-2015, 12:17 PM   #22
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Good
Quote:
Originally Posted by mpl View Post
G-Sun

It would be very useful if you tell what you did to get stretch markers with negative coefficient. Gif is better.
Also just to say, I use my tool really often and yes, with big projects. Never got something like this.
Don't know if I can make a gif now. But negative coefficient.. I believe I've seen something like that when using the script.

Thanks!
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 09-17-2015, 02:38 PM   #23
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Stretch markers are something special in quantize context, because when you quantize them, they depend from each other (another objects just check how to move from ref.points and nothing else). And I didn't note this in the code (yet). That's why you have problems, when you do something extreme with markers.
mpl is offline   Reply With Quote
Old 09-25-2015, 07:39 AM   #24
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default

Quote:
Originally Posted by G-Sun View Post
Had some serious problems today,
tracked it down to this script.

Had freezes, dropouts and crash.

In matter of fact, I was not using it,
and Reaper was restarted.
Yet, I found the track/time that caused my problems, and it was the end of an quantized audio-item.

Trimmed project here:
https://www.dropbox.com/s/qyno8oqf3f..._Qbug.zip?dl=0

Win 8.1 64, Reaper 5.01 32

Users should not use this script in production-environment before this is fixed imo.
I was wondering if this is still the case and if an update was imminent?
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote
Old 09-25-2015, 11:21 PM   #25
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Can't reproduced that. Working on safety of stretch markers engine though. I've never get G-Sun speaking about. Update coming 1-2 weeks. Stretch markers WAS stable for me before 5.04pre1. After new rate stuff, maybe I'll should rebuild a lot in the code.

Last edited by mpl; 10-21-2015 at 12:10 AM.
mpl is offline   Reply With Quote
Old 09-27-2015, 07:20 AM   #26
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Updated, need REAPER 5.03+.

Changes:
Rightclick on user groove open REAPER\Grooves list
Check for REAPER compatibility on startup
GUI - options window deprecated and splitted to 3 menus on main page
GUI - options sliders dynamically shown when relevant
Option to store current groove to midi item (notes length = 120ppq)
Right click on gravity - type value in ms
Added stretch markers rate limit 0.1x < rate < 100x to prevent related bugs
Option to disable display (reduce CPU usage a lot in some situations)

Last edited by mpl; 09-27-2015 at 08:13 AM.
mpl is offline   Reply With Quote
Old 09-27-2015, 08:52 AM   #27
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Thank you!

New GUI-menus looking good

Testing:

Issue with not obeying grid. Set to 1/8, quantizing to 1/4
Restore stretch-markers to 1.0x, issue: Removes stretchmarkers and deletes peak preview (happened once)

Crash:
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 09-30-2015, 05:25 AM   #28
sinkmusic
Human being with feelings
 
sinkmusic's Avatar
 
Join Date: Feb 2006
Location: decepticon mothership in a hidden place inside a mountain
Posts: 3,754
Default

Hello, MPL
Thank you very much for your nice script.
however, while i'm used to Reaper, i'm still a LUA newbie, and trying to run your script gives me an error message (which i don't understand) :

Am I doing something wrong ?
Thank you in advance,
sinkmusic is offline   Reply With Quote
Old 09-30-2015, 05:29 AM   #29
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

sinkmusic, install last version of SWS.

1.4 build 2 - check for SWS Version on startup (not native solution though).

Last edited by mpl; 09-30-2015 at 06:00 AM.
mpl is offline   Reply With Quote
Old 09-30-2015, 07:32 AM   #30
sinkmusic
Human being with feelings
 
sinkmusic's Avatar
 
Join Date: Feb 2006
Location: decepticon mothership in a hidden place inside a mountain
Posts: 3,754
Default

Ah, thank you, MPL, it works !
sinkmusic is offline   Reply With Quote
Old 09-30-2015, 09:22 AM   #31
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Ok. Thanks to Nick Efremov for helping to get UserGroove works on OSX only if address of grooves directory is:

reaper.EnumerateFiles('/Volumes/Data/UserName/Library/Application Support/REAPER/Grooves', 1)

And reaper.GetExePath() returns '/Applications'.

Any thoughts how to get this folder relatively?
mpl is offline   Reply With Quote
Old 09-30-2015, 09:51 AM   #32
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default

Fantastic, thanks for the graphics tablet update.

I am going to have a go at making a tutorial tonight. I have not yet sat down properly and used all the features, looking forward to getting deep inside this new tool!
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote
Old 09-30-2015, 10:36 AM   #33
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

Quote:
Originally Posted by mpl View Post
Ok. Thanks to Nick Efremov for helping to get UserGroove works on OSX only if address of grooves directory is:

reaper.EnumerateFiles('/Volumes/Data/UserName/Library/Application Support/REAPER/Grooves', 1)

And reaper.GetExePath() returns '/Applications'.

Any thoughts how to get this folder relatively?
You use reaper.GetResourcePath() to get the Application Support/REAPER directory. It works here on OSX and Windows (App Data... on Windows).
snooks is offline   Reply With Quote
Old 10-19-2015, 06:14 AM   #34
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

mpl: I see you've added link to wiki. Nice

Wiki oppdated
- images
- installation (yes, users might see the wiki before installing)
- various changes

Please let me know if you want to have full control yourself, or if you'd like it done another way.

I'd recommend keeping the main-page as clean/short as possible,
using another page for examples and tutorials.
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 10-19-2015, 06:22 AM   #35
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Thank you very much! Q: how do you add gif? I get this though gif is available:
Quote:
Error creating thumbnail: Invalid thumbnail parameters
http://wiki.cockos.com/wiki/index.php/File:Qt_swing.gif
mpl is offline   Reply With Quote
Old 10-19-2015, 08:03 AM   #36
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Quote:
Originally Posted by mpl View Post
Thank you very much! Q: how do you add gif? I get this though gif is available:

http://wiki.cockos.com/wiki/index.php/File:Qt_swing.gif
It shouldn't matter.
When you use it on a page, everything should be ok I beleive.
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 10-31-2015, 01:37 PM   #37
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Hi MPL

In the latest reaper 5.1pre2 I'm now getting this error upon trying to run the script.

"...ser\AppData\Roaming\REAPER\Scripts\mpl_Quantiz e_Tool.lua:2849: attempt to compare number with nil"

A fellow reaper user has also had this too except they are on a mac and I'm PC.

Any idea what it might be?
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 10-31-2015, 02:49 PM   #38
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Latest version has only 2800 lines. Update to version 1.6 build 5 firstly (first post). Don`t forget to install latest SWS also.
mpl is offline   Reply With Quote
Old 10-31-2015, 02:52 PM   #39
Modular
Human being with feelings
 
Modular's Avatar
 
Join Date: Oct 2009
Location: Manchester
Posts: 282
Default

Quote:
Originally Posted by musicbynumbers View Post
Hi MPL

In the latest reaper 5.1pre2 I'm now getting this error upon trying to run the script.

"...ser\AppData\Roaming\REAPER\Scripts\mpl_Quantiz e_Tool.lua:2849: attempt to compare number with nil"

A fellow reaper user has also had this too except they are on a mac and I'm PC.

Any idea what it might be?
Yep I'm getting it too
__________________
www.fortymileswest.co.uk
Modular is offline   Reply With Quote
Old 10-31-2015, 03:39 PM   #40
Modular
Human being with feelings
 
Modular's Avatar
 
Join Date: Oct 2009
Location: Manchester
Posts: 282
Default

I'm getting this too
__________________
www.fortymileswest.co.uk
Modular 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:03 PM.


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