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

Reply
 
Thread Tools Display Modes
Old 11-27-2020, 04:25 PM   #1
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default How does reaper come up with the filename for preset.ini files?

It's basically the vst name, but when I query an instantiation of Kontakt for its name using TrackFX_getFXname in the API, I get:

"VSTi: Kontakt (Native Instruments GmbH) (64 out)"

That's a clumsy string to use as a file name. Is there a reliable way to just get the 'Kontakt' part?
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 11-27-2020, 05:06 PM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,108
Default

BR_TrackFX_GetFXModuleName (needs SWS installed), then you could strip out the suffix (e.g. .dll).
nofish is offline   Reply With Quote
Old 11-27-2020, 07:00 PM   #3
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Sounds like just the ticket, thanks!
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-02-2020, 01:34 PM   #4
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

I'm getting this error...

'reaper.BR_TrackFX_GetFXModuleName': expected 4 arguments minimum

But in the api, it only has 2 arguments...
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-02-2020, 02:10 PM   #5
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,431
Default

Quote:
Originally Posted by woodslanding View Post
I'm getting this error...

'reaper.BR_TrackFX_GetFXModuleName': expected 4 arguments minimum

But in the api, it only has 2 arguments...
Yes that is strange. The C and Python calls ave four parameters, the EEL call has three, but the Lua call only has two. Maybe there is an issue with the Lua binding.

Try a Lua call with four parameters, something like:
Code:
retval, name = reaper.BR_TrackFX_GetFXModuleName(track, 0, "", 0)
If that fails, also try with a variable as the last parameter.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is online now   Reply With Quote
Old 12-02-2020, 06:10 PM   #6
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,108
Default

^^ That's improved since SWS v2.12.0 pre-release

Quote:
Allow omitting the buffer/buffer_sz arguments of the following functions in Lua:
- BR_TrackFX_GetFXModuleName
- CF_EnumerateActions
- CF_GetClipboard
- CF_GetMediaSourceRPP
- CF_GetSWSVersion
- NF_ReadID3v2Tag
- NF_TakeFX_GetFXModuleName
- SNM_ReadMediaFileTag
In the current official version the last argument actually specifies the text buffer size, so something like this should work:
Code:
retval, name = reaper.BR_TrackFX_GetFXModuleName(track, 0, "", 64)
nofish is offline   Reply With Quote
Old 12-02-2020, 08:36 PM   #7
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Boy, does that ever not work!

First time a script has crashed reaper itself.... when you say a variable, I assume I shouldn't set it to anything?
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-02-2020, 08:38 PM   #8
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Quote:
Originally Posted by nofish View Post
^^ That's improved since SWS v2.12.0 pre-release



In the current official version the last argument actually specifies the text buffer size, so something like this should work:
Code:
retval, name = reaper.BR_TrackFX_GetFXModuleName(track, 0, "", 64)
Ahh, that seems to work, thanks!!
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding 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 01:05 PM.


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