Old 01-25-2017, 09:03 AM   #1
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default Phase Alignment

Hey all,

I am new here and just learned of reascript and have some questions.
I am new to signal processing and have limited exposure.
Is there is a script that can move events or clips on the timeline? If you took an FFT of a file you could phase vocal content efficiently with an algorithm. Is that going too far?
Am I trying to reinvent the wheel?
jvamos is offline   Reply With Quote
Old 01-25-2017, 09:10 AM   #2
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 3,855
Default

welcome!
yes
mpl has a very cool script here http://forum.cockos.com/showthread.php?t=179544
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
Old 01-25-2017, 09:22 AM   #3
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default

I should elaborate. This amazing plugin does elastic time but I want to keep the timing. Turning the red knob down on this plugin still slightly skews the timing.
When the recording was taken there was sample accurate sync between the inputs but the source was at different distances from the microphone.
So the phase relation of them is slightly off.
I guess in a recording situation this could be seen as fixing bad microphone technique?
jvamos is offline   Reply With Quote
Old 01-25-2017, 09:28 AM   #4
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 3,855
Default

ahhh I understand now.
do you really need a script for it? it's easy to move the items to align them.
check this video..https://www.youtube.com/watch?v=JH0ByODyd3o
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
Old 01-25-2017, 09:33 AM   #5
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default

This forum is spooky. WHO ARE YOU GUYS.
jvamos is offline   Reply With Quote
Old 01-25-2017, 09:39 AM   #6
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default

OK, so this is what I am hoping to achieve. This is a great method for Reaper. Very clear and easy to see.
But now picture a source that is in and out. Also not continuous. Hundreds of instances.
It would be used mostly in post production. I have already downloaded your HeDaScripts package manager. Thanks so much for your help. How did you begin in scripting this type of thing?

Last edited by jvamos; 01-25-2017 at 09:44 AM.
jvamos is offline   Reply With Quote
Old 01-25-2017, 09:55 AM   #7
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 3,855
Default

I see, if all items have the same phase offset, you can move them all at the same time, no problem. In any case, to answer your question, yes you can access sample data and move items via scripting and achieve what you are looking for.

Also, there are many scripts in the Reateam reascripts repository. Installing the Reapack manager extension too. http://reapack.com/

How did I begin? I don't remember, but when you start scripting, it's a trap, you cannot exit anymore. Be careful
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
Old 01-25-2017, 01:45 PM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,209
Default

I have Align takes phase script (perform take offset or item position shift via polarity/phase check at some points and zero crossing), which do what you talk about, but it still in early alpha stage. Maybe I will return to it this year.
__________________
SoundCloud | MPL Scripts / ReaPack | Donate
mpl is offline   Reply With Quote
Old 01-25-2017, 08:52 PM   #9
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default

That is pretty amazing. I don't know if I could be of any assistance. I could definitely give a use case and scenario to you. I think it would be really powerful. But I may be giving FFT and myself too much credit.
jvamos is offline   Reply With Quote
Old 01-25-2017, 09:33 PM   #10
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,209
Default

I don`t think FFT is needed here.
__________________
SoundCloud | MPL Scripts / ReaPack | Donate
mpl is offline   Reply With Quote
Old 01-25-2017, 09:39 PM   #11
jvamos
Human being with feelings
 
Join Date: Jan 2017
Location: Toronto, ON Canada
Posts: 13
Default

What is the best way to phase match two items?
jvamos is offline   Reply With Quote
Old 01-25-2017, 10:27 PM   #12
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,209
Default

Get sample arrays of two takes, then do sample shift + calculate whole array (or only zero-crossings for to reduce CPU usage) difference at every shift. Then find minimum difference and shift position or offset by this value. If you want to do this stuff with respecting spectrum (for example reduce DC offset before phase align), then you`ll maybe get shift error as at least FFT window size.
__________________
SoundCloud | MPL Scripts / ReaPack | Donate

Last edited by mpl; 01-25-2017 at 10:36 PM.
mpl 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 07:13 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.