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

Reply
 
Thread Tools Display Modes
Old 12-01-2020, 11:14 AM   #641
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Hotfix 1 available:

- RenderManagement: ApplyRenderTable_Project - didn't always apply Mono-Media and Multi-Channel-checkboxes properly -> fixed(thanks to aurelien)
- RenderManagement: ApplyRenderTable_ProjectFile - didn't always apply Mono-Media and Multi-Channel-checkboxes properly -> fixed(thanks to aurelien)

Pleas update your ReaPacks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-08-2020, 09:38 PM   #642
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default Trying to write FX data using chunks...

I have been trying to use the fx_chunk methods to save VST presets, and have a possible bug?

When I get the fx_chunk for a track containing Reaktor, it does not seem to return the whole chunk.

The proper name of the vst is:
"VSTi: Reaktor5 (Native Instruments GmbH) (2->8)"

Wondering if the '>' is messing up the chunk reading???

When I call:
Code:
 local found, trackstatechunk = ultraschall.GetTrackStateChunk_Tracknumber(tracknum)
    M.Msg('TRACK_CHUNK\n'..trackstatechunk)
I'm not seeing any of that in the console, which starts right off with:
Code:
      AAAgAAAAAQAAAAIAAAABAAAAAQAAAAEAAAABAAAApQAAAAAAAACZBQAAAQAAACAAAAABAAAAAgAAAAEA
I installed the chunk viewer, and all of this stuff shows at the beginning:
Code:
<TRACK
  NAME "Moon Track 1"
  PEAKCOL 16576
  BEAT -1
  AUTOMODE 0
  VOLPAN 1 0 -1 -1 1
  MUTESOLO 0 0 0
  IPHASE 0
  PLAYOFFS 0 1
  ISBUS 0 0
  BUSCOMP 0 0 0 0 0
  SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
  FREEMODE 0
  REC 0 5088 1 0 0 0 0
  VU 2
  TRACKHEIGHT 0 0 0
  INQ 0 0 0 0.5 100 0 0 100
  NCHAN 2
  FX 1
  TRACKID {31116F12-936E-4E2A-AC4F-B04F5EB563D2}
  PERF 0
  MIDIOUT -1
  MAINSEND 1 0
  <FXCHAIN
    WNDRECT 34 241 1051 816
    SHOW 0
    LASTSEL 1
    DOCKED 0
    BYPASS 0 0 0
    <JS _MOON/midiChStrip.jsfx ""
      1.000000 - - 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 127.000000 139.000000 - 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 1.000000 15.000000 0.000000 2.000000 48.000000 48.000000 0.000000 - 0.000000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    >
    FLOATPOS 0 0 0 0
    FXID {C47FD809-4664-41CA-9A43-70973079DC4E}
    WAK 0 0
    BYPASS 0 0 0
    <VST "VSTi: Reaktor5 (Native Instruments GmbH) (2->8ch)" Reaktor5.dll 0 ""
Okay, now I'm wondering if the console is truncating the message, since I don't see the TRACK_CHUNK title string in the console either.

So that has me back to wondering what's wrong with this code:
Code:
local found, trackstatechunk = ultraschall.GetTrackStateChunk_Tracknumber(tracknum)
    --M.Msg('TRACK_CHUNK\n'..trackstatechunk)
    local fxStateChunk = ultraschall.GetFXStateChunk(trackstatechunk)
    --M.Msg("FX_CHUNK\n"..fxStateChunk)
    local fx_lines, startoffset, endoffset = ultraschall.GetFXFromFXStateChunk(fxStateChunk, 2)
    local fx_statestring_base64, fx_statestring = ultraschall.GetFXSettingsString_FXLines(fx_lines)
    M.Msg('State String'..fx_statestring)
As state string is returning nil, both base64 and normal. I'm getting a (truncated by the console, I guess?) readout for TRACK_CHUNK, and for FX_CHUNK, but nothing for State String.

