|
|
|
04-02-2018, 12:52 PM
|
#361
|
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
How do I execute some code at the project load/switch?
I was using fixed arrays of 1024 elements to store tracks data (mute/pan/vol/etc) and decided to switch to vector of objects, with a single object for each track, containing the necessary data.
I've also added a resize vector method into the Run() function and in every function, that is called by Reaper (there are bunch of them already in the example).
It was going fine until I've tried to load an existing project. Reaper then crashed with vector subscript out of range error.
I guess, resize should also be executed at the project loading or switching to another project's tab, but I don't know ho do I track it. Any help would be appreciated.
UPD. For some unknown reason, Reaper was calling track related function even when there weren't any tracks in the project, so it was giving the track number -1, which lead to crash, when the plugin tried to write track's vol/pan/etc state into the vector at index '-1'.
I don't know why does reaper_plugin.h calls those functions for track -1, so I've simply added a check, if the tracks number is zero or positive.
Last edited by fundorin; 04-02-2018 at 01:41 PM.
|
|
|
05-04-2018, 05:17 PM
|
#362
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,458
|
When I call the following:
Code:
-- Fetch all the tracks
for i=0,tracks-1 do
local track = reaper.GetTrack(project, i)
local ret, name = reaper.GetTrackName(track, " ")
if ( name ~= "MASTER" ) then
local sendidx = reaper.CreateTrackSend(track, spectroTrack)
local sn = reaper.SetTrackSendInfo_Value(track, 0, sendidx, "I_DSTCHAN", 2*i)
end
end
it seems that SetTrackSendInfo_Value doesn't actually create "new" audio channels. It only works for the ones that already exist 1/2, 3/4, 5/6. What's also interesting is that if I go to that track, and I try to add them manually, it still doesn't give me the options 7/8 and higher until I've fiddled around with all the inputs made by the script.
Is it possible to create new audio dest channels from lua (preferably without SWS)?
|
|
|
05-05-2018, 12:21 AM
|
#363
|
Human being with feelings
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 797
|
I think adding the following before loop
Code:
reaper.SetMediaTrackInfo_Value(spectroTrack, "I_NCHAN", tracks*2)
should do the trick
|
|
|
05-05-2018, 04:02 AM
|
#364
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,458
|
Quote:
Originally Posted by azslow3
I think adding the following before loop
Code:
reaper.SetMediaTrackInfo_Value(spectroTrack, "I_NCHAN", tracks*2)
should do the trick
|
Thanks man, it did!
|
|
|
05-17-2018, 08:39 PM
|
#365
|
Human being with feelings
Join Date: Apr 2016
Posts: 39
|
Is there a way to get a mouse left click or any click event outside of a gfx window? (preferably without having to instantiate a window at all) As far as I've seen in the API there isn't a way to do this. I'm looking to run code between mouse down and up events within the reaper arrange window.
I'm looking more into python which seems to have some libraries to help, but I'm really hoping to keep this script in lua or eel.
|
|
|
07-07-2018, 03:14 PM
|
#366
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
How do I get the "pin" icon in the top right hand corner to keep my window (generated from reaper extension" on top?
thanks
oli
|
|
|
07-07-2018, 07:59 PM
|
#367
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
|
SWS does it with the undocumented API function AttachWindowTopmostButton when handling WM_INITDIALOG. It's not included in reaper_plugin_functions.h.
Code:
void (*AttachWindowTopmostButton)(HWND hwnd);
|
|
|
07-08-2018, 05:27 AM
|
#368
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
thanks!
|
|
|
08-25-2018, 11:52 AM
|
#369
|
Human being with feelings
Join Date: Nov 2006
Location: Finland
Posts: 1,528
|
In short, I can't get a graphical slider to run commands in the @slider section in a JS plugin. I expected the slider_automate(sliderX) to do just that. Was I wrong?
In detail:
I have a graphical slider that I wish to use to adjust a basic JS slider1. The slider1 itself adjusts fine, but I can't get it to run the commands in the @slider section.
Say the graphical slider adjusts a parameter called "gfxslider". Even if:
Code:
@slider
parameter1 = slider1;
...
@gfx
slider1 != gfxslider ? (
slider1 = gfxslider;
slider_automate(slider1);
);
The last part can be in @block or @sample, same result, slider1 changes but "parameter1" does not. Only way I've found is to have the "parameter1 = slider1" command in @block, @sample or @gfx instead of the @slider section.
__________________
______ Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
|
|
|
08-25-2018, 01:27 PM
|
#370
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Rather obviously @slider is only called when a slider is modified from outside the JSFX code.
You might try to do a function that contains what you want to do in @slider and do something like
Code:
@init
function do_slider() (
parameter1 = slider1;
);
@slider
do_slider();
@gfx
slider1 != gfxslider ? (
slider1 = gfxslider;
do_slider();
);
|
|
|
08-25-2018, 02:12 PM
|
#371
|
Human being with feelings
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
|
Hey guys,
Is it possible to use the SWS marque zoom tool with a mouse modifier and NOT the middle mouse button drag? I find that this middle click often messes up with my mouse moving the wheel by accident. This mouse also has left right move for the middle button so it also messes up the middle drag.
I'd like to use the SWS Zoom tool exactly as is works by default but with right button drag rather than middle click.
is it possible?
Yes, I've tried the action menu but this way it introduces an on/off state and you need mutiple clicks. I've also tried Autohotkey to disable my left/right middle button triggers but it doesnt help since the middle click is considered released
Last edited by D Rocks; 08-25-2018 at 02:22 PM.
|
|
|
08-25-2018, 02:44 PM
|
#372
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Marquee zoom is also available as Mouse modifier, Arrange view -> right drag.
Wouldn't that do as substitute ?
edit:
I don't think Reaper's native marquee zoom has the undo functionality SWS zoom tool has though, so probably not a full substitute.
Last edited by nofish; 08-25-2018 at 03:12 PM.
|
|
|
08-25-2018, 03:06 PM
|
#373
|
Human being with feelings
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
|
yes it works but the only problem I didnt find how to manage is that this zoom is not considered as an undo step for the SWS undo zoom.
I don't want the SWS to undo MouseWheel zoom steps cause its a waste of time, but lets say I use the Reaper Marquee zoom, it will be ignored fro the undo history. This is the only thing that makes me absolutely want to use the SWS marquee instead.
thanks for reply
|
|
|
08-25-2018, 03:19 PM
|
#374
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Ah right, I edited my post before I saw yours, didn't think about the special undo zoom feature in SWS zoom tool at first.
I don't know if it's possible to use it in any other way than middle mouse button though (that's how I use it), sorry.
|
|
|
08-25-2018, 06:47 PM
|
#375
|
Human being with feelings
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
|
No prob man theres alot of little details making this feature great. Thanks for taking time.
Any other insights?
|
|
|
09-06-2018, 12:57 AM
|
#376
|
Human being with feelings
Join Date: Jul 2011
Posts: 59
|
How to set value of plugin parameter displayed as TCP FX?
Hello guys,
is there an easy way how to set value for parameter displayed in TCP FX?
I have noticed functions CountTCPFXParms and GetTCPFXParm but nothing for setting value.
Any help is greatly appreciated!
|
|
|
09-06-2018, 09:58 AM
|
#377
|
Human being with feelings
Join Date: Dec 2017
Posts: 83
|
Perhaps TrackFX_SetParam
|
|
|
09-06-2018, 11:48 AM
|
#378
|
Human being with feelings
Join Date: Jul 2011
Posts: 59
|
Ah, I checked once more documentation for GetTCPFXParm - I did not realize it returns fx index and parameter index.
TrackFX_SetParam is the correct function, then.
Thanks.
|
|
|
09-18-2018, 06:25 AM
|
#379
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,458
|
I'm not sure if I'm using this command correctly but TrackFX_AddByName( track, fxname, recFX, instantiate ) doesn't seem to work for me for JSFX or VSTs with spaces in the name. I always figured it took the same name as in the search field, but I guess it doesn't?
What should I use here?
|
|
|
10-02-2018, 04:42 PM
|
#380
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,458
|
If anyone runs into the previous issue in the future. Seems that for JSFX it takes filenames... not sure why.
I have a new question though. How do I get the true length of an item (not the length on the arranger)? When stretching a MIDI or audio item, the item repeats and these notches appear. Is there a way to poll how long an item actually is (not D_LENGTH) in seconds from lua?
|
|
|
11-14-2018, 03:53 PM
|
#382
|
Human being with feelings
Join Date: Mar 2010
Location: Germany
Posts: 12
|
how do I: get item name in LUA
Hey there.
Total n00b here.
I need to get the item name in LUA.
It's for an action that will run on said item.
Can anyone help, please?
|
|
|
11-14-2018, 06:36 PM
|
#383
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
|
Items don't have names themselves. You're probably looking for the take name which you can obtain using reaper.GetSetMediaItemTakeInfo_String. You can get the current take of an item using reaper.GetActiveTake.
|
|
|
11-20-2018, 06:29 PM
|
#384
|
Human being with feelings
Join Date: Sep 2012
Location: Alabama
Posts: 434
|
Script multiple item property changes on all selected items ?
OK so I have a set of actions I execute pretty regularly when prepping a mix. I normally do these by selecting a set of items to change, then using the Item Properties window:
- change item length to a value (0:0.045 normally, sometimes 0:0.040)
- change fade-in type to Type 5(the really steep up ramp)
- change fade-out type to Type 5 (the really steep down ramp)
- change fade-out length to a value, usually 0:0.020
- change fade-in length to 0:0.001
As you can guess, this gets annoyingly repetitive.
Do you think there is a way to create a custom action or script to execute all of these on the selected set of items ?
Total script newb so I have no idea where to start or even where to put a script to execute in Reaper!
TIA!
Brian
__________________
PRS 2014 Brushstroke 24 / PRS 2008 Custom 24 / Axe-FX 2
Reaper / RME HDSP Multiface 1 / Tannoy 502s / Monoprice 10" Subwoofer
Hughes and Kettner Tubemeister 18 and 1x12 cab
|
|
|
11-21-2018, 09:24 AM
|
#385
|
Human being with feelings
Join Date: Mar 2010
Location: Germany
Posts: 12
|
Quote:
Originally Posted by cfillion
Items don't have names themselves. You're probably looking for the take name which you can obtain using reaper.GetSetMediaItemTakeInfo_String. You can get the current take of an item using reaper.GetActiveTake.
|
Lol omg, that's why I was so lost. I kept looking for an item name.
Thanks, Cfillion!
|
|
|
11-21-2018, 09:48 AM
|
#386
|
Human being with feelings
Join Date: Mar 2010
Location: Germany
Posts: 12
|
Quote:
Originally Posted by Rusty Falcon
OK so I have a set of actions I execute pretty regularly when prepping a mix. I normally do these by selecting a set of items to change, then using the Item Properties window:
- change item length to a value (0:0.045 normally, sometimes 0:0.040)
- change fade-in type to Type 5(the really steep up ramp)
- change fade-out type to Type 5 (the really steep down ramp)
- change fade-out length to a value, usually 0:0.020
- change fade-in length to 0:0.001
As you can guess, this gets annoyingly repetitive.
Do you think there is a way to create a custom action or script to execute all of these on the selected set of items ?
Total script newb so I have no idea where to start or even where to put a script to execute in Reaper!
TIA!
Brian
|
I believe you can do most of what you need by creating a Custom Action. If you want total automation, ie, no user input at all you can edit the original actions and hard code the values in it.
I suggested you have a look at "X-Raym_Set selected items fade-in fade-out length.lua"
Then after you hard code your values in it you can create a Custom Action that plays your edited version of the above script followed by "Item: Set fade-in shape to type 5"
Hope it helps.
|
|
|
11-21-2018, 02:44 PM
|
#387
|
Human being with feelings
Join Date: Sep 2012
Location: Alabama
Posts: 434
|
Quote:
Originally Posted by Havokmann
I believe you can do most of what you need by creating a Custom Action. If you want total automation, ie, no user input at all you can edit the original actions and hard code the values in it.
I suggested you have a look at "X-Raym_Set selected items fade-in fade-out length.lua"
Then after you hard code your values in it you can create a Custom Action that plays your edited version of the above script followed by "Item: Set fade-in shape to type 5"
Hope it helps.
|
Thank you Havokmann. I found the X-Raym scripts location on GitHub and the fade-in fade-out script itself. Thanks for the pointer!
I ended up creating a Custom Action for myself consisting of in turn:
SWS: Set selected items length... (in seconds so I enter for example 0.045)
Item: Set fade-in shape to type 5
Item: Set fade-out shape to type 5
Script: X-Raym_Set selected items fade-in fade-out length.lua
Works a charm and saves me a ton of time using the Item Properties editor and bouncing between text entry and menu selections!
Thanks again!
Brian
__________________
PRS 2014 Brushstroke 24 / PRS 2008 Custom 24 / Axe-FX 2
Reaper / RME HDSP Multiface 1 / Tannoy 502s / Monoprice 10" Subwoofer
Hughes and Kettner Tubemeister 18 and 1x12 cab
Last edited by Rusty Falcon; 11-22-2018 at 09:22 PM.
Reason: More info
|
|
|
11-24-2018, 03:17 AM
|
#388
|
Human being with feelings
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
|
How do I make my Lua script dockable?
Yes HOW do I do it?
Have built script with Lokassenas GUI and found in a thread
that it didn't support docking - how can I fix this?
Regards
TompaD
|
|
|
11-24-2018, 11:56 AM
|
#389
|
Human being with feelings
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
|
How do I get cmdID from Actionlist
Hi!
I know I can open Actionlist from a reascript, but how do I
get the selected actions cmdID back to my reascript(lua)??
|
|
|
12-01-2018, 11:07 AM
|
#390
|
Human being with feelings
Join Date: Aug 2016
Posts: 6
|
Just saw this thread- repost from my own thread in the appropriate place...
I'm trying to build a script that will assign my control surface's knobs to tracks with "bus" in the name in order of track #. I've got my script to get the track numbers of each bus, tell how many are present, and sort them in an array, but I don't know how to actually do the assigning.
I figure this must be possible given that you can set track volume based on MIDI with Reaper's built-in actions, but I may be wrong. Any advice?
|
|
|
12-05-2018, 06:59 AM
|
#391
|
Human being with feelings
Join Date: Aug 2009
Location: NL
Posts: 1,458
|
Is it possible to dump all variables of a JSFX (the ones you see in the right pane of the edit window)? There seems to be a very rare bug in one of my scripts, that doesn't happen on my end and I would like to prod the state that the JSFX gets in. Would be great if there was an ability to dump the JSFX state, so that I could get it for debugging purposes.
|
|
|
12-18-2018, 04:58 AM
|
#392
|
Human being with feelings
Join Date: Nov 2018
Posts: 29
|
Abort render
Is there a clean, elegant solution to abort a render within a pcm_sink constructor?
My render will be dependent on the project structure, and in some cases this would make the render invalid. I can do my validation checks when initially showing the sinks config, but the user could change something that would make the render invalid between me showing the config and the user hitting the 'Render' button, so I need to check again at this point and abort if necessary.
|
|
|
01-26-2019, 02:10 PM
|
#393
|
Human being with feelings
Join Date: Dec 2016
Posts: 17
|
Link Eq Parameters of two different Fx istances
Hi,
few days ago I've seen a post describing how to link the frequency band of two different Eq FX...ther was an example even of FabFilter ProQ....
Moving the band of EQ FX1 it'is possible to move (link) the band in another eq istance (FX2). I'm looking for this script or post...Can you help me?
Damn me...I didn't take a note of that!!!!;-)
Thanks.
|
|
|
01-26-2019, 06:23 PM
|
#394
|
Human being with feelings
Join Date: Nov 2006
Location: Finland
Posts: 1,528
|
Quote:
Originally Posted by PMdL
Hi,
few days ago I've seen a post describing how to link the frequency band of two different Eq FX...
|
- Click the "Param" button on top of the EQ plugin. And choose Parameter modulation / MIDI link.
- Check the box "Link from MIDI or FX parameter", and choose which FX parameter you want to link.
__________________
______ Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
|
|
|
02-02-2019, 12:33 PM
|
#395
|
Human being with feelings
Join Date: Jul 2011
Posts: 59
|
GetOpenFileName()
This might be Swell question - what to include in C++ file to be able to use GetOpenFileName() function on Mac?
Grepping through Reaper SDK shows that it is defined in
Code:
reaper_extension_sdk/WDL/swell/windows.h
In my code, there are following includes among others:
Code:
#ifndef _WIN32
#include "../resource.h"
#include "../../WDL/swell/swell-dlggen.h"
#include "../res.rc_mac_dlg"
#include "../../WDL/swell/swell-menugen.h"
#include "../../WDL/swell/swell.h"
#include "../../WDL/swell/windows.h"
#include "../res.rc_mac_menu"
#endif
When compiling, following parameters are used:
Code:
-IWDL -IWDL/WDL -DSWELL_PROVIDED_BY_APP
However, there is still compilation error:
Code:
moxf/csurf_moxf.cpp:463:18: error: use of undeclared identifier 'GetOpenFileName'
if (GetOpenFileName(&l))
^
When omitting this function call, everything compiles and control surface configuration dialog shows without problems in REAPER.
Do you know what could be the problem?
|
|
|
02-02-2019, 12:37 PM
|
#396
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
|
SWELL doesn't implement Windows' GetOpenFileName or GetSaveFileName. It provides BrowseForFiles instead.
Code:
/*
** GetOpenFileName() / GetSaveFileName()
** These are a different API because we didnt feel like reeimplimenting the full API.
** Extlist is something similar you'd pass getopenfilename,
** initialdir and initialfile are optional (and NULL means not set).
*/
|
|
|
02-02-2019, 01:46 PM
|
#397
|
Human being with feelings
Join Date: Jul 2011
Posts: 59
|
Many thanks, cfillion!
|
|
|
02-03-2019, 01:25 PM
|
#398
|
Human being with feelings
Join Date: Feb 2019
Posts: 1
|
Programmatically Generating Multiple Audio clips from midi
Hi all, here's what I want to do: I have a midi file(s) and a vst synth. I want to randomly choose a preset from that vst synth, play the midi file(s) on that synth, and then record the audio that results from it. I want to do this for ~100 presets and possibly ~10 midi files so I can't do this manually (I'd have to record 1000s of audio tracks individually), I'll need to do it programatically. How easy is this to do with ReaScript (I'm a complete noobie to this)?
|
|
|
02-12-2019, 10:58 AM
|
#399
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Is there some kind of documentation on how to develop C++-extension-plugins for Reaper somewhere, that I can use to learn that stuff?
Thanks
|
|
|
02-12-2019, 12:16 PM
|
#400
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by mespotine
Is there some kind of documentation on how to develop C++-extension-plugins for Reaper somewhere, that I can use to learn that stuff?
|
Not really, the extremely outdated official SDK has some example projects and there have been examples floating around done for example by me. But those are always painful because the projects can get so easily outdated. Also it's quite tricky to do GUIs with C++. There is nothing like the gfx thing in ReaScript available from the C or C++ Reaper API.
The simplest possible extension plugin code, that does nothing, but makes all the C API functions available, is something like :
Code:
#define REAPERAPI_IMPLEMENT
#include "reaper_plugin_functions.h"
extern "C"
{
REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT(REAPER_PLUGIN_HINSTANCE hInstance, reaper_plugin_info_t *rec) {
if (rec != nullptr)
{
if (REAPERAPI_LoadAPI(rec->GetFunc) > 0) return 0;
return 1;
}
return 0;
}
}
You of course have to set up a Visual Studio or Xcode project properly to build a dll for Windows or dylib for macOs to make that work.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Last edited by Xenakios; 02-12-2019 at 12:23 PM.
|
|
|
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 03:55 AM.
|