Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 10-21-2022, 04:25 AM   #1
soulaccess
Human being with feelings
 
soulaccess's Avatar
 
Join Date: Jul 2012
Posts: 43
Default API: TrackFX_AddByName() ignores default settings

AFAICT when inserting a JS Effect with TrackFX_AddByName() the "Default settings for new instances" are ignored. Oversampling is set to "no oversampling" and embedded UI to "no"
This only happens with JS Plugins, it works as expected with VST Plugins.

Steps to recreate:
- in the FX Browser right-click the Plugin "JS: Distortion" and set "Default settings for new instances" > "FX instance oversampling" to "Oversample up to [...]"
- select a track and execute LUA code (below)
- check the track with the instantiated Plugin, oversampling will be set to "no oversampling"

Code:
track = reaper.GetSelectedTrack2(0, 0, true)
reaper.TrackFX_AddByName(track,"JS:Distortion",false,-1)

Last edited by soulaccess; 12-12-2022 at 02:23 AM.
soulaccess is offline   Reply With Quote
Old 10-21-2022, 02:11 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,756
Default

Looking at a fix for this, thanks!

As a workaround, you can use "JS:guitar/distortion" instead (include the relative path).
Justin is offline   Reply With Quote
Old 11-22-2022, 01:49 PM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,271
Default

this update in 6.70 doesn't seem to work well. it has broken many scripts for me. I'm investigating what's going on.
it works on Linux but returns -1 on Windows
Code:
reaper.TrackFX_AddByName(track, "JS:Loudness Meter Peak/RMS/LUFS (Cockos)", false, -1)
and this also seems affected. it works on Linux but returns -1 on Windows
Quote:
reaper.TrackFX_GetByName(track, "JS:Loudness Meter Peak/RMS/LUFS (Cockos)", false)
heda is offline   Reply With Quote
Old 11-23-2022, 01:03 AM   #4
soulaccess
Human being with feelings
 
soulaccess's Avatar
 
Join Date: Jul 2012
Posts: 43
Default

Code:
reaper.TrackFX_AddByName(track, "JS:Loudness Meter Peak/RMS/LUFS (Cockos)", false, -1)
@heda: Yes you are right, there are now some inconsistencies with TrackFX_AddByName - sorry I missed that.

Your specific example works for me on Mac Mojave, but here this happens:
Pre 6.70: TrackFX_AddByName used to work when passing the name defined in the "desc:"-tag of the FX .
Now you must pass the actual filename of the FX for it to work and even then it fails for some FX.
Sorry I can't be more specific, as I haven't yet found a reliable pattern for which the call fails.

EDIT: I just tested on a fresh portable install and I can't reproduce the problem there.

AND weirdly enough, in the regular install, inside the "Effects" folder I have a folder called "js_plugins" (I think it contains witty's plugins) - now, when I delete this folder everything works fine again. The "js_plugins" contains some .wav, .txt, .rpl, .png and JS files in a bunch of folders.

EDIT 2: I tested some more and found that the .png files are causing the problem. When I delete the .png files inside "Effects/js_plugins/witti" then everything works fine here.

Last edited by soulaccess; 11-23-2022 at 03:41 AM.
soulaccess is offline   Reply With Quote
Old 12-09-2022, 04:25 AM   #5
Hypex
Human being with feelings
 
Join Date: Mar 2015
Location: Australia
Posts: 454
Default

I just found TrackFX_AddByName() has broken behaviour for me. I wrote a test script that uses TrackFX_AddByName() to open up some FX on the master track. I ran it before and a blank FX appeared. :-?


The FX imports functions from another file. The FX file has no extension. The support file has a jsfx-inc extension.



I opened up the FX in the IDE and found it only loaded the support file. So there is some bug that is opening the wrong file. I open up the file by name but it seems to only load the support file,


Reaper v6.71/Linux x64.


I've noticed lately strange behaviour in scripts. Ones that should run and exit are still running in background. For example scripts that call ShowMessageBox() then exit seem to be in a defer() state.
Hypex is offline   Reply With Quote
Old 12-09-2022, 07:08 AM   #6
soulaccess
Human being with feelings
 
soulaccess's Avatar
 
Join Date: Jul 2012
Posts: 43
Default

Quote:
Originally Posted by Hypex View Post
I just found TrackFX_AddByName() has broken behaviour for me.
The devs made changes to that function in v6.72rc3 - I didn‘t have time to test it yet, but I would give it a shot.

Quote:
Originally Posted by Triode View Post
v6.72rc3 - December 8 2022
  • + ReaScript: improve JSFX name matching in TrackFX_AddByName() [p=2621360]
soulaccess is offline   Reply With Quote
Old 12-10-2022, 05:13 AM   #7
Hypex
Human being with feelings
 
Join Date: Mar 2015
Location: Australia
Posts: 454
Default

Quote:
Originally Posted by soulaccess View Post
The devs made changes to that function in v6.72rc3 - I didn‘t have time to test it yet, but I would give it a shot.

I read that. I just updated it recently. So think I will wait until the next official is out.
Hypex is offline   Reply With Quote
Old 12-12-2022, 02:21 AM   #8
soulaccess
Human being with feelings
 
soulaccess's Avatar
 
Join Date: Jul 2012
Posts: 43
Default

Just tested with v6.72rc5 - unfortunately this does not fix the problem. when I use the full filename it works, but with the name defined in the desc: tag of the fx it doesn't.

Last edited by soulaccess; 12-12-2022 at 02:30 AM.
soulaccess is offline   Reply With Quote
Old 12-12-2022, 04:37 AM   #9
Hypex
Human being with feelings
 
Join Date: Mar 2015
Location: Australia
Posts: 454
Default

Thanks for testing.
Hypex is offline   Reply With Quote
Old 12-22-2022, 06:35 AM   #10
Hypex
Human being with feelings
 
Join Date: Mar 2015
Location: Australia
Posts: 454
Default

Quote:
Originally Posted by soulaccess View Post
Just tested with v6.72rc5

I tested the final 6.72 release and for me the problem is fixed.
Hypex is offline   Reply With Quote
Old 12-22-2022, 08:15 AM   #11
soulaccess
Human being with feelings
 
soulaccess's Avatar
 
Join Date: Jul 2012
Posts: 43
Default

Quote:
Originally Posted by Hypex View Post
I tested the final 6.72 release and for me the problem is fixed.
Yes, for me too - since 6.72rc7
soulaccess 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 02:36 AM.


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