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

Reply
 
Thread Tools Display Modes
Old 04-11-2023, 11:32 AM   #841
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by JackOrez View Post
I use to check that page for the latest, but I had given up because it was also not the current version. Looks like it is now, so thank you very much.
Yeah, I messed something up. But now it works 🙂
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-28-2023, 02:26 PM   #842
Kickaxe
Human being with feelings
 
Join Date: Apr 2023
Posts: 47
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Yeah, I messed something up. But now it works 🙂
Hi Meo-Ada Mespotine, I installed your Ultraschall repo. There are a lot of very useful scripts in there, thank you.

In your online documentation, you show the following:

get_action_context
Lua: boolean is_new_value, string filename_with_path, integer sectionID, integer cmdID, integer mode, integer resolution, integer val, string contextstr = reaper.get_action_context()

I get "9: bad argument #1 to 'ShowConsoleMsg' (string expected, got nil)" when trying to view the contents contextstr, which is supposed to show the shortcut that ran the action. What am I doing wrong? I know this is a reaper function and when I look at their description, it doesn't list contextstr as a return item where yours does. I'm really hoping I am able to capture the shortcut as I have several shortcuts bound to the script and I would like to be able to do some conditional execution based on which shortcut was used. If I am not able to get that via reaper.get_action_context() is there another function I can use to accomplish this? Any help would be greatly appreciated.
Kickaxe is offline   Reply With Quote
Old 05-28-2023, 04:48 PM   #843
Kickaxe
Human being with feelings
 
Join Date: Apr 2023
Posts: 47
Default

Quote:
Originally Posted by Kickaxe View Post
Hi Meo-Ada Mespotine, I installed your Ultraschall repo. There are a lot of very useful scripts in there, thank you.

In your online documentation, you show the following:

get_action_context
Lua: boolean is_new_value, string filename_with_path, integer sectionID, integer cmdID, integer mode, integer resolution, integer val, string contextstr = reaper.get_action_context()

I get "9: bad argument #1 to 'ShowConsoleMsg' (string expected, got nil)" when trying to view the contents contextstr, which is supposed to show the shortcut that ran the action. What am I doing wrong? I know this is a reaper function and when I look at their description, it doesn't list contextstr as a return item where yours does. I'm really hoping I am able to capture the shortcut as I have several shortcuts bound to the script and I would like to be able to do some conditional execution based on which shortcut was used. If I am not able to get that via reaper.get_action_context() is there another function I can use to accomplish this? Any help would be greatly appreciated.
My bad, I see that this return value requires Reaper 6.71 and above. I was still on 6.70. I've updated Reaper and it's all good now. Regards.
Kickaxe is offline   Reply With Quote
Old 05-29-2023, 04:11 AM   #844
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Kickaxe View Post
My bad, I see that this return value requires Reaper 6.71 and above. I was still on 6.70. I've updated Reaper and it's all good now. Regards.
Yeah. That's why I add a small icon with versionnumber to each function in the docs, so you can see, which Reaper version is required for the newest set of features in that function.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-29-2023, 03:18 PM   #845
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

4.9 - "Depeche Mode - Everything Counts" - 30th of June 2023

Has now 1663 functions, with 13 new ones and two fewer ones(!)

