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

Reply
 
Thread Tools Display Modes
Old 04-15-2020, 04:40 AM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default amagalma_Create Impulse Response (IR) of the FX chain of the selected track


Big image

One-click creation of an Impulse Response of the FX Chain of a selected track.

# Creates an impulse response (IR) of the FX Chain of the first selected track.
- Mono or Stereo IR creation
- Browse for path and filename
- Normalize to maximum peak value
- Trim trailing silence below set threshold
- Locate file in Explorer/Finder
- Insert file in Project
- Load created IR in Reaverb and bypass the other FX in track
- Set default values inside the script
- Requires JS_ReaScriptAPI extension and Lokasenna GUI v2 libary

available in ReaPack

Last edited by amagalma; 04-20-2020 at 03:20 PM.
amagalma is offline   Reply With Quote
Old 04-15-2020, 02:32 PM   #2
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 133
Default

Quote:
Originally Posted by _TIP_ View Post
Hi amagalma, I just updated to v1.35 but unfortunately, I'm still getting a blank file every time I run the script. (Win 10 64bit, Reaper 6)
Quote:
Originally Posted by amagalma View Post
Please attach a licecap and a sample project. Thanks!
Hello amagalma!
So, my understanding is that every time I run the Script, it creates 2 files inside the audio folder, the file with the right name is corrupted and the other one, is working but is named like that: "109950render 001-glued.wav".

The good news is that the script works (in a way), the bad news is that it creates 2 files instead of one and the working one has a random name instead of the given one... Here is a *.gif and the project file for you to take a look when you get a chance, thank you again for everything, this is a very handy script!!!
Attached Files
File Type: rpp Amagalma IR Creator.rpp (3.3 KB, 20 views)
_TIP_ is online now   Reply With Quote
Old 04-15-2020, 04:01 PM   #3
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

It is because your format for Apply FX and Glue is set to FLAC.. I may be able to work around this for the script, but the IR that you will get will be a WAV. Which you can then turn to FLAC yourself if you wish.
amagalma is offline   Reply With Quote
Old 04-15-2020, 04:35 PM   #4
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

fixed in v1.38
amagalma is offline   Reply With Quote
Old 04-16-2020, 01:06 PM   #5
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 133
Default

Quote:
Originally Posted by amagalma View Post
fixed in v1.38
Just tested v1.38, now I'm getting only the trigger (click) file as a result instead of the rendered IR itself.
Also, I forgot to mention that in v1.37 I changed my project settings from FLAC to WAV and I was still getting the same results I've described above...

Last edited by _TIP_; 04-16-2020 at 01:09 PM. Reason: forgot to mention
_TIP_ is online now   Reply With Quote
Old 04-16-2020, 10:43 PM   #6
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

A new licecap and project file, please. Thanks!

Please, try this script version and post here the result. Thanks!

Last edited by amagalma; 04-17-2020 at 02:25 AM.
amagalma is offline   Reply With Quote
Old 04-17-2020, 02:09 PM   #7
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 133
Default

Quote:
Originally Posted by amagalma View Post
Please, try this script version and post here the result. Thanks!
So, the FLAC project settings seems to be fixed in this version, I just noticed that the script is not working with some 3rd Party plugins. WarmVerb from Tone2 is one of those plugins... I was trying to figure it out for over an hour but I really don't understand what is going on. No big deal, since most of the plugins I've tested are working just fine here!
Thank you again for trying to fix those issues amagalma!!!
Attached Files
File Type: rpp IR Creator v1.38.rpp (3.9 KB, 11 views)
_TIP_ is online now   Reply With Quote
Old 04-17-2020, 03:01 PM   #8
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

If you load a Dirac in the channel and use action Apply FX does it have the same result?
amagalma is offline   Reply With Quote
Old 04-17-2020, 03:17 PM   #9
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 133
Default