Thoughts?

EDIT: It does seem to be a problem with Reaktor. I changed the fxnum to '1', and got the first JSFX data just as expected...
__________________
eric moon
Very Stable Genius
https://gogolab.com/

Last edited by woodslanding; 12-08-2020 at 10:54 PM.
woodslanding is offline   Reply With Quote
Old 12-09-2020, 07:29 AM   #643
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Could you post the entire statechunk with the Reaktor-settings included? Then I can have a look.

Best is as the rpp-file.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-09-2020, 08:55 AM   #644
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default Rpp file

Here's that file, thanks!!
Attached Files
File Type: rpp Scripting.rpp (36.4 KB, 88 views)
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-15-2020, 08:45 PM   #645
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by woodslanding View Post
I have been trying to use the fx_chunk methods to save VST presets, and have a possible bug?

When I get the fx_chunk for a track containing Reaktor, it does not seem to return the whole chunk.

The proper name of the vst is:
"VSTi: Reaktor5 (Native Instruments GmbH) (2->8)"

Wondering if the '>' is messing up the chunk reading???

When I call:
Code:
 local found, trackstatechunk = ultraschall.GetTrackStateChunk_Tracknumber(tracknum)
    M.Msg('TRACK_CHUNK\n'..trackstatechunk)
When I use the following code, I get the full statechunk on your example-project for track 1:

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

found, trackstatechunk = ultraschall.GetTrackStateChunk_Tracknumber(1)
print(trackstatechunk)
So I either guess, what you put into the variable tracknum isn't a valid one(which would explain why it didn't output anything) or the function M.msg() is buggy(can't check, as it's not written by me).

You can safely use print("hello world") with Ultraschall-API to print out stuff. It's faster to type for such things and cleans up your code.
You can also use ToClip("hello world") to output a string to clipboard. This sometimes helps seeing too, if a string has a valid value.

And use SLEM() in your scripts to check, whether an Ultraschall-API function throws an error. This helps everyday-debugging a lot. Maybe this gives you an additional hint in your script, where the error could be.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-16-2020, 10:13 AM   #646
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
When I use the following code, I get the full statechunk on your example-project for track 1:

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

found, trackstatechunk = ultraschall.GetTrackStateChunk_Tracknumber(1)
print(trackstatechunk)
So I either guess, what you put into the variable tracknum isn't a valid one(which would explain why it didn't output anything) or the function M.msg() is buggy(can't check, as it's not written by me).

You can safely use print("hello world") with Ultraschall-API to print out stuff. It's faster to type for such things and cleans up your code.
You can also use ToClip("hello world") to output a string to clipboard. This sometimes helps seeing too, if a string has a valid value.

And use SLEM() in your scripts to check, whether an Ultraschall-API function throws an error. This helps everyday-debugging a lot. Maybe this gives you an additional hint in your script, where the error could be.
M.Msg is from Scythe. I'll try out print...

ToClip() shows that the issue is in fact that the console is truncating the output....

So can you tell me why fx_statestring here is returning nil, then? I am getting a complete chainChunk, and fxLines, as verified by the clipboard:

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

local found, trackChunk = ultraschall.GetTrackStateChunk_Tracknumber(1)
local chainChunk = ultraschall.GetFXStateChunk(trackChunk)
local fxLines = ultraschall.GetFXFromFXStateChunk(chainChunk, 2)
local fx_statestring_base64, fx_statestring = ultraschall.GetFXSettingsString_FXLines(fxLines)
ToClip(fx_statestring..'\n')  --returns nil, as does the base64 version.
Thanks!
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-16-2020, 04:11 PM   #647
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Ok, there's actually a bug in GetFXSettingsString_FXLines. I'll fix it.

GetFXFromFXStateChunk also seems to be hellish slow, when using it on fx 1 in the code. Dunno why but I think, I should improve on that too, as it's only a small jsfx and shouldn't take seconds to parse out.