new in this release:
  • ReaSpaghetti
    Features bugfixes and additions that will make Ultraschall API compatible with Sexan's ReaSpaghetti coding-tool in the future.
    Keep checking for ReaSpaghetti-updates for more details.
  • Razor Edit
    You can now set and resize RazorEdits. The resizing is possible by setting a new length or resizing by a factor, like 0.5 for half or 2 for double the size.

    New features in 4.9
  • Docs: links and code-examples - added links to related functions as well as some first code-examples; can now add more very easily
  • DocEngine: Docs_GetAllUSDocBlocsFromFile - loads all USDocBlocs from a file
  • DocEngine: Docs_GetReaperApiFunction_Categories - returns the index-categories of a Reaper-function(including extensions)
  • DocEngine: Docs_GetUSDocBloc_Examples - retrieves the code-example-attributes stored in a USDocBloc
  • DocEngine: Docs_GetUltraschallApiFunction_Categories - returns the index-categories of an Ultraschall-function
  • Envelopes: DeleteTrackEnvelopePointsBetween - removes all envelope-points between start and endposition
  • RazorEdit: RazorEdit_GetBetween_Envelope - get all razor-edits of an envelope between start and endposition one or all razor-edits in a track
  • RazorEdit: RazorEdit_GetBetween_Track - get all razor-edits of a track between start and endposition
  • RazorEdit: RazorEdit_Resize_Envelope - resizes one or all razor-edits in an envelope
  • RazorEdit: RazorEdit_ResizeByFactor_Envelope - resizes one or all razor-edits in an envelope by a factor(requested by Daniel Lumertz)
  • RazorEdit: RazorEdit_Resize_Track - resizes one or all razor-edits in a track
  • RazorEdit: RazorEdit_ResizeByFactor_Track - resizes one or all razor-edits in a track by a factor(requested by Daniel Lumertz)
  • RazorEdit: RazorEdit_Set_Envelope - sets start/endposition of a razor-edit in an envelope
  • RazorEdit: RazorEdit_Set_Track - sets start/endposition of a razor-edit in a track

Changes from 4.8 to 4.9
  • Helper Functions: SFEM - crashed, when the occurred error happened not within a function -> fixed now
  • DocEngine: Docs_GetAllUSDocBlocsFromString - returned nil in case of an error which was wrong; returns -1 now -> fixed now
  • Docs: Reaper Internals - updated to Reaper 6.80
  • Envelopes: MoveTrackEnvelopePointsBy - didn't properly move and cut envelope-points -> fixed
  • MediaItems: RippleCut - didn't properly move and cut envelope-points; cut env-points in all tracks, not just the ones from trackstring -> fixed
  • MediaItems: RippleCut_Reverse - didn't properly move and cut envelope-points; cut env-points in all tracks, not just the ones from trackstring -> fixed
  • MediaItem_Takes: GetProjectPosByTakeSourcePos - removed from release, due a Reaper bug that might remove take-markers; will return when bug is fixed
  • MediaItem_Takes: GetTakeSourcePosByProjectPos - removed from release, due a Reaper bug that might remove take-markers; will return when bug is fixed
  • PodcastMetadata: GetPodcastContributorAttributesAsJSON - fix due fix in GetSetContributor_Attributes
  • PodcastMetadata: GetSetContributor_Attributes - had wrong undocumented parameter in the function which is removed now; added "ctrb_role"
  • PodcastMetadata: GetSetPodcastEpisode_Attributes - removed "epsd_tagline" and "epsd_author"
  • PodcastMetadata: GetSetPodcast_Attributes - added "podc_tagline" and "podc_feed"
  • PodcastMetadata: GetShownoteAttributesAsJSON - timestamp is now in hh:mm:ss:mss
  • PodcastMetadata: PodcastMetadata_CreateJSON_Entry - did only do the first chapter, ignoring the rest; improved layout of JSON -> fixed
  • RazorEdit: RazorEdit_Nudge_Track - index didn't count properly, when envelopes had razor-edits -> fixed now



Please update it via ReaPack using: https://github.com/Ultraschall/ultra..._api_index.xml
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 09-28-2023, 03:44 PM   #846
Suzuki
Human being with feelings
 
Suzuki's Avatar
 
Join Date: Jul 2022
Location: Japan
Posts: 765
Default

Hi Mespotine, thanks for the great work!

I worked on a script which utilizes Ultraschall's Parameter Modulation API.

What I don't get is PARMLINK_LINKEDPARMIDX. When linking (self) fx parameter or MIDI, MonitorParmModTable says it's nil, but nil does not work. -1 is the correct value in those situation instead. Why does this mismatch happen?



Our table is like this. Thanks!
Code:
function Link_Param_to_CC(TrackNumToBeMod, FX_Slt_Indx_ToBeMod, PARAM_Num, parmlink, MIDIPLINK, Linked_Plugin, Linked_Self, Linked_Parm, Category,
    CC_or_Note_Num,
    Baseline_V, Scale)
