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

Reply
 
Thread Tools
Old 11-24-2023, 07:38 AM   #1
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,523
Default [SOLVED] TrackFX_AddByName: JS effects can not be added after updating REAPER

After updating REAPER (to any version?) you can not add JS effects through API.

This returns -1:
Code:
reaper.TrackFX_AddByName(track, 'JS:Distortion', 0, -1)
until you open a "Add FX" window (which apparently triggers a JS effect re-scan?).

Tested on Linux.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi

Last edited by FeedTheCat; 11-24-2023 at 08:11 AM.
FeedTheCat is online now   Reply With Quote
Old 11-24-2023, 07:52 AM   #2
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,949
Default

Yeah since you need to build the database first (which is triggered by ADD FX")
Been like this forever.
Sexan is offline   Reply With Quote
Old 11-24-2023, 08:01 AM   #3
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,523
Default

Quote:
Originally Posted by Sexan View Post
Yeah since you need to build the database first (which is triggered by ADD FX")
Been like this forever.
Hmm, so what's the workaround? Running "View: Show FX browser window" twice?
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 11-24-2023, 08:02 AM   #4
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,949
Default

Maybe you can call EnumerateFX? maybe that will trigger rescan also
Sexan is offline   Reply With Quote
Old 11-24-2023, 08:10 AM   #5
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,523
Default

Quote:
Originally Posted by Sexan View Post
Maybe you can call EnumerateFX? maybe that will trigger rescan also
Thanks, that works!
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 11-24-2023, 08:12 AM   #6
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,949
Default

Oh nice! Was just a hunch since my script does that on startup (in order to populate its internal FX BROWSER) and does not suffer from this issue

EDIT: But beware of very long fx list it will take a while... (I do caching after first run). I guess checking if jsfx.ini is populated in your case is the best solution here
Sexan is offline   Reply With Quote
Old 11-24-2023, 08:32 AM   #7
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,523
Default

Quote:
Originally Posted by Sexan View Post
EDIT: But beware of very long fx list it will take a while... (I do caching after first run). I guess checking if jsfx.ini is populated in your case is the best solution here
You don't have to go through the whole list, this worked for me:

Code:
local fx = reaper.TrackFX_AddByName(track, name, is_input, instantiate)
if fx < 0 then
    reaper.EnumInstalledFX(0)
    fx = reaper.TrackFX_AddByName(track, name, is_input, instantiate)
end
I marked this thread as solved, but I guess it would still be nice if reaper.TrackFX_AddByName itself checked whether the database is built or not. (or better even if REAPER just rebuilds the JS database after updating). I've had this issue for months now but couldn't pinpoint what was causing it.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 11-24-2023, 08:51 AM   #8
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,949
Default

BTW EnumerateFX is V7 exclusive api
Sexan is offline   Reply With Quote
Old 11-24-2023, 11:41 AM   #9
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,223
Default

Two related things here:


1) the JS finding by filename is/was case-sensitive on Linux but not on other OSes. Changing this.
2) generating the JSFX name/filename translation cache is/was done on demand rather than at startup. Changing this too.
Justin is offline   Reply With Quote
Old 11-24-2023, 08:16 PM   #10
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,523
Default

Quote:
Originally Posted by Justin View Post
Two related things here:


1) the JS finding by filename is/was case-sensitive on Linux but not on other OSes. Changing this.
2) generating the JSFX name/filename translation cache is/was done on demand rather than at startup. Changing this too.
Great, thanks!
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is online now   Reply With Quote
Old 11-24-2023, 11:55 PM   #11
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,572
Default

Quote:
Originally Posted by Justin View Post
Two related things here:


1) the JS finding by filename is/was case-sensitive on Linux but not on other OSes. Changing this.
2) generating the JSFX name/filename translation cache is/was done on demand rather than at startup. Changing this too.
Can you please also add a feature to rename JSFX from FX browser like other plugin formats do? Primary for #hiding purpose because now there is no easy and fast way to temporarily hide some JSFX.
Daodan is offline   Reply With Quote
Reply

Thread Tools

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:09 PM.


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