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

Reply
 
Thread Tools Display Modes
Old 08-15-2022, 07:31 PM   #1
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,637
Default Is it possible to detect virtual instrument in take FX in ReaScript?

I need to detect whether a virtual instrument is present in a Take FX chain.

On tracks, we can use TrackFX_GetInstrument(). But there is no TakeFX_GetInstrument(). I don't think it's an FX param we can get that will tell us this, right? Any ideas? Or is this just missing from the API at present?
MonkeyBars is online now   Reply With Quote
Old 08-15-2022, 11:51 PM   #2
pcp
Human being with feelings
 
pcp's Avatar
 
Join Date: Oct 2021
Location: Singapore
Posts: 182
Default

Good question, I can't see any scripts that do this and it doesn't look like it's documented in the API. I just made a midi script that uses instrument tracks only but I guess it wouldn't pick up on take FX.

Maybe could do it using xrayms rpp parser?

I find the definition of an instrument a bit unreliable anyway, as I use things like vocoders and pitch tracking effects that use midi note input but don't identify as a vst instrument. I wonder if it's possible somehow to get all the track and take FX that listen for midi notes?
pcp is offline   Reply With Quote
Old 08-16-2022, 12:05 AM   #3
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Couldn't find GetInstrument for takes.
Not sure, but will this be helpful?
https://forum.cockos.com/showthread.php?t=259355
You can get fx_type and if it ends with "i", it's your instrument.
vitalker is offline   Reply With Quote
Old 08-16-2022, 09:14 AM   #4
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,637
Default

Quote:
Originally Posted by vitalker View Post
Couldn't find GetInstrument for takes.
Not sure, but will this be helpful?
https://forum.cockos.com/showthread.php?t=259355
You can get fx_type and if it ends with "i", it's your instrument.
Thanks so much for this clever idea! It should definitely work until someone has the bright idea to add an fx type that ends in "i" lol
MonkeyBars is online now   Reply With Quote
Old 08-16-2022, 09:36 AM   #5
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Quote:
Originally Posted by MonkeyBars View Post
Thanks so much for this clever idea! It should definitely work until someone has the bright idea to add an fx type that ends in "i" lol
It should be case-sensitive then. Every type has only capital letters.
vitalker is offline   Reply With Quote
Old 08-16-2022, 09:54 AM   #6
pcp
Human being with feelings
 
pcp's Avatar
 
Join Date: Oct 2021
Location: Singapore
Posts: 182
Default

Clever but not sure how you'd extend this past vsts. GetInstrument works on CLAP plugins like Vital or JSFX like ReaRack so they must have some identifier that REAPER is picking up... Somewhere...
pcp is offline   Reply With Quote
Old 08-16-2022, 11:13 AM   #7
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,336
Default

Quote:
Originally Posted by pcp View Post
Clever but not sure how you'd extend this past vsts. GetInstrument works on CLAP plugins like Vital or JSFX like ReaRack so they must have some identifier that REAPER is picking up... Somewhere...
This method works with any type. Instruments has i in the type like CLAPi, VSTi, AUi etc. Instrument is a plugin that has MIDI inputs, but in Reaper you can make any plugin (except JS) an instrument. Right-click a plugin in FX browser and choose Rename. There will be a checkbox to make plugin an instrument.
vitalker is offline   Reply With Quote
Old 08-16-2022, 11:41 AM   #8
pcp
Human being with feelings
 
pcp's Avatar
 
Join Date: Oct 2021
Location: Singapore
Posts: 182
Default

Oh nice, that's so straightforward then!

And now I see the 'i' in [CLAPi]...
pcp 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:00 PM.


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