|
|
|
07-18-2021, 01:11 PM
|
#841
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
Quote:
Originally Posted by Edgemeal
Not sure if this helps, just some code I was messing around with on Win10 with two monitors...
|
Looks interesting! Thanks a lot! I'll try this.
|
|
|
07-20-2021, 03:08 PM
|
#842
|
Human being with feelings
Join Date: Aug 2020
Location: Colombia
Posts: 165
|
Anybody know where I can find info about how to get the mouse to actually affect a parameter.
I'm trying to programm my first JSFX with GUI and I get the slider to move but no to change the parameters.
I put all info in this post:
https://forum.cockos.com/showthread.php?t=255752
thanks in advance.
|
|
|
07-30-2021, 03:56 PM
|
#843
|
Human being with feelings
Join Date: Jun 2021
Posts: 65
|
Does anyone have any ideas on how to pass through keyboard inputs from an ImGui window to the main window? ImGui windows eat all keyboard inputs so keyboard shortcuts do nothing to Reaper when an ImGui window is focused.
I tried using reaper.BR_Win32_SetFocus to change the focus to the main window on every frame, but many ImGui functions won't work at all, like context menus.
|
|
|
08-11-2021, 01:16 PM
|
#844
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
I want to script remember a track once and then use this track no matter is it selected or how much tracks in project or anything else. Just to remember track ID.
ExtState can remember only numbers or strings, gmem can remember only numbers...
But is a way to save userdata?
|
|
|
08-11-2021, 03:43 PM
|
#845
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by AZpercussion
I want to script remember a track once and then use this track no matter is it selected or how much tracks in project or anything else. Just to remember track ID.
ExtState can remember only numbers or strings, gmem can remember only numbers...
But is a way to save userdata?
|
GetTrackGUID returns a string (in Lua) you could save.
And to get the track back from GUID (global unique ID) you could use BR_GetMediaTrackByGUID.
|
|
|
08-12-2021, 04:06 AM
|
#846
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
Quote:
Originally Posted by nofish
|
WOW! It works. Thanks a lot!!
|
|
|
11-06-2021, 05:15 AM
|
#847
|
Human being with feelings
Join Date: Jan 2019
Posts: 33
|
I have a class I am using from CookDSP library, and want to make an array of them, but can't tell if it is possible in EEL2 to create arrays of complex objects and not just arrays. For example to make a single filter you do 'filter.bp(freq,q);' but filter[0].bp(freq,q); doesn't work.
|
|
|
11-09-2021, 01:09 PM
|
#848
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
Hi, folks! I'm searching a way to modify the tracks info value by defer script with avoiding to add an undo point.
For now my defer script works fine, but it's added to undo history partially.
I tryed to place reaper.defer(function()end) before reaper.defer(main), but no succes.
|
|
|
11-15-2021, 12:17 PM
|
#849
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by AZpercussion
Hi, folks! I'm searching a way to modify the tracks info value by defer script with avoiding to add an undo point.
For now my defer script works fine, but it's added to undo history partially.
I tryed to place reaper.defer(function()end) before reaper.defer(main), but no succes.
|
It's probably a usecase for my Feature Request, that addresses exactly these kinds of issues:
https://forum.cockos.com/showthread.php?t=215672
|
|
|
11-16-2021, 06:06 AM
|
#850
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
Quote:
Originally Posted by Meo-Ada Mespotine
|
Hmm. Yeah, nice request!
But I think, isn't it a bug with track info value function?
I used it in static, non-defer script, and with reaper.defer(function()end) it doesn't create an undo point.
But now I tried to divide my script to a defer and simple parts as a different scripts. And then called them by dofile().
But, alas, no changed.
|
|
|
11-16-2021, 10:10 AM
|
#851
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Yes, with some stuff, it's impossible to prevent undo or no one has found out how yet.
The defer-approach for undo-prevention should considered more as a workaround but not as designed to do this attempt.
It's worth a try to report this as a bug,still.
|
|
|
11-24-2021, 02:32 PM
|
#852
|
Human being with feelings
Join Date: Jul 2018
Posts: 52
|
how to Get a selected action in lua?
Hi,
PromptForAction is very nice but it jumps to the top of the page and forces me to reselect the action.
The goal is to put in the clipboard the command ID of the already selected action with 1 click.
I hope it will be possible.
Thanks.
__________________
Windows 10 pro v22H2, I7 10700@ 2.90Ghz, 32GB,
RME Babyface pro, NI KK S49 MK2, Nektar Panorama P1,
Softube Console 1.
|
|
|
11-25-2021, 09:49 AM
|
#853
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
|
Right click the action There should be a action to copy the ID to clipboard
|
|
|
11-25-2021, 10:34 AM
|
#854
|
Human being with feelings
Join Date: Jul 2018
Posts: 52
|
Quote:
Originally Posted by daniellumertz
Right click the action There should be a action to copy the ID to clipboard
|
Thanks Daniel but that's what I was trying to avoid.
Because it's not possible to create a shortcut for "Copy ...Command ID",
I thought I would write a small script to emulate this function and assign a shortcut to it.
it's not that I have a couple of plugins to assign it's hundreds.
I've upgraded my Waves gold bundle to Platinum and the result is that Reaper has deleted all the plugin shortcuts that were assigned because of the WaveShell V13.
Thanks anyway.
__________________
Windows 10 pro v22H2, I7 10700@ 2.90Ghz, 32GB,
RME Babyface pro, NI KK S49 MK2, Nektar Panorama P1,
Softube Console 1.
Last edited by Jazzy2040; 11-25-2021 at 11:21 AM.
|
|
|
12-01-2021, 11:05 AM
|
#855
|
Human being with feelings
Join Date: Nov 2021
Posts: 7
|
What is the most common practice for importing/requiring lua files to be used in a script? I've tried every solution suggested in this thread , and nothing has worked. But it's 6 years old and it's possible things have changed.
|
|
|
12-02-2021, 03:25 AM
|
#856
|
Human being with feelings
Join Date: Oct 2019
Location: Moscow / Tbilisi
Posts: 909
|
Quote:
Originally Posted by IvoryBlack
What is the most common practice for importing/requiring lua files to be used in a script? I've tried every solution suggested in this thread , and nothing has worked. But it's 6 years old and it's possible things have changed.
|
It seems nothing changed, as i can understand.
Maybe you missed something.
If you need to use functions in your lua file and have feedback, you need require() function.
If you need just run another script, use dofile().
Before this you have to get path of your parent script and modify this path to show children path.
Try to figure out how works existing scripts from Reapack, wich use that way. For example my script Go to Timecode.
|
|
|
12-02-2021, 04:47 AM
|
#857
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by IvoryBlack
What is the most common practice for importing/requiring lua files to be used in a script? I've tried every solution suggested in this thread , and nothing has worked. But it's 6 years old and it's possible things have changed.
|
Not sure what's common practice. I'd use the following if you have a additional scripts in the same directory or in subfolders:
Code:
local _, path = reaper.get_action_context()
package.path = path:match('^.+[\\/]') .. '?.lua;'
require 'my_script_in_same_folder'
require 'SubFolder.another_script'
Or if you have an absolute path, e.g. somewhere in the REAPER Scripts folder:
Code:
function Path(...) return table.concat({...}, package.config:sub(1, 1)) end
dofile(Path(reaper.GetResourcePath(), 'Scripts', 'Folder', 'myscript.lua'))
|
|
|
12-02-2021, 05:10 AM
|
#858
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by IvoryBlack
What is the most common practice for importing/requiring lua files to be used in a script? I've tried every solution suggested in this thread , and nothing has worked. But it's 6 years old and it's possible things have changed.
|
I once wrote something about this in this thread
https://forum.cockos.com/showthread.php?p=2348157
It's probably overkill and more information than you actually need, but I went through the common goods and bads of the various methods and when to use what including some usecases.
Btw, what do you want to require? An external library/package? They usually don't work due some issues in Reaper. But lua-files, as source code and as binary chunk, work.
Edit:
Link was linked to a post, not the thread in general. Fixed it.
Last edited by Meo-Ada Mespotine; 12-03-2021 at 10:39 AM.
|
|
|
12-02-2021, 05:14 AM
|
#859
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by Meo-Ada Mespotine
I once wrote something about this in this thread
https://forum.cockos.com/showthread....57#post2348157
It's probably overkill and more information than you actually need, but I went through the common goods and bads of the various methods and when to use what including some usecases.
|
Wow, super interesting!
|
|
|
12-02-2021, 08:05 AM
|
#860
|
Human being with feelings
Join Date: Nov 2021
Posts: 7
|
Hi again everybody. So I tried the method FeedTheCat suggested and I __think__ it technically worked with regards to recognizing and reading the file, but I'm getting the following error:
Code:
xmlSimple.lua:1 attempt to call a nil value (global 'module')
This is the first line in that file:
Code:
module(..., package.seeall)
This is the entire document, a single-file xml parser for lua.
This may be leaving the scope of REAPER specifically but has anyone seen anything like this when scripting?
EDIT: So it turns out that that syntax is deprecated, but even after commenting it out and using a workaround I ran into problems with other stuff. It turns out that this library was specifically intended for Corona2D (this was statedin the very last sentence of the description), so yeah. Thanks anyway guys.
Last edited by IvoryBlack; 12-02-2021 at 09:39 AM.
|
|
|
12-03-2021, 10:38 AM
|
#861
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Yeah, a lot of modules out there are outdated and only available for earlier Lua-versions.
It's a pity, as there are some nice libraries out there, that couldn't be used in Reaper, even if the known problems in Reaper with requiring binary-libraries could be fixed by the devs.
|
|
|
12-03-2021, 10:44 AM
|
#862
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
|
|
|
12-04-2021, 01:58 PM
|
#863
|
Human being with feelings
Join Date: Nov 2021
Posts: 7
|
I ended up using the library at the bottom of this page. It works but it only allows for linear traversal. There's a version on there that returns a table that I may try, but I've been reluctant because the page says it could be outdated.
Anyway, I have a few more questions, this time REAPER api focused:
1). How do I append a media item to an existing track? (i.e. after the most current media item?) Every time I try to add a media file to a track that already has one (using reaper.InsertMedia) it seems to remove the original from the track.
2). Is there a way to create and add a media item to a track without bringing up a dialog? reaper.InsertMedia brings up a dialogue every time a media item is added.
Thanks
|
|
|
12-04-2021, 05:12 PM
|
#864
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
|
1) Using mode 0 you add a media to the last touched track, maybe the items are just overlapped and you are not seeing? here it continually add the items.
2) Here it don't pop any messages. Are you importing a midi item?
If so a modular window pops out, you can bypass that window triggering another script to close it. But just once, defered scripts that import from time to time midi items will not be able to close it more than one time. Mespo knows the details about this. She though me that part .
|
|
|
12-05-2021, 09:05 AM
|
#865
|
Human being with feelings
Join Date: Nov 2021
Posts: 7
|
Quote:
Originally Posted by daniellumertz
1) Using mode 0 you add a media to the last touched track, maybe the items are just overlapped and you are not seeing? here it continually add the items.
2) Here it don't pop any messages. Are you importing a midi item?
If so a modular window pops out, you can bypass that window triggering another script to close it. But just once, defered scripts that import from time to time midi items will not be able to close it more than one time. Mespo knows the details about this. She though me that part .
|
You're right, it was inserted just overlapped.
And yeah, it's midi. I'll have to get around that somehow. Is there a way to read data from a midi file without inserting it into a track? I ultimately just want to create regions based on the size (and a prespecified order) of midi sequences.
|
|
|
12-05-2021, 05:04 PM
|
#866
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
|
|
|
|
12-29-2021, 11:08 PM
|
#867
|
Human being with feelings
Join Date: May 2021
Posts: 83
|
Hi,
I'd like to if possible, make a dialog to replace the routing dialog (not the routing matrix)
I find it error prone and difficult to scan once there are a few send/receives.
I'm browsing the API now. I just wondered if anyone has general advice on how to approach this, or limitations I should be aware of.
My ideal goal would be to completely mirror all functionality of the routing dialog available via the Route button on a tcp/mcp.
Any tips would be appreciated, thanks.
|
|
|
12-30-2021, 12:02 AM
|
#868
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
|
I would recommend checking out reaImGui as you will need make a Gui.
Else that if you have any questions just ask
|
|
|
12-30-2021, 12:26 AM
|
#869
|
Human being with feelings
Join Date: May 2021
Posts: 83
|
Quote:
Originally Posted by daniellumertz
I would recommend checking out reaImGui as you will need make a Gui.
Else that if you have any questions just ask
|
Thank you, I was actually wondering if that was the way to go. Will take a closer look at reaImGui.
|
|
|
01-06-2022, 11:36 AM
|
#870
|
Human being with feelings
Join Date: Nov 2016
Location: Serbia
Posts: 172
|
How do I send a MIDI meta message (tempo change) ?
I tried both
Code:
midisend_str(0,"\xFF\x51\x03\x07\xA1\x20");
and
Code:
buf[0] = 0xFF;
buf[1] = 0X51;
buf[2] = 0x03;
buf[3] = 0x07;
buf[4] = 0xA1;
buf[5] = 0x20;
midisend_buf(0,buf,6);
But neither seems to work with length above 3.
What am I doing wrong ?
|
|
|
01-06-2022, 06:49 PM
|
#871
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
|
Is this extension c++? or a script?
|
|
|
01-06-2022, 07:48 PM
|
#872
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,750
|
jsfx I assume. midisend_buf should work, but what are you sending the message to?
|
|
|
01-07-2022, 06:03 AM
|
#873
|
Human being with feelings
Join Date: Nov 2016
Location: Serbia
Posts: 172
|
Quote:
Originally Posted by schwa
jsfx I assume. midisend_buf should work, but what are you sending the message to?
|
Yes, it's jsfx. I wrote a small script that catches project tempo changes and sends MIDI message that I will catch with ReaLearn in order to sync time based parameters across several plugins.
So it's for "internal" use and I could actually use any MIDI message, but I looked up MIDI specs to find most appropriate message for sending BPM changes, and it's 6 bytes, as per:
https://www.recordingblogs.com/wiki/...o-meta-message
|
|
|
01-07-2022, 11:46 AM
|
#874
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by brk303
Yes, it's jsfx. I wrote a small script that catches project tempo changes and sends MIDI message that I will catch with ReaLearn in order to sync time based parameters across several plugins.
So it's for "internal" use and I could actually use any MIDI message, but I looked up MIDI specs to find most appropriate message for sending BPM changes, and it's 6 bytes, as per:
https://www.recordingblogs.com/wiki/...o-meta-message
|
Maybe it's naive, but what if you send two messages? First: byte 1-3, second: byte 4-6?
It'll probably not work but maybe it's worth a shot.
|
|
|
01-08-2022, 05:17 PM
|
#875
|
Human being with feelings
Join Date: Jan 2022
Posts: 2
|
How do I return a value from a reascript back to the calling web console
I've been working on being able to have everyone in the band have their own mix with "More_Me.html" and have decided to also include the ability to change presets to test out whether we want to try and all run from the computer with vsts.
Thanks to reascript, so far this has been easy EXCEPT what I figured would be the easiest part. I cannot return a value of the current preset back to the web console.
Am I missing something or is this just not possible?
Additionally, I think I know the answer to this one but is there a way to send a parameter to a command? i.e. Instead of a script <instrument>_Preset_Back.py and <instrument>_Preset_Forward.py script for each instrument it would be ideal if I could send www_req("_command_id_guid;instrument;direction") to a single command.
|
|
|
01-08-2022, 05:39 PM
|
#876
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by lock5251
I've been working on being able to have everyone in the band have their own mix with "More_Me.html" and have decided to also include the ability to change presets to test out whether we want to try and all run from the computer with vsts.
Thanks to reascript, so far this has been easy EXCEPT what I figured would be the easiest part. I cannot return a value of the current preset back to the web console.
Am I missing something or is this just not possible?
Additionally, I think I know the answer to this one but is there a way to send a parameter to a command? i.e. Instead of a script <instrument>_Preset_Back.py and <instrument>_Preset_Forward.py script for each instrument it would be ideal if I could send www_req("_command_id_guid;instrument;direction") to a single command.
|
You can't send parameters and can't get returnvalues to/from scripts/actions.
However:
You can set extstates and read values from there. So if you want to tell the action to use "My_Wonderful_Preset", you set an extstate which holds this as a string in the web-interface.
Then you run the preset-changing-command, which itself reads the extstates and gets "My_Wonderful_Preset" in this way.
This can be done the other way round as well: you set an extstate in your script, which in turn can be read from the web-interface and be used for all sorts of things.
Here's some code-snippet on how to do it:
https://mespotin.uber.space/Ultrasch...l#DataExchange
|
|
|
01-08-2022, 05:58 PM
|
#877
|
Human being with feelings
Join Date: Jan 2022
Posts: 2
|
Quote:
Originally Posted by Meo-Ada Mespotine
You can't send parameters and can't get returnvalues to/from scripts/actions.
However:
You can set extstates and read values from there. So if you want to tell the action to use "My_Wonderful_Preset", you set an extstate which holds this as a string in the web-interface.
Then you run the preset-changing-command, which itself reads the extstates and gets "My_Wonderful_Preset" in this way.
This can be done the other way round as well: you set an extstate in your script, which in turn can be read from the web-interface and be used for all sorts of things.
Here's some code-snippet on how to do it:
https://mespotin.uber.space/Ultrasch...l#DataExchange
|
Thanks for the quick answer with an alternate solution! Really appreciated. I will try to tinker with external states.
You know what I just got this working so good on this:
I have another question around python reascript. Is it possible to setup submodules in the python code? e.g.
UserScripts:
-bass:
--__init__.py
--preset_back.py
-utils:
--presets.py
I've tried to get this working with a setup.py and doing an install from that but it did not help.
|
|
|
01-13-2022, 01:23 AM
|
#878
|
Human being with feelings
Join Date: Jul 2019
Posts: 30
|
Hi! I'm just trying to modify the Reaper Blog's Macro controller so that slider names are per-instance customizable. I can't find how to either use a variable name as a slider description, or a function that changes that description.
It can also be a text box w/ user input just hanging around the slider itself - I'm not picky about the prettiness of it, just need a way to name/rename the sliders in runtime so I don't need to use track notes to remember things.
|
|
|
01-21-2022, 11:50 AM
|
#879
|
Human being with feelings
Join Date: Dec 2021
Location: Jupiter Island
Posts: 924
|
waveform color and highlight
Can anyone tell me if it is possible to modify the waveform color and highlight color via a script?
What I have in mind is a formula that converts the current track color to an inverse color and applies that to the waveform, with a corresponding variant on the waveform highlight.
I've never written a script for reaper so realize I might have a bit of a learning curve ahead of me. Just want to know if it's possible?
|
|
|
01-21-2022, 04:58 PM
|
#880
|
Human being with feelings
Join Date: Jul 2018
Posts: 809
|
counting FX instances
How do I get the number of FX plugins loaded on a track from the API - preferably lua?
|
|
|
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:21 PM.
|