|
|
|
02-18-2019, 07:53 AM
|
#1
|
Human being with feelings
Join Date: Jul 2014
Location: London
Posts: 739
|
Input FX shortcut
Guys, are there any scripts to put plugins on the Input FX chain?
Specifically, I want to put a simple transpose MIDI JS plugin on the selected track.
Is there a way to adapt X-Raym's code here...?
Code:
--[[
* ReaScript Name: Insert FX
* Description: Insert FX on selected tracks. FX name is can be edited witing the script code.
* Instructions: Run
* Screenshot:
* Author: X-Raym
* Author URI: http://extremraym.com
* Repository: GitHub > X-Raym > EEL Scripts for Cockos REAPER
* Repository URI: https://github.com/X-Raym/REAPER-EEL-Scripts
* File URI:
* Licence: GPL v3
* Forum Thread:
* Forum Thread URI:
* REAPER: 5.0
* Extensions: None
* Version: 1.0
--]]
reaper.Undo_BeginBlock()
FX = "Decapitator (SoundToys)"
TrackIdx = 0
TrackCount = reaper.CountSelectedTracks(0)
while TrackIdx < TrackCount do
track = reaper.GetSelectedTrack(0, TrackIdx)
fxIdx = reaper.TrackFX_GetByName (track, FX, 1)
isOpen = reaper.TrackFX_GetOpen(track, fxIdx)
if isOpen ==0 then
isOpen = 1
else
isOpen = 0
end
reaper.TrackFX_SetOpen(track, fxIdx, isOpen)
TrackIdx =TrackIdx+1
end
reaper.Undo_EndBlock("Insert FX Plugin",-1)
Thanks
|
|
|
02-18-2019, 11:16 AM
|
#2
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
TrackFX_AddByName should do the trick, see REAPER API documentation for more info.
Code:
-- Add FX to Input FX chain
local jsfx_filename = 'midi_transpose' -- "JS: MIDI Transpose Notes"
local track = reaper.GetSelectedTrack(0, 0)
if track then
reaper.Undo_BeginBlock()
local retval = reaper.TrackFX_AddByName(track, jsfx_filename, true, 1)
if retval == -1 then reaper.MB("Failed, check filename, etc," , "ERROR", 0) end
reaper.Undo_EndBlock("Add FX plugin to input", -1)
end
Last edited by Edgemeal; 02-18-2019 at 09:19 PM.
|
|
|
02-18-2019, 02:58 PM
|
#3
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
CHeck in my code the line
FX = "Decapitator (SoundToys)"
This is what you need to modify. Just put the name of your FX there. Not sure for JS if you need to add JS: prefix or not.
|
|
|
02-18-2019, 09:17 PM
|
#4
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
Quote:
Originally Posted by X-Raym
CHeck in my code the line
FX = "Decapitator (SoundToys)"
This is what you need to modify. Just put the name of your FX there. Not sure for JS if you need to add JS: prefix or not.
|
OP wants the FX on the Input FX chain.
|
|
|
02-18-2019, 11:49 PM
|
#5
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@edgemeal
Oops, missed it ^^
|
|
|
02-19-2019, 05:24 AM
|
#6
|
Human being with feelings
Join Date: Jul 2014
Location: London
Posts: 739
|
Tremendous - thank you. I can kinda get my head around how that's working.
Any way of adding a preset into that mix? Or parameter change?
Ultimately, this is a solution to needing to transpose the MIDI keyboard to reach keyswitches and notes that extend below A-1 and above C7. Stupid 88 key keyboard doesn't transpose
Cheers
Quote:
Originally Posted by Edgemeal
TrackFX_AddByName should do the trick, see REAPER API documentation for more info.
Code:
-- Add FX to Input FX chain
local jsfx_filename = 'midi_transpose' -- "JS: MIDI Transpose Notes"
local track = reaper.GetSelectedTrack(0, 0)
if track then
reaper.Undo_BeginBlock()
local retval = reaper.TrackFX_AddByName(track, jsfx_filename, true, 1)
if retval == -1 then reaper.MB("Failed, check filename, etc," , "ERROR", 0) end
reaper.Undo_EndBlock("Add FX plugin to input", -1)
end
|
|
|
|
12-31-2019, 06:09 PM
|
#7
|
Human being with feelings
Join Date: Aug 2009
Posts: 1,199
|
Thanks for this! Any way to create a Reaper Action for "toggle Input FX window"? Or even "Close Input FX" window? (You can VIEW it, but you can't CLOSE it via a shortcut).... I would LOVE to do that... thanks!
Last edited by themixtape; 12-31-2019 at 06:15 PM.
|
|
|
12-31-2019, 06:40 PM
|
#8
|
Human being with feelings
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
|
reaper.TrackFX_Show(MediaTrack track, integer index, integer showFlag)
showflag=0 for hidechain, =1 for show chain(index valid), =2 for hide floating window(index valid), =3 for show floating window (index valid)
|
|
|
12-31-2019, 06:48 PM
|
#9
|
Human being with feelings
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
|
I think? that reaper.TrackFX_AddByName returns the index position of the added effect, if successful. I'm not at my computer right now.
If it does you can just input that number into the TrackFX_Show function.
There should be a few ways to skin this particular cat..
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:21 PM.
|