--NOTE : ALL Numbers here are NOT zero-based, things start from 1 , hence the +1 in function
--('TrackNumToBeMod'..TrackNumToBeMod.. '\n FX_Slt_Indx_ToBeMod'..FX_Slt_Indx_ToBeMod..'\n PARAM_Num'..PARAM_Num..'\n'..'CC_or_Note_Num'..CC_or_Note_Num..'\n')
ParmModTable                                        = ultraschall.CreateDefaultParmModTable()

ParmModTable["PARMLINK"]                            = parmlink

ParmModTable["MIDIPLINK"]                           = MIDIPLINK
ParmModTable["PARAM_TYPE"]                          = ""

ParmModTable["WINDOW_ALTERED"]                      = false

ParmModTable["PARMLINK_LINKEDPLUGIN"]               = Linked_Plugin + 1 -- -100 for MIDI-parameter-settings, so you need to set -101
ParmModTable["PARMLINK_LINKEDPLUGIN_RELATIVE"]      = Linked_Self -- for (self) FX link
ParmModTable["MIDIPLINK_BUS"]                       = 16
ParmModTable["MIDIPLINK_CHANNEL"]                   = 16
ParmModTable["MIDIPLINK_MIDICATEGORY"]              = Category      -- 176 is CC
ParmModTable["MIDIPLINK_MIDINOTE"]                  = CC_or_Note_Num
ParmModTable["PARAM_NR"]                            = PARAM_Num + 1 --Param Number to be modulated
ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"] = true
if Linked_Parm == -1 then ParmModTable["PARMLINK_LINKEDPARMIDX"] = Linked_Parm else ParmModTable["PARMLINK_LINKEDPARMIDX"] = Linked_Parm + 1 end -- Use -1 instead of nil, or it doesn't work
if Baseline_V then ParmModTable["PARAMOD_BASELINE"] = Baseline_V end
if Scale then ParmModTable["PARMLINK_SCALE"] = Scale end


whetherValid = ultraschall.IsValidParmModTable(ParmModTable)


retval, TrackStateChunk = ultraschall.GetTrackStateChunk_Tracknumber(TrackNumToBeMod)
FXStateChunk = ultraschall.GetFXStateChunk(TrackStateChunk)
alteredFXStateChunk = ultraschall.AddParmMod_ParmModTable(FXStateChunk, FX_Slt_Indx_ToBeMod + 1, ParmModTable)
retval, TrackStateChunk = ultraschall.SetFXStateChunk(TrackStateChunk, alteredFXStateChunk)
retval = ultraschall.SetTrackStateChunk_Tracknumber(TrackNumToBeMod, TrackStateChunk)

tab = ultraschall.GetParmModTable_FXStateChunk(FXStateChunk, FX_Slt_Indx_ToBeMod + 1, PARAM_Num + 1)
end
Suzuki is offline   Reply With Quote
Old 09-29-2023, 03:19 PM   #847
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Is it only the monitor showing a wrong value and the actual code works?

Edit:
according to my docs, -1 means no parameter linked. It shouldn't work that way.

The rest: it seems like the devs changed something in Parameter Modulation, so the nil is a bug.
Tbh, since Reaper's own api supports Parameter Modulation now, I strongly recommend to use that instead, since it's faster and more reliable.
I'll probably deprecate parameter modulation in Ultraschall-Api quite soon, since it always was done in a very hacky way.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 09-29-2023 at 03:51 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-02-2023, 01:40 AM   #848
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

New hotfix available:

Changes:
- Clipboard Management: PutMediaItemsToClipboard\_MediaItemArray - had edgecase, where it added one item too many -> fixed
- DocEngine: Docs\_GetReaperApiFunction\_Params - didn't correctly resolve datatypes when param was optional
- DocEngine: Docs\_GetReaperApiFunction\_Retvals - didn't correctly resolve datatypes when param was optional
- DocEngine: Docs\_GetUltraschallApiFunction\_Params - didn't correctly resolve datatypes when param was optional; had inner variable exposed -> fixed
- DocEngine: Docs\_GetUltraschallApiFunction\_Retvals - didn't correctly resolve datatypes when param was optional
- MediaItem Management: RippleCut - didn't close the gap under certain cirumstances -> fixed now
- MediaItem Management: RippleCut\_Reverse - didn't close the gap under certain cirumstances -> fixed now
- RenderManagement: GetRenderTable\_ProjectFile - didn't return a valid Rendertable, when normalize-settings weren't in the project-file