Quote:
Originally Posted by amagalma View Post
If you load a Dirac in the channel and use action Apply FX does it have the same result?
With Tone2 WarmVerb, I get just the trigger file as a result (same as your script, no IR), when I load another reverb plugin it works as it should. Not sure what is going on but, no big deal since the majority of the plugins are working fine... If I find more plugins that they don't work I'll let you know ;-)
Thanks again amagalma!
_TIP_ is online now   Reply With Quote
Old 04-17-2020, 03:20 PM   #10
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 367
Default

Quote:
Originally Posted by amagalma View Post
One-click creation of an Impulse Response of the FX Chain of a selected track.
Unbelievable! Fantastic script Amagalma. I have a few questions.

1. Is there a way to have the script automatically place the current tracks FX into Bypass, and then instantiate the ReaVerb plugin with the IR set and configured correctly? Makes the perfect variant of Freeze.

2. Can the script be extended to do true stereo? ie L->LR and R-> LR( and in the future multi-channel )

3. Is there a way to skip the normalisation step? Ideally I would like to ensure the gain through the IR is the same as the original FX Chain.

Thanks
tdc is offline   Reply With Quote
Old 04-17-2020, 03:52 PM   #11
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by _TIP_ View Post
With Tone2 WarmVerb, I get just the trigger file as a result (same as your script, no IR), when I load another reverb plugin it works as it should. Not sure what is going on but, no big deal since the majority of the plugins are working fine... If I find more plugins that they don't work I'll let you know ;-)
Thanks again amagalma!
It is not a script problem but a convolution limitation. Only linear-processes can be reliably captured. Reverbs. delays, equalizers. No chorus, no distortion, no saturation etc. Anything that is not linear can't be reliably captured. I don't have WarmVerb to check but if the native Apply FX action doesn't do anything, that means that either the plug-in has some short of limiting built-in to not allow spikes pass in or there is some incompatibility with Reaper, in which case you should contact both devs. If it is the first case, then the only way to capture it is via the sine sweep method.
amagalma is offline   Reply With Quote
Old 04-17-2020, 03:59 PM   #12
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by tdc View Post
Unbelievable! Fantastic script Amagalma. I have a few questions.

1. Is there a way to have the script automatically place the current tracks FX into Bypass, and then instantiate the ReaVerb plugin with the IR set and configured correctly? Makes the perfect variant of Freeze.

2. Can the script be extended to do true stereo? ie L->LR and R-> LR( and in the future multi-channel )

3. Is there a way to skip the normalisation step? Ideally I would like to ensure the gain through the IR is the same as the original FX Chain.

Thanks
Thanks!

1. Set current track's FX into ByPass yes. Instantiate Reaverb yes. Load the IR no, there is no API for this. BTW, it can't substitute for Freeze. If you have only linear effects, then yes. (read the post above)
2. The script uses the native actions to apply the fx. I am not sure if these support multi-channel. I 'll look into this.
3. I'll add an option to skip normalization.
amagalma is offline   Reply With Quote
Old 04-19-2020, 05:20 AM   #13
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by amagalma View Post
...Load the IR no, there is no API for this...

It was a hack, but I managed to do it.. The new version will support this too.
amagalma is offline   Reply With Quote
Old 04-20-2020, 04:38 AM   #14
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 367
Default

Quote:
Originally Posted by amagalma View Post
It was a hack, but I managed to do it.. The new version will support this too.
Thats great news!
tdc is offline   Reply With Quote
Old 04-20-2020, 03:22 PM   #15
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

v2.00 changelog:

- Major facelift/redesign. Now uses Lokasenna's GUI Library
- Added ability to browse for file and set path
- Added choice to enable/disable Normalization and Silence Trimming
- Added choice to locate created IR in Explorer/Finder
- Added choice to insert IR in Project
- Added choice to load in Reaverb and bypass FX of track
- Improved debugging mode


See first post
amagalma is offline   Reply With Quote
Old 05-06-2020, 12:37 AM   #16
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

