Changes:
- Markers: GetAllRegions - returned index in allregionsarray[index][3] wasn't 1-based, causing problems with other functions -> fixed
- Render: RenderProject_Regions - caused an error, when using addregionname=true; allows now giving an optional separator between renderfilename_with_path and regionname when addregionname=true, including /-folderseparator. Check docs for that new feature.(reported by reapero)

I am trying to change the number of channels in the rendering options with your API and i have a few questions. I guess they are mostly related to "ProjectStateChunk". I have been reading a lot about this in other places but i still dont understand what it is (if you have documentation about it, let me know please).

So, the easiest way to do that seems to be SetProject_RenderFreqNChans. I have tried to do something with it and i got this

1.First parameter "projectfilename_with_path" i set it to nil with hopes that it would use the current project although the documentation says "nil to use Parameter ProjectStateChunk instead". Since i dont know what the ProjectStateChunk is, i am afraid i am pretty lost here.

2. Second paramter "unknown numer". The descriptions just says unknown number again so i have absolutely no clue what to add here. Added a random 9 there, just in case

To be completely clear about this, and in case there´s an easier way i am missing, i just want to set the rendering options to mono/stereo programatically on the project that is currently opened.

You can use the RenderTable directly with Renderfunctions as well. Just look for RenderTable in the RenderProject-functions to see, which would work for you.
Otherwise, if you just applied the altered RenderTable to the current project, you can just run the action
42230 - File: Render project, using the most recent render settings, auto-close render dialog

After playing a bit exporting regions on my current opened project (all working perfectly!) i see it takes a while for the region to actually start rendering. Like, on an almost empty Reaper project with just one track and no audio, it takes 6 seconds for my script to actually display the rendering window. That happens on every region (6 secs before it renders) so if you are exporting a bunch of sound effects -doing sound design work here- you can easily spend some minutes waiting there.

Just wanted to ask if this was normal. If its something i can tweak here to imporve those times i´d be all for it.

I remember at some point you said you had to do some tricky stuff to make this work without having to create a copy of the project. Can you tell us whats going on under the hood in such a case?

I think(!) the problem lies in mostly setting the new render-settings, which takes a moment to do. There's nothing I can do about it.

Another thing is, that my current implementation of region-render restarts a completely new render for each region, so this might take a while too.
Maybe it's possible to improve on that, using region-rendering-matrix and such, but I need to look into that further, as I never really understood the region-render-matrix(at least back then).

There's probably potential for improvement, but it'll take some more time to make it work.

In the meantime, you can use RenderTables so set the render-settings and try to work around with the region-render-matrix. Don't know (yet) how to work them programmatically...but I think, there's a way.

4.00 Beta 2.76: - "The Police - Walking on the Moon" - 20th of July 2019

Has now 977 functions with 42 new ones!

New in this release:

Parameter Learn
You can set/get/delete parameter-learning in Statechunks.
1) get a StateChunk
2) get its FXStateChunk using GetFXStateChunk
3) alter this FXStateChunk using the ParmLearn-functions
4) set this FXStateChunk using SetFXStateChunk
5) (re-)apply the final StateChunk to the Track/Item

Localize
You can localize your scripts using an external localize-file.
If that exists, ultraschall.Localize will convert your string into it's localized one, otherwise it uses it's original text.

DocEngine
long time on my list, functions for the DocEngine. With them, you can use my Reaper-internal-sourcefiles (.USDocML) and create your own conversions of them.

get_action_context_MediaItemDiff
a function, which helps you to get the diff of an MediaItem since last time calling this function. Good for RippleDrag-features.

AddSelectedItemsToRenderQueue
this adds MediaItems into the Render-Queued, either as single-queued or multiqueued-project-files(requested by Travesty)

GetUserInputs
allows now setting the length of the captions-fields.
No more cutting off of longer captions!(requested by Julian Sader)

More functions, more bugfixes, updated Reaper-docs, speedups

New features in 4.00beta2.76