Edit:
GetFXFromFXStateChunk was slow after some recent, yet unreleased, changes. I could fix it, thanks to your bugreport as well

So, both should be fixed in the next release coming within the next few days(probably together with Reaper 6.19)

Thanks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish

Last edited by Meo-Ada Mespotine; 12-16-2020 at 04:40 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-17-2020, 10:18 PM   #648
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Thank YOU
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 12-24-2020, 07:19 PM   #649
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

4.2.002 - "Dave Brubeck - Take Five" - 25th of December 2020

Has now 1359 functions, with 8 new ones

new in this release:
  • Get/Set Comment-field of fx
    You can now get and set the comment-field of trackfx and takefx programmatically. Also gave me the chance to fix some bugs as well
  • Linesorting script for clipboard-content
    Sometimes, you would love to sort the lines in the clipboard. Now you can, using the new developer-tool.
  • bugfixes and docs
    various bugfixes and update to Reaper Internals to Reaper 6.19, SWS 2.12.1.1, JS-extension 1.220

New features in 4.2.002
  • DeveloperTools: ultraschall_developertool_SortLinesInClipboardText .lua - sorts the lines of the string in the clipboard
  • FX-Management: CountFXFromFXStateChunk - counts the number of fx in an FXStateChunk
  • FX-Management: GetFXComment_FXStateChunk - allows getting the comment of an fx within an FXStateChunk(requested by en5ca)
  • FX-Management: GetTrackFXComment - gets the text in the comment-field of a trackfx(requested by en5ca)
  • FX-Management: GetTakeFXComment - gets the text in the comment-field of an itemfx(requested by en5ca)
  • FX-Management: InputFX_GetComment - gets the text in the comment-field of an inputfx
  • FX-Management: SetFXComment_FXStateChunk - allows setting the comment of an fx within an FXStateChunk(requested by en5ca)
  • FX-Management: SetTrackFXComment - sets the text in the comment-field of a trackfx(requested by en5ca)
  • FX-Management: SetTakeFXComment - sets the text in the comment-field of an itemfx(requested by en5ca)

    Changes from 4.2.001 to 4.2.002
  • API: Settings - allows now turning on/off confirmation dialogs in certain devtools(for streamlined manipulation of strings); had some bug, when not set a value yet -> fixed
  • Docs: Reaper Internals - updated to Reaper 6.19 and SWS 2.12.1.1 and JS-extension 1.220
  • File-Management: PreviewMediaFile - allows now setting the output-channel of the preview as well
  • FX-Management: GetFXFromFXStateChunk - didn't return possible comment-field -> fixed
  • FX-Management: GetFXSettingsString_FXLines - didn't work due stupid bug on my side; crashed when an fx didn't have fx-lines available -> both fixed(thanks to woodslanding)
  • Helper functions: EditReaScript - allows now opening the last file you opened up with this function by passing nil; adding Ultraschall-API is now supported; optionally add this script to the actionlist; docs were wrong -> fixed
  • Helper functions: Base64_Decoder - fixed off-by-one-error that could mess up the last character in the Base-64-string under certain conditions
  • Helper functions: Base64_Encoder - had inner variable exposed -> fixed
  • RenderManagement: ApplyRenderTable_Project - didn't always apply Mono-Media and Multi-Channel-checkboxes properly -> fixed(thanks to aurelien)
  • RenderManagement: ApplyRenderTable_ProjectFile - didn't always apply Mono-Media and Multi-Channel-checkboxes properly -> fixed(thanks to aurelien)



Please update it via ReaPack using: https://github.com/Ultraschall/ultra..._api_index.xml
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-25-2020, 08:00 AM   #650
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 313
Default

Very good! Thank you!
en5ca is offline   Reply With Quote
Old 12-29-2020, 01:09 AM   #651
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 251
Default