Hey, this is sooooooo fantastic! I just stumbled over this and had never the idea to search for this in reaper, but I was longing for such a tool for so long! Thank you!!!!

Is it possible to get automatic naming? So that I can do my settings and just click the create - button again and again and the tool just creates irs from "blablabla"001-xxx.wav? This would be useful for making a series of IRs with different settings on the track.

The creation process leaves some other files than the wav on the harddrive. Is it possible to disable that, or is it, because it loads the wavs in reaper?

Thank you so much!!!

Martin

Last edited by MCCY; 05-06-2020 at 12:50 AM.
MCCY is offline   Reply With Quote
Old 05-06-2020, 04:05 AM   #17
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by MCCY View Post
Hey, this is sooooooo fantastic! I just stumbled over this and had never the idea to search for this in reaper, but I was longing for such a tool for so long! Thank you!!!!

Is it possible to get automatic naming? So that I can do my settings and just click the create - button again and again and the tool just creates irs from "blablabla"001-xxx.wav? This would be useful for making a series of IRs with different settings on the track.
Hello Martin and thanks! Currently the IR gets the name of the track, which you can change. I'll look into adding a completely automated naming mode.

Quote:
The creation process leaves some other files than the wav on the harddrive. Is it possible to disable that, or is it, because it loads the wavs in reaper?

Thank you so much!!!

Martin
It should leave no files behind! Could you go inside the script and change line 42?
From:
Code:
local debug = false
To:
Code:
local debug = true
Then run the script and pm to me or post here the results. Also, what is your OS? Thanks!
amagalma is offline   Reply With Quote
Old 05-10-2020, 04:21 AM   #18
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

It just leaves a reapeak file in the IR directory... OS is WIN 10.
MCCY is offline   Reply With Quote
Old 05-10-2020, 04:31 AM   #19
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

=== Script is in debug mode ===

Path from function: C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\IR.wav
IR_path: C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\
IR_name: IR.wav
========================


IR full path will be: C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\IR.wav
Maximum length of IR will be 5
Normalize Peak to -0.4
Trim Silence Below -100
Channels: Stereo
Locate in Explorer enabled
Load in Reaverb enabled
========================

Create Dirac succeded. Item is: userdata: 00000000072C5A00
Applied FX. Render path is: C:\Users\MPC\Documents\REAPER Media\234372 render 001.wav
Normalized to -0.4 dB
Trim Silence succeeded
Glued. New item is: userdata: 000000002111E650
Renamed C:\Users\MPC\Documents\REAPER Media\234372 render 001-glued.wav TO C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\IR.wav
Deleted C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\234372.wav
Deleted C:\Users\MPC\Documents\REAPER Media\234372 render 001.wav


Created IR:
-- C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\IR.wav --


Script ended with no problems
==============================
MCCY is offline   Reply With Quote
Old 05-10-2020, 04:35 AM   #20
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Ah ok! You have a different setting in the preferences than me on where to store the reapeaks files (reapeaks file hold the information on how to draw the audio files inside reaper). I'll make sure that this file gets deleted.

Code:
Full name of the IR:
C:\Users\MPC\Documents\REAPER Media\Neuer Ordner\IR.wav
what is the name of the reapeak file that is left behind?

Is it this?:
Code:
234372 render 001-glued.reapeaks
amagalma is offline   Reply With Quote
Old 05-10-2020, 10:02 AM   #21
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

I've done another ir ... the file is named: 2217481.wav.reapeaks
MCCY is offline   Reply With Quote
Old 05-10-2020, 02:56 PM   #22
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Thanks!

v2.02 changelog
- Ensure no orphan reapeak file is left behind
- Ensure that track name does not change
amagalma is offline   Reply With Quote
Old 05-11-2020, 12:14 AM   #23
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

Thank you! Would be so great, if automatic naming was possible now.