Please update your ReaPacks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-02-2023, 03:36 PM   #849
Suzuki
Human being with feelings
 
Suzuki's Avatar
 
Join Date: Jul 2022
Location: Japan
Posts: 765
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Is it only the monitor showing a wrong value and the actual code works?

Edit:
according to my docs, -1 means no parameter linked. It shouldn't work that way.

The rest: it seems like the devs changed something in Parameter Modulation, so the nil is a bug.
Tbh, since Reaper's own api supports Parameter Modulation now, I strongly recommend to use that instead, since it's faster and more reliable.
I'll probably deprecate parameter modulation in Ultraschall-Api quite soon, since it always was done in a very hacky way.
Yes, the code works. I figured now why LFO and ACS also did not work. It seems that a couple of things changed on the native API.

Anyway, I replaced Ultraschall modulation API with reaper.TrackFX_GetNamedConfigParm and reaper.TrackFX_SetNamedConfigParm. Thanks for your advice and detailed documentation
Suzuki is offline   Reply With Quote
Old 10-05-2023, 02:51 PM   #850
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default optional integer OfflineOnlineRendering

HI!
so, I'm experimenting with CreateNewRenderTable and applying the table via
ApplyRenderTable_Project

I noticed that the only parameter that can't change while the render dialog is open is OfflineOnlineRendering

Everything else seems to change in real time

is that correct?
80icio is offline   Reply With Quote
Old 10-05-2023, 02:54 PM   #851
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Oh, need to check this. It should change it.

Which Reaper version did you use to test it (I need the exact version to replicate the problem)?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-05-2023, 02:56 PM   #852
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Oh, need to check this. It should change it.

Which Reaper version did you use to test it (I need the exact version to replicate the problem)?
6.82
80icio is offline   Reply With Quote
Old 10-05-2023, 02:58 PM   #853
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ok, will have a look tomorrow and fix it, if I find out what's going on.

Can you give me a minimal code-snippet that shows the behavior? Just in case...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-05-2023, 10:58 PM   #854
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default

Code:
function setNEWrendersettings()

newrendertable = ultraschall.CreateNewRenderTable(
   32, -- integer Source, 
   4,  -- integer Bounds,
   0,  -- number Startposition
   0,  -- number Endposition
   0,  -- integer TailFlag
   0,  -- integer TailMS
   "bounced files", -- string RenderFile
   "$Item", -- string RenderPattern
   44100, -- integer SampleRate
   2, -- integer Channels
   0, -- integer OfflineOnlineRendering
   true, -- boolean ProjectSampleRateFXProcessing
   10, -- integer RenderResample
   true, -- boolean OnlyMonoMedia
   false, -- boolean MultiChannelFiles
   0, -- integer Dither
   "ZXZhdxgAAA==", -- string RenderString
   false, -- boolean SilentlyIncrementFilename
   false, -- boolean AddToProj
   false, -- boolean SaveCopyOfProject
   false, -- boolean RenderQueueDelay
   0, -- integer RenderQueueDelaySeconds
   true, -- boolean CloseAfterRender
   false, -- boolean EmbedStretchMarkers
   "", -- string RenderString2
   false, -- boolean EmbedTakeMarkers
   false, -- boolean DoNotSilentRender
   false, -- boolean EmbedMetadata
   false, -- boolean Enable2ndPassRender
   false, -- boolean Normalize_Enabled
   0, -- integer Normalize_Method
   false, -- boolean Normalize_Stems_to_Master_Target
   0, -- number Normalize_Target
   false, -- boolean Brickwall_Limiter_Enabled
   1, -- integer Brickwall_Limiter_Method
   0, -- number Brickwall_Limiter_Target
   false, -- boolean Normalize_Method
   false, -- boolean FadeIn_Enable
   0, -- number FadeIn
   0, -- integer FadeIn_Shape
   false, -- boolean FadeOut_Enabled
   0, -- number FadeOut
   0, -- integer FadeOut_Shape
   false, -- boolean OnlyChannelsSentToParent
   false) -- boolean RenderStems_Prefader
   
  ultraschall.ApplyRenderTable_Project(newrendertable)