Actions: GetAllActions - gets all actions, actioncommandids and scriptnames of all actions in a specific section

FXManagement: SetFXStateChunk - sets an FXStateChunk into a TrackStateChunk or MediaItemStateChunk

FXManagement: SetParmAlias_FXStateChunk - sets a parameter-alias-entry from a specific fx in an FXStateChunk

FXManagement: SetParmLearn_FXStateChunk - sets a parameter-learn-entry from a specific fx in an FXStateChunk

FXManagement: SetParmLFOLearn_FXStateChunk - sets a parameter-lfo-learn-entry from a specific fx in an FXStateChunk

GFX-Management: GFX_SetFont - sets a font to be used in a gfx-window; adjust Mac-fonts to match the size of Windows-fonts(unlike Reaper's own gfx.setfont)(code by lokasenna with contributions by Justin and Schwa)

HelperFunctions: get_action_context_MediaItemDiff - gets the MediaItemDifference(position, start, end, length, offset) since last time calling this function. Good for ripple-drag-scripts.

Localize: Localize - localizes a string, using the texts from a translationfile; can be used with or without ultraschall. at the beginning

Localize: Localize_RefreshFile - reloads an already set translation-file, so translations can be updated at runtime

Localize: Localize_UseFile - sets a translationfile, that shall be used by function ultraschall.Localize

Localize: ultraschall_translation_file_format.USLangPack - has a description of the USLangPack-fileformat for usage with the Localize-functions(see in misc-folder)

Misc: Developer_Reaper5965.ReaperLangPack - a language-pack, which displays the sections, in which the caption is located in a langpack

Helpers: GetPath - when filename has no path, it returns now "", filename

Helpers: GetUserInputs - allows now setting width of the captions-fields(requested by Julian Sader), allows now commas in captions and default-values as well; title is now the one defined by the title-parameter(used to have temporary title previously) (reported by X-Raym)

Helpers: SplitStringAtLineFeedToArray - sped up by magnitudes, should now work much faster with megabyte-strings

Render: RenderProject_Regions - produced Lua-error, when passing a filename without extension and if region was <1, returns error-messages now in that case
allows now giving an optional separator between renderfilename_with_path and regionname when addregionname=true, including /
check docs for that new feature(reported by reapero)

Scripts: HWND-Displayer.lua - reimplemented, much more comfortable now with a lot of more features.

Currently the parameter_modulation_baseline_slider of PARAMBASE is documented as always being in the range [0, 1]:

Code:

PARAMBASE number parameter_modulation_baseline_slider
number parameter_modulation_baseline_slider - between 0.0000 and 1.0000; default is 0.2500

I've investigated this for VST, VST3, JS and AudioUnit on macOS. It holds true for VST and VST3, but AU and JS plugins instead have the range that is defined by the parameter itself. One consequence of this is that when using PARAMBASE with AU and JS parameters, I first have to call reaper.TrackFX_GetParamEx() in order to get minval and maxval so that I know the range of parameter_modulation_baseline_slider, and then I need to scale accordingly.

Thought I would mention this in case you want to add it to the documentation.

Thanks for maintaining this documentation, it has been immensely useful while working on a script that I have had the need for for several years, and now it is almost working.

I've been busy for a while, but finally got some free time to look over the new beta FX param related stuff.., and WOW!!! It's coming along pretty nicely, looking forward to the reset of the Set functions.

Reading through the docs, I thought I saw something about the possibility of being able to script a "multi-clipboard", if so maybe you could include an example/helper script?

IMPORTANT!: This is a massive critical bugfix release. About 60 functions returned wrong returnvalues in case of an error.
If you use any of the functions listed in [cur]Changes from Beta 2.76 to Beta 2.761[/cur], you should check, if your scripts still work.
This is totally my fault, as I had some of them wrong to begin with.
My apologies for any inconvenience.... :/

New in this release:

Critical Bugfixes
In case of errors, many functions returned wrong returnvalues or had faulty returnvalues stated in the docs. All of them are fixed now.
Please check, if your scripts use any of the functions listed in Changes for more details.
Hope this is the last time, stuff like that happened...

GetProjectStateChunk
gets a full StateChunk of the current project(finally working!)
Now you can get all states of your project!

MediaExplorer
Get the HWND(GetMediaExplorerHWND), update the listview(UpdateMediaExplorer) and run an action, associated with the MediaExplorer-section(MediaExplorer_OnCommand).

ConvertYCoordsMac2Win
Y-coordinates on Mac are different from the ones in Windows/Linux, meaning, pixel 0 is at the bottom, while Windows/Linux start on top.
This function converts the y-coordinates between these two coordinate-systems.

New version of Config-Vars-displayer-script
Shows changed with doubles without a problem now, is faster, uses the config-var-docs included with the API to get the currently accepted config-vars.
I also improved the layout a bit.

New features in 4.00beta2.761

Helper functions: FindPatternsInString - finds all occurrences of a matching-pattern in a string

Helper functions: IsWithinTimeRange - returns, if a time is within a start and endtime, takes care of the precision-problem time-positions in Lua have

ProjectManagement: GetProjectStateChunk - returns the ProjectStateChunk of the current project(finally working!)

Scripts: ultraschall_developertool_Display-Altered-Config-Vars.lua - new version, which solves the faulty-displaying-of-double-issue, faster and improved layout. Uses now ConfigVars-Docfile to read the currently supported ConfigVars.

Trackmanagement: IsSplitAtPosition - returns, if a split/mediaitemend/mediaitemstart exists at a certain position, within certain tracks

As far as I remember, the function only covers changes in the order of the projecttabs.
I could try to add checking changed projectnames as well, if that would help, as they aren't checked for right now.

Hey Mespotine, I'm planning to use your "Check for changed Project Tabs" functions to know if I have to resave my RPL file upon closing Reaper.

But it seems like there are 2 cases that are not covered:
1- If we save the current project under another name
2- If we open another project over the current one.

Both of those cases don't change the project count thus it seems like the function does not flag that change. Am I not using it right?

Will be in the next version. Only thing not covered, if you reload the a project, means, you load the same project-file again. I'm not sure, whether I could catch that and I guess it will not be covered by GetProjectStateChangeCount...
Would this edgecase be important as well to have?

Will be in the next version. Only thing not covered, if you reload the a project, means, you load the same project-file again. I'm not sure, whether I could catch that and I guess it will not be covered by GetProjectStateChangeCount...
Would this edgecase be important as well to have?

Hi,
Thanks for the great work!
Noticed a bug in:
ultraschall.SplitStringAtLineFeedToArray(Markers)

We don't get the last line in the array
I've put the test code below, i've used another method to split the strings and it output three elements in the array instead of two for the marker array.

Code:

Markers = ultraschall.GetRegionByScreenCoordinates(reaper.GetMousePosition(), false)
--split the markers string to get the right region index
Count, split_string = ultraschall.SplitStringAtLineFeedToArray(Markers)
--code used to split
lines = {}
for s in Markers:gmatch("[^\r\n]+") do
table.insert(lines, s)
end

after the renderprojectregion-function and see, whether it displays an errormessage?
And do you use the most recent version of the US-Api? I renamed the renderregions-function by taking away the _RenderCFG-part. The old name is still there but deprecated.

If you don't know, use ultraschall.GetApiVersion() to get the installed version. The most recent is 4.00beta2.761

Maybe you can do something like breakpoints with them. If not and you have an idea, what you would have as a helper function, drop me the idea and I see what I can do.

I mostly use ultraschall.ShowLastErrorMessage() to see, what error I did.
I may include a linenumber into the error-message at some point but this needs more research on my side, so for now, there's still some kind of guessing needed.

Another trick: code some lines, check if they work as expected, code the next lines, etc, etc.
This speeds up debuggin by magnitudes, as you don't need to debug hundreds of lines.