This is a lot of work! Thank you!
I wish I was a podcaster so I'd get to use ultrashall 4 which looks stunning!

I might try to code a cascade hw outputs with your API!
80icio is offline   Reply With Quote
Old 01-03-2021, 11:10 AM   #652
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 251
Default

Hi!
I'm looking for an API that returns if a trackgroup is enabled .

I've found GetProject_GroupDisabled on your API list,
I'm trying to write a simple script like this in order to see what

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
projectfilename_with_path = ultraschall.GetProjectFilename()
disabled1, disabled2 = ultraschall.GetProject_GroupDisabled(projectfilename_with_pat)
reaper.ShowConsoleMsg(tostring(projectfilename_with_path) .. " " .. disabled1 .. " - " .. disabled2 .. "\n")
but i keep on getting nil 0 - 0

what am i missing?
Thank u
80icio is offline   Reply With Quote
Old 01-03-2021, 02:45 PM   #653
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 11,975
Default

^^ There seems to be a typo (not sure that's the cause though):
line 2: projectfilename_with_path
line 3: projectfilename_with_pat
nofish is offline   Reply With Quote
Old 01-03-2021, 11:49 PM   #654
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 470
Default

I followed the instructions to install the API. Upon saving the installation/test script, I see the following.

Functions-Engine=on
Data-Engine=off
Gui-Engine=off
Sound-Engine=off
Video-Engine=off
Doc-Engine=off
Tag-Engine=off
Network-Engine=off

Beta-Functions:
Functions-Beta-Engine=off
Data-Beta-Engine=off
Gui-Beta-Engine=off
Sound-Beta-Engine=off
Video-Beta-Engine=off
Doc-Beta-Engine=off
Tag-Beta-Engine=off
Network-Beta-Engine=off

Is this the normal response, or should more of these be "on"?
earhax is offline   Reply With Quote
Old 01-04-2021, 01:19 AM   #655
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 251
Default

Quote:
Originally Posted by nofish View Post
^^ There seems to be a typo (not sure that's the cause though):
line 2: projectfilename_with_path
line 3: projectfilename_with_pat
thanks
definitely a rookie mistake, either way I corrected it but still have no results
80icio is offline   Reply With Quote
Old 01-04-2021, 02:09 AM   #656
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by earhax View Post
I followed the instructions to install the API. Upon saving the installation/test script, I see the following.

Functions-Engine=on
Data-Engine=off
Gui-Engine=off
Sound-Engine=off
Video-Engine=off
Doc-Engine=off
Tag-Engine=off
Network-Engine=off

Beta-Functions:
Functions-Beta-Engine=off
Data-Beta-Engine=off
Gui-Beta-Engine=off
Sound-Beta-Engine=off
Video-Beta-Engine=off
Doc-Beta-Engine=off
Tag-Beta-Engine=off
Network-Beta-Engine=off

Is this the normal response, or should more of these be "on"?
You're right. I'll fix it. Thnx.

Nevertheless, if this was shown, Ultraschall-Api is correctly installed.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-04-2021, 02:11 AM   #657
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by 80icio View Post
thanks
definitely a rookie mistake, either way I corrected it but still have no results
From the currently opened project or from a projectfile?
Due Api-limitations, most GetProject functions only support rpp-projectfiles.

You can add SLEM() at the end of the script. If an error occurs, SLEM() will give you a hint.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-04-2021, 03:48 AM   #658
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 251
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
From the currently opened project or from a projectfile?
Due Api-limitations, most GetProject functions only support rpp-projectfiles.
I'd need that info from the current opened project, do you mean it's not possible?

Thanks for the SLEM function, very helpful!
80icio is offline   Reply With Quote
Old 01-04-2021, 06:08 AM   #659
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

If it's not possible using Reaper's own API, it is impossible.

Edit:
Try these
https://mespotin.uber.space/Ultrasch...roupFlagsState
https://mespotin.uber.space/Ultrasch...lags_HighState

Maybe they are what you need.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-04-2021, 09:06 AM   #660
80icio
Human being with feelings
 
Join Date: Mar 2016
Location: Italy
Posts: 251
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
If it's not possible using Reaper's own API, it is impossible.

Edit:
Try these
https://mespotin.uber.space/Ultrasch...roupFlagsState
https://mespotin.uber.space/Ultrasch...lags_HighState

Maybe they are what you need.
Thanks so much, I've already came across those functions but it's not my case.

In the meantime I was successful and had some results from your function GetProject_GroupDisabled (besides I still need to figure out how to translate bitfields infos to track group numbers)

I'm wondering if there's any way to access temporary project infos while the project exists but it's unsaved. Have you tried something similar?

edit: I mean projects that have been saved already but are unsaved at the moment I need to get data from projectstatechunk related functions like GetProject_GroupDisabled
80icio is offline   Reply With Quote
Old 01-04-2021, 10:28 AM   #661
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

I only have GetProjectStateChunk, but this function is unstable so not recommended.
I have ideas to improve it, but haven't been able to code that yet.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-05-2021, 05:16 PM   #662
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default Question about Defer

I'm having trouble getting my head around the defer functions....

I'm working on a method to convert banks of factory vst presets to rpls. The approach is like so:

1. Make a list of all preset names that need converting, using inputs for fxnum and tracknum
2. Select the first preset in the list
3. Load that preset

WAIT -- this might take a while... would love to be able to query reaper for proof that the preset has loaded, but really it's not worth the trouble... just wait longer than we expect it to take.

4. Increment the preset number
go back to #3

Functions for 1,2, and 3 have been figured out and are working....

Since I need to take inputs for fxnum and tracknum, this can't be the main method. I keep getting lost about where I can increment the preset number. Will it have to be a global variable? I can't figure out another way...
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 01-05-2021, 08:44 PM   #663
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

HAH, Got it!

I actually put the increment for the preset number in the call to the deferred method.... works great!

Mespotine, I have to see if you have a donate button somewhere, your code has been so useful! And the instructional material as well. I couldn't have done it with out the instructions on .ini files, encodings, and track chunks...

At the very least, know your work is being appreciated and used
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 01-05-2021, 10:03 PM   #664
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 470
Default

Anyone know if there is a way (either with Ultraschall API or Reaper API) to pass data from a clicked menu button's text string into the script it's triggering? If so, please let me know how to do it.

Additional info (for the curious minds who want to know): I'm currently working on a horizontal zoom preset system similar to the one in Pro Tools where the user can Cmd/Ctrl-click one of the buttons numbered 1-5 to save a zoom preset, then click normally or type number 1-5 on the keyboard to recall it. But mine will have 10 buttons since Reaper is twice the DAW that PT is.

I've already got it working using one script to save the hzoom level, and 10 recall scripts that are completely identical aside from the script names containing different numbers.

The save script prompts the user for a slot number, and writes the data to the project notes, thus making it accessible/tweakable at runtime, and fast/easy to copy from one open project/tab to another.

The recall scripts use the Ultraschall API to get the hzoom slot number from the script name string using a match command, load the zoom value for it, and execute the zoom function. But I'd like to eliminate the redundancy, and instead just have one "recall hzoom from slot number" script that will be able to use either keyboard character input data, or get the number from the text string of the menu button pressed.

My long term goal is to implement one of my favorite features from Pro Tools that is sadly missing in Reaper: the memory location system. This is similar to Reaper's screensets/track views or snapshots system, except it has a better UI, more functionality, and can store up to (IIRC) 999 presets. And, in addition to horizontal zoom levels, cursor position, and track heights and view/hide settings, a single memory location can also enable/disable track groups, load window configurations, time/loop selections, and other saved settings.

Ideally, I'd like to figure out how I could also save and load these presets using keyboard input sequences. In Pro Tools, using the numeric keypad keys, I think you type .[number]. to load a location number, and .[number]+ to save or edit a stored location (I'm not 100% certain since, luckily, it's been quite a while since I've needed to use Pro Tools ). But, as far as I can tell, there's nothing in the Reaper API (or Ultraschall) that would allow me to trigger a script from a key sequence. The closest thing I can think of would be using keyboard shortcuts to initiate actions/scripts that load a GUI prompt for user input, then trigger the corresponding save/edit functionality for the entered memory slot number.

If anyone has any info that might help, or knows how to get the text string data from a pressed menu button into the script it trigers, or knows how I might accomplish the triggering of a script and passing data from keyboard character input sequences without loading a GUI prompt, please let me know!
earhax is offline   Reply With Quote
Old 01-06-2021, 03:07 AM   #665
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by woodslanding View Post
HAH, Got it!

I actually put the increment for the preset number in the call to the deferred method.... works great!

Mespotine, I have to see if you have a donate button somewhere, your code has been so useful! And the instructional material as well. I couldn't have done it with out the instructions on .ini files, encodings, and track chunks...

At the very least, know your work is being appreciated and used
Fantastic. I like that it's helpful for you so my hard work gives you opportunities to code the stuff you need.



For donation, I think it's in the signature. Though I should remove the patreon link from the donationways, as it does not exist anymore.
The rest is still valid.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-06-2021, 05:24 AM   #666
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 87
Default Lua documentation tool

Thanks for this great API and all the accompanying reaper doc!

I remember stumbling over a thread/post in which you talk about your own documentation tool for your lua/REAPER code and I wanted to ask if it is available for use in one's one code? That would be amazing!

Kind regards,
Lukas
LuCsa is offline   Reply With Quote
Old 01-06-2021, 05:45 AM   #667
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

I have created my own documentation-fileformat, which is quite easy to use yourself. I also have some functions in the docs

https://mespotin.uber.space/Ultraschall/US_Api_DOC.html

that allow parsing and taking apart these documentation-blocks within a file.

To give you a hint how this basically looks like, have a look at this file:
https://github.com/Ultraschall/ultra...r-docs.USDocML

It includes tons of so called "USDocBlocs" with one for each function. So this file documents all functions and variables for the video-processor, with which I create this doc:
https://mespotin.uber.space/Ultrasch...mentation.html

I also use it, to have my docs "inline" within the functions, so I can update them when I changed something in the functions.
This file gives you a hint, where I put the USDocBlocs within the function:

https://github.com/Ultraschall/ultra....lua#L197-L225

This includes description, parameters, retvals, etc.

If you think, this could benefit you, I can write down a description on how to write that and a basic parser, with which you can parse the file.
The parsed out information can then be used by you to create any file you want, may it be XML, HTML or whatever you'd like to.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-06-2021, 05:50 AM   #668
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by earhax View Post
Anyone know if there is a way (either with Ultraschall API or Reaper API) to pass data from a clicked menu button's text string into the script it's triggering? If so, please let me know how to do it.
What do you mean exactly? Like, having two buttons share the same script but depending on the pressed button, this one script behaves differently?

This will probably not possible, I'm afraid, as scripts can't know, which menu or button has been selected in the first place. And buttons and menus cannot send parameters themselves to the script to be interpreted.
So you either hardcode it via multiple scripts or you have no chance (if I understood your question right).
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-06-2021, 09:55 PM   #669
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Fantastic. I like that it's helpful for you so my hard work gives you opportunities to code the stuff you need.



For donation, I think it's in the signature. Though I should remove the patreon link from the donationways, as it does not exist anymore.
The rest is still valid.
Well, once I translated it from Deutsch I was able to send you a coffee or two. Glad I didn't try the patreon... thanks again!

-eric
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 01-07-2021, 09:44 AM   #670
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by woodslanding View Post
Well, once I translated it from Deutsch I was able to send you a coffee or two. Glad I didn't try the patreon... thanks again!

-eric
I thank you
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-07-2021, 03:15 PM   #671
gxray
Human being with feelings
 
Join Date: Dec 2020
Location: Miami, FL USA
Posts: 394
Default

Hey Mespotine,

----

Thanks again for the heads-up about the Lua methods for parsing USDocML.
I have managed to rewrite my code using this =)