end

setNEWrendersettings()
You can change -- integer OfflineOnlineRendering -- and check if it changes the parameter in real time

Last edited by 80icio; 10-05-2023 at 11:39 PM.
80icio is offline   Reply With Quote
Old 10-06-2023, 06:40 AM   #855
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ok, found it. It's actually a bug in Reaper itself but I can circumvent it for an update.
It also affected other settings, not only the online/offline-mode.

Thnx for reporting this.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 10-06-2023 at 07:33 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-06-2023, 06:55 AM   #856
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Hotfix 3 available.

Changes:
- RenderManagement: ApplyRenderTable\_Project - did not properly apply render-settings when render to file-dialog was opened due Reaper bug -> fixed now (thanks to 80icio)

Please update your ReaPacks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-07-2023, 01:52 AM   #857
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Hotfix 3 available.

Changes:
- RenderManagement: ApplyRenderTable\_Project - did not properly apply render-settings when render to file-dialog was opened due Reaper bug -> fixed now (thanks to 80icio)

Please update your ReaPacks
thank you!
80icio is offline   Reply With Quote
Old 10-07-2023, 12:09 PM   #858
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default source: razor edit areas

0, Master mix(default)
1, Master mix + stems
3, Stems (selected tracks)
8, Region render matrix
32, Selected media items
256, Embed stretch markers/transient guides-checkbox=on; optional, as parameter EmbedStretchMarkers is meant for that

Do you know by any chance which integer I should use to set up
'razor edit areas' on CreateNewRenderTable - Source?

I was able to get some other options using 64 and 128 but not 'razor edit areas'

thanks

EDIT:
probably solved ...
4224 is the integer for 'razor edit areas via Master'
4096 is the integer for 'razor edit areas'

Last edited by 80icio; 10-07-2023 at 01:24 PM.
80icio is offline   Reply With Quote
Old 10-07-2023, 02:00 PM   #859
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Yeah, when in doubt, set it in the render to file-dialog, hit Save settings and then run the function GetRenderTable_Project() to see the current values of the settings.

Will add razor-area-rendering-values to the docs in the next release of Ultraschall-API which I'm currently working on.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-07-2023, 02:03 PM   #860
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Yeah, when in doubt, set it in the render to file-dialog, hit Save settings and then run the function GetRenderTable_Project() to see the current values of the settings.

Will add razor-area-rendering-values to the docs in the next release of Ultraschall-API which I'm currently working on.
yeah you're right! thanks
80icio is offline   Reply With Quote
Old 10-22-2023, 05:30 AM   #861
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default API

do you think one day you'll make a repository with just the Reaper APIs and not all the Documents related to the Ultraschall DAW enviroment? (like image files for example)

Some of your APIs are pretty useful to me
80icio is offline   Reply With Quote
Old 10-22-2023, 06:06 AM   #862
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

It would be too much work to do and difficult to handle on a development-level.
It's all quite integrated so I prefer to keep it the way it is, especially as I try to keep this in a way that the surrounding maintenance is as little as possible. Otherwise releasing bugfixes or new releases becomes very cumbersome, which would demotivate me to work on it further.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-22-2023, 06:11 AM   #863
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 322
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
It would be too much work to do and difficult to handle on a development-level.
It's all quite integrated so I prefer to keep it the way it is, especially as I try to keep this in a way that the surrounding maintenance is as little as possible. Otherwise releasing bugfixes or new releases becomes very cumbersome, which would demotivate me to work on it further.
That's what I expected, gotcha
80icio is offline   Reply With Quote
Old 02-21-2024, 08:13 AM   #864
Daimebag
Human being with feelings
 