Would it work with external effects too? Like making IRs from my analog EQ as an external insert in reaper? Have to try that....
MCCY is offline   Reply With Quote
Old 05-11-2020, 01:33 AM   #24
sinkmusic
Human being with feelings
 
sinkmusic's Avatar
 
Join Date: Feb 2006
Location: decepticon mothership in a hidden place inside a mountain
Posts: 3,545
Default

ooh, very interesting script !
Thank you, Amagalma !

Last edited by sinkmusic; 05-11-2020 at 11:56 AM.
sinkmusic is offline   Reply With Quote
Old 05-11-2020, 02:23 AM   #25
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by MCCY View Post
Would it work with external effects too? Like making IRs from my analog EQ as an external insert in reaper? Have to try that....

No. Only with digital effects connected digitally to your soundcard. In order to create an IR with analog effects (or digital effects but connected analogically to your soundcard) a different method must be used (sine sweep).
amagalma is offline   Reply With Quote
Old 05-12-2020, 05:42 AM   #26
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 9,262
Default

Quote:
Originally Posted by MCCY View Post
Would it work with external effects too?
Using ReaInsert ?

-Michael
mschnell is online now   Reply With Quote
Old 05-12-2020, 07:44 AM   #27
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by mschnell View Post
Using ReaInsert ?

-Michael

I don't know. If native action Item: Apply track/take FX to items works, and if your external fx is digital connected via digital connection, then it would.
amagalma is offline   Reply With Quote
Old 05-12-2020, 01:33 PM   #28
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 9,262
Default

ReaInsert is a VST wrapper for hardware effects connected via an audio interface. So yes.

-Michael

Last edited by mschnell; 05-14-2020 at 12:51 PM.
mschnell is online now   Reply With Quote
Old 05-14-2020, 12:28 AM   #29
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

I tried it, it does not work with external (analog in my case) FX. Not solo and not in addition to other effects.
MCCY is offline   Reply With Quote
Old 05-14-2020, 11:14 AM   #30
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by MCCY View Post
I tried it, it does not work with external (analog in my case) FX. Not solo and not in addition to other effects.

Told ya! If you want to make impulse with external FX do this.
amagalma is offline   Reply With Quote
Old 05-14-2020, 09:51 PM   #31
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 9,262
Default

Quote:
Originally Posted by amagalma View Post
Told ya! If you want to make impulse with external FX do this.
Is the cause that your thing implicitly needs offline-rendering ? Maybe this somehow can be mended ...

-Michael
mschnell is online now   Reply With Quote
Old 06-07-2020, 02:38 AM   #32
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default

... just curious, any chance for automatic renaming?
MCCY is offline   Reply With Quote
Old 06-07-2020, 03:16 AM   #33
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by mschnell View Post
Is the cause that your thing implicitly needs offline-rendering ? Maybe this somehow can be mended ...

-Michael
The idea of the script is to automate, simplify and speed up the process. Offline-rendering greatly speeds up the process. If offline-rendering was not to be used then there is no reason for such a script. You can always do the whole thing manually.
You can't use offline-rendering with external FX because they don't "live" in your CPU. This is not a problem of this script, but how things are.

Quote:
Originally Posted by MCCY View Post
... just curious, any chance for automatic renaming?
Not for the time being... Maybe this could help?..
amagalma is offline   Reply With Quote
Old 06-08-2020, 02:32 AM   #34
MCCY
Human being with feelings
 
Join Date: Apr 2009
Posts: 303
Default Found out, why several plugs don't work

Hi!
Just in this minute I figured out, how to get IR´s from my beloved IRCAM VERBv3. I just use this to pimp my CELLO/VIOLIN IRs and sounds soooo sweet.

You just have to add a tiny bit of (in my case pink) noise with reapers JS plug. -90dB was enough, I'll try with even less.
Somehow this verb (on purpose?) does not react on a short impulse :-)

YEYEAH!
MCCY is offline   Reply With Quote
Old 06-08-2020, 03:59 AM   #35
Nixon
Human being with feelings
 
Nixon's Avatar
 
Join Date: Dec 2011
Posts: 294
Default

Hey amagalma thanks for this great script
I think I have a linux specific bug :

Action Aborted / Cannot create wave file!


I'm on mx linux 19.2
Nixon is offline   Reply With Quote
Old 06-08-2020, 04:37 AM   #36
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by Nixon View Post
Hey amagalma thanks for this great script
I think I have a linux specific bug :

Action Aborted / Cannot create wave file!

I'm on mx linux 19.2
Could you open/edit the script and go to line 43 and change it to:
Code:
local debug = true
Then run it again and post me the what is shown in the console. Thanks!
amagalma is offline   Reply With Quote
Old 06-08-2020, 07:18 AM   #37
Nixon
Human being with feelings
 
Nixon's Avatar
 
Join Date: Dec 2011
Posts: 294
Default

Of course:

=== Script is in debug mode ===

IR full path will be: /home/nico/Documents/REAPER Media/tal IR.wav
Maximum length of IR will be 5
Normalize Peak to -0.4
Trim Silence Below -100
Channels: Stereo
Locate in Explorer enabled
Load in Reaverb enabled
========================

Create Dirac failed. Aborted.



as a side note this folder doesn't exist here
Nixon is offline   Reply With Quote
Old 06-08-2020, 08:26 AM   #38
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

A few more questions:

1) Did you "Browse for File", did you manually change the name, or did you leave it as it was?
2) In your Reaper Preferences/General/Paths, is there set a default recording path? If yes, is it the same? Does it exist?
3) Did you run the script with a saved project or an un-saved one?

And last, could you try this code (save as a new lua script and run) on a new unsaved project and tell me what does it show? :
Code:
proj_path = reaper.GetProjectPath("")
reaper.ShowConsoleMsg(proj_path.. "\n")
Thanks!
amagalma is offline   Reply With Quote
Old 06-29-2020, 07:20 AM   #39
Nixon
Human being with feelings
 
Nixon's Avatar
 
Join Date: Dec 2011
Posts: 294
Default

Hey Amagalma, sry for the late reply.

When i executed the filepath script i recognized that when previously testing I didn't have saved the project (I see now this is question 3). When i tested the IR script with a saved project there was no problem with creating the IR file


The filepath in linux for an unsaved project shows in reaperconsole:

/home/username/Documents/REAPER Media

where username is my pcname

2) The default recording path is unchanged

1) I checked again with an unsaved project and even if I change the IR name the script can't create a file


I saved a project with spaces in the projectname to see if this makes a difference but everything works:

=== Script is in debug mode ===

IR full path will be: /home/nico/Desktop/Audio/space test/Audio/IR.wav
Maximum length of IR will be 5
Normalize Peak to -0.4
Trim Silence Below -100
Channels: Stereo
Locate in Explorer enabled
Load in Reaverb enabled
========================

Create Dirac succeded. Item is: userdata: 0x6a8bbc0
Applied FX. Render path is: /home/nico/Desktop/Audio/space
test/Audio/319305 render 001.wav
Normalized to -0.4 dB
Trim Silence succeeded
Glued. New item is: userdata: 0x6a8bbc0
Renamed /home/nico/Desktop/Audio/space test/Audio/319305 render
001-glued.wav TO /home/nico/Desktop/Audio/space test/Audio/IR.wav
Deleted /home/nico/Desktop/Audio/space test/Audio/319305.wav
Deleted /home/nico/Desktop/Audio/space test/Audio/319305 render 001.wav


Created IR:
-- /home/nico/Desktop/Audio/space test/Audio/IR.wav --


Script ended with no problems
==============================
Nixon is offline   Reply With Quote
Old 06-30-2020, 05:24 PM   #40
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

So the problem is when the project is unsaved?


Does this path exist in your system?
/home/username/Documents/REAPER Media
amagalma 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 10:39 PM.


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