However, I would like to add support for the Ultraschall API methods to my VS Code extension too, and I noticed there is no pre-generated .USDocML for the file that gets output as "/Documentation/US_Api_Functions.html", from the "Ultraschall_Doc_Func_Converter.lua" file.

It seems like no intermediate file is generated -- you just read the folder of source code into strings in-memory, and then process it there and spit out the HTML.

I see a function, "ultraschall.SplitUSDocBlocs(String)", would I be able to use either this or the standard "ultraschall.Docs_GetAllUSDocBlocsFromString() ", and provide it the contents of all the files which have USDocML commented functions as string input?

By the way, here is the source for my little parser/serializer. I made the "ultraschall_doc_engine.lua" file standalone by pulling all the dependency functions into it, so that it can be run outside of Reaper from the commandline:

https://gist.github.com/GavinRay97/1...ile-parser-lua

You obviously know the API better than anyone, so just want to check I'm doing this right so far

Example, no USDocML file for method

Last edited by gxray; 01-07-2021 at 03:23 PM.
gxray is offline   Reply With Quote
Old 01-08-2021, 02:20 PM   #672
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 87
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
I have created my own documentation-fileformat, which is quite easy to use yourself. I also have some functions in the docs

https://mespotin.uber.space/Ultraschall/US_Api_DOC.html

that allow parsing and taking apart these documentation-blocks within a file.

To give you a hint how this basically looks like, have a look at this file:
https://github.com/Ultraschall/ultra...r-docs.USDocML

It includes tons of so called "USDocBlocs" with one for each function. So this file documents all functions and variables for the video-processor, with which I create this doc:
https://mespotin.uber.space/Ultrasch...mentation.html

I also use it, to have my docs "inline" within the functions, so I can update them when I changed something in the functions.
This file gives you a hint, where I put the USDocBlocs within the function:

https://github.com/Ultraschall/ultra....lua#L197-L225

This includes description, parameters, retvals, etc.

If you think, this could benefit you, I can write down a description on how to write that and a basic parser, with which you can parse the file.
The parsed out information can then be used by you to create any file you want, may it be XML, HTML or whatever you'd like to.

Hello!

I'm sure it would benefit us! And it would be awesome, if you added the description and parser, so we can also generate documentation for our own (and shared!) modules! Thank you!

Kind regards,
Lukas


PS.: Maybe, gxray's standalone version is already something we could use?
LuCsa is offline   Reply With Quote
Old 01-08-2021, 03:08 PM   #673
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,961
Default

hey mespotine!
with the new dev how are your GetProjectStateChunk working?
is there already a way to SetProjectStateChunk ? (didn't find in yours doc )

This could open some good doors to reaper I think hahah.
daniellumertz is offline   Reply With Quote
Old 01-12-2021, 06:12 AM   #674
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 87
Default

By the way! Do you guys and ladies think that it would be possible to somehow make (if present) such html documentation available via ReaPack as well? As in a button, for instance, that opens the index page of the documentation if it is found inside a folder called doc/html/ for instance?

cheers
LuCsa is offline   Reply With Quote
Old 01-14-2021, 01:48 PM   #675
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by daniellumertz View Post
hey mespotine!
with the new dev how are your GetProjectStateChunk working?
is there already a way to SetProjectStateChunk ? (didn't find in yours doc )

This could open some good doors to reaper I think hahah.
If I could pull this off, I would be your new Overlord.. pardon.. Overlady of coding.

Sadly it's not possible (yet) as I have not found any part of Reaper to sneak in projectchanges.

GetProjectStateChunk however will now work reliably in Reaper 6.20+ due some recent dev-changes.
Will be in the next release. So at least getting all states is now possible properly.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2021, 01:50 PM   #676
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by LuCsa View Post
By the way! Do you guys and ladies think that it would be possible to somehow make (if present) such html documentation available via ReaPack as well? As in a button, for instance, that opens the index page of the documentation if it is found inside a folder called doc/html/ for instance?

cheers
You mean you want to download the docs only? Otherwise you can open the docs already, as there are actions installed when you install Ultraschall-Api. Just search for docs in the actionlist.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2021, 01:51 PM   #677
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by LuCsa View Post
Hello!

I'm sure it would benefit us! And it would be awesome, if you added the description and parser, so we can also generate documentation for our own (and shared!) modules! Thank you!

Kind regards,
Lukas


PS.: Maybe, gxray's standalone version is already something we could use?
I'll do one for the next release.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2021, 01:54 PM   #678
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,491
Default

Quote:
Originally Posted by gxray View Post
Hey Mespotine,

----

Thanks again for the heads-up about the Lua methods for parsing USDocML.
I have managed to rewrite my code using this =)

However, I would like to add support for the Ultraschall API methods to my VS Code extension too, and I noticed there is no pre-generated .USDocML for the file that gets output as "/Documentation/US_Api_Functions.html", from the "Ultraschall_Doc_Func_Converter.lua" file.

It seems like no intermediate file is generated -- you just read the folder of source code into strings in-memory, and then process it there and spit out the HTML.

I see a function, "ultraschall.SplitUSDocBlocs(String)", would I be able to use either this or the standard "ultraschall.Docs_GetAllUSDocBlocsFromString() ", and provide it the contents of all the files which have USDocML commented functions as string input?

By the way, here is the source for my little parser/serializer. I made the "ultraschall_doc_engine.lua" file standalone by pulling all the dependency functions into it, so that it can be run outside of Reaper from the commandline:

https://gist.github.com/GavinRay97/1...ile-parser-lua

You obviously know the API better than anyone, so just want to check I'm doing this right so far

Example, no USDocML file for method
For Ultraschall-Api, you just need to parse a handful of .lua-files.
I'll add a list of the files in question into the misc-folder, so you just need to read the files given in that list, as some of the lua-files could create problems when you parse them as well.

It's easier than describing which file to parse.

You can parse them just like the USDocML-files.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2021, 07:49 PM   #679
gxray
Human being with feelings
 
Join Date: Dec 2020
Location: Miami, FL USA
Posts: 394
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
For Ultraschall-Api, you just need to parse a handful of .lua-files.
I'll add a list of the files in question into the misc-folder, so you just need to read the files given in that list, as some of the lua-files could create problems when you parse them as well.

It's easier than describing which file to parse.

You can parse them just like the USDocML-files.
Oh okay awesome, thanks! So roughly something like this then, where sourcefiles is the list of Lua filenames from the text file?

Code:
for _, sourcefile in pairs(sourcefiles) do
  local file = io.open(sourcefile , "r");
  local text = file:read("*a")
  local _, docblocks = ultraschall.Docs_GetAllUSDocBlocsFromString(text)
end
__________________
Seasoned codemonkey
Dunno a thing about making music (here to learn!)
gxray is offline   Reply With Quote
Old 01-14-2021, 08:54 PM   #680
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,961
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
If I could pull this off, I would be your new Overlord.. pardon.. Overlady of coding.

Sadly it's not possible (yet) as I have not found any part of Reaper to sneak in projectchanges.

GetProjectStateChunk however will now work reliably in Reaper 6.20+ due some recent dev-changes.
Will be in the next release. So at least getting all states is now possible properly.
You already are!

Keep up, the time of having get/set project chunks will come hahaha
thx!
daniellumertz 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 05:20 PM.


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