Join Date: May 2014
Location: France
Posts: 24
Default is the doc about GetAllTrackEnvelopes Ok?

It seems like the doc about this function is not really what the function return.

https://mespotin.uber.space/Ultrasch...TrackEnvelopes

for example when I run it on Lua REPL on Reaper:
command: ultraschall.GetAllTrackEnvelopes()
output: {2, {{["EnvelopeName"]="EQ B3 Frequency / Neutron 4 Equalizer", ["EnvelopeObject"]=<userdata: 0000000005CDE040>, ["Track"]=3}, {["EnvelopeName"]="EQ B4 Frequency / Neutron 4 Equalizer", ["EnvelopeObject"]=<userdata: 0000000005BFAF20>, ["Track"]=3}}}
Daimebag is offline   Reply With Quote
Old 02-21-2024, 11:42 AM   #865
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Daimebag View Post
It seems like the doc about this function is not really what the function return.

https://mespotin.uber.space/Ultrasch...TrackEnvelopes

for example when I run it on Lua REPL on Reaper:
command: ultraschall.GetAllTrackEnvelopes()
output: {2, {{["EnvelopeName"]="EQ B3 Frequency / Neutron 4 Equalizer", ["EnvelopeObject"]=<userdata: 0000000005CDE040>, ["Track"]=3}, {["EnvelopeName"]="EQ B4 Frequency / Neutron 4 Equalizer", ["EnvelopeObject"]=<userdata: 0000000005BFAF20>, ["Track"]=3}}}
Can you post a minimal code example?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-21-2024, 12:15 PM   #866
Daimebag
Human being with feelings
 
Join Date: May 2014
Location: France
Posts: 24
Default

For example in attachement.

Maybe i didnt really understand the documentation but it seems that the structure are not the same. (Not a problem for my needs).

In my example it return a structure like:
{
numberOfEnvelopes,
{
{
["EnvelopeName"]: "foobar",
["EnvelopeObject"]: <userdataxxxxx>,
["Track"]: 1
},
,,,
}
}
Attached Images
File Type: png Screenshot 2024-02-21 201218.png (49.5 KB, 13 views)
File Type: png Screenshot 2024-02-21 201248.png (35.3 KB, 11 views)

Last edited by Daimebag; 02-21-2024 at 12:20 PM.
Daimebag is offline   Reply With Quote
Old 02-21-2024, 12:34 PM   #867
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I have no experience with the tool you used in the second screenshot, so I can't really tell, what it usually should do.
I only work in regular scripts.

The function also returns multiple return values but the tool seems to only use the first one. Try it in a regular script and see, if the issue persists.

Edit:
I have checked the code and it works as expected.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 02-21-2024 at 01:02 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-21-2024, 01:14 PM   #868
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

That second screenshot looks like my Interactive ReaScript script, which displays all return values of that function formatted as a table.

ultraschall.GetAllTrackEnvelopes is defined twice in ultraschall_functions_Envelope_Module.lua: the second implementation returns TrackEnvelopes_Count, TrackEnvelopesTable instead of the documented values.

(ultraschall_functions_AutomationItems_Module.lua relies on that second version.)

v55898.04

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
a = type(ultraschall.GetAllTrackEnvelopes())
assert(a == 'table') -- it's a number
cfillion is offline   Reply With Quote
Old 02-21-2024, 01:52 PM   #869
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by cfillion View Post
That second screenshot looks like my Interactive ReaScript script, which displays all return values of that function formatted as a table.

ultraschall.GetAllTrackEnvelopes is defined twice in ultraschall_functions_Envelope_Module.lua: the second implementation returns TrackEnvelopes_Count, TrackEnvelopesTable instead of the documented values.

(ultraschall_functions_AutomationItems_Module.lua relies on that second version.)

v55898.04

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
a = type(ultraschall.GetAllTrackEnvelopes())
assert(a == 'table') -- it's a number
Oh... will look into that...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine 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 04:29 AM.


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