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

Reply
 
Thread Tools Display Modes
Old 12-05-2019, 09:38 AM   #361
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

I'm in the final stages of the first "real" version of Ultraschall-API, which isn't beta anymore and would like to ask, has somebody of you found any problems with Ultraschall-API and Reaper v6 so far?

It should work and the only bug I found is already fixed in the latest but still, I'm not sure yet.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-19-2019, 09:35 AM   #362
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

4.00 Beta 2.79: - "Yes - Owner of a lonely heart"

Has now 1082 functions, with 12 new ones

New in this release:

NOTE: There are some new features, who make use of Reaper v6-features. Please update soon, as Reaper 6 will be a requirement soon!
  • Speedup when loading US-API
    I made a modules-system, which speeds up loading and initalization as well as memory-use of the Ultraschall-API by magnitudes.
    This approach loads only the functions needed by your script(used to load all functions in earlier versions).
    The loading is now about 86% faster and memoryuse if 56% less.
    And what do you need to do to make use of the modules approach?
    Well, nothing. The Ultraschall-API does it for you! (requested by many, so hope, this helps you a lot).
  • Marker/Region Extstates
    Reaper 6.02 added some new features, which gives a unique guid for a marker. This again, helped me adding a feature I wanted to have for a long time: Marker/Region Extstates.
    They work like regular ProjectExtStates, but have the benefit, that they allow saving additional key-value stores associated with a certain marker/region.
    And even if you change the whole order of the markers, the extstates will still be attached to the marker of your choice.
    Possible usecase: storing the render-format-settings as region-extstates for region-rendering or simply adding additional metadata to markers/regions, that are needed but would spam the markertitle shown in the arrangeview.
    Experiment with it, you'll quickly get the idea and ideas for practical usecases!
  • Blitting an image centered
    Sometimes, you want to blit an image into gfx-windows centered. Problem is: it's not easy to do. Until now, as I added the function
    GFX_BlitImageCentered, which does exactly that.
    That means, you can pass to the function the position of the center of the image and change rotate/scale. This makes zooming in and out of images much more easier, as they stay at their position.
  • Subtitles SRT-import/export
    You can import and export now SRT-files for subtitles. This should allow you to use regions as subtitle-feature.
  • ConvertStringToBits and ConvertBitsToString
    This can be helpful, if you have a string, which represents a binary-number: Just convert it with this function and voila, you can work with the bits themselves.
    And if you need to do it the other direction, use ConvertBitsToString. That way, you can work easily on a bitlevel, if fiddling with bitshifting is too difficult for you.
  • Bugfixes with ArrangeViewSnapShots, Markers
    Should now work like a charm.
New features in 4.00beta2.79
  • API: loadspeed - sped up loading speed by 86%, as API will now only load functions, actually needed, not all of them; memory need is reduced by about 56%.
  • Docs: Reaper Internals - updated to Reaper 6.02
  • ExtStateManagement: GetMarkerExtState - gets an extstate from a specific marker/region
  • ExtStateManagement: SetMarkerExtState - sets an extstate for a specific marker/region
  • GFX: GFX_BlitImageCentered - blits an image centered at a given position, to make "zooming"-effects easy to produce
  • Helper Functions: ConvertBitsToString - converts a table with bits(entries with 0 or 1) into its string-representation
  • Helper Functions: ConvertStringToBits - converts a string into its bit-representation
  • Markermanagement: GetMarkerIDFromGuid - get the markerid from a guid
  • Markermanagement: GetGuidFromMarkerID - get the guid from a marker
  • Scrubbing: Scrubbing_MoveCursor_GetToggleState - gets the current toggle-state for when scrubbing using an action/surface
  • Scrubbing: Scrubbing_MoveCursor_Toggle - toggles the state for when scrubbing using an action/surface
  • Subtitles: ReadSubtitles_SRT - imports a SubRip-srt-subtitlefile
  • Subtitles: SaveSubtitles_SRT - export a SubRip-srt-subtitlefile
Changes from Beta 2.78 to Beta 2.79
  • API: Reapack-API-xml-generator.lua - didn't correctly create zip-archive of the API stored in GitHub -> fixed
  • ArrangeView Snapshots: DeleteArrangeviewSnapshot - deleted all Arrangeview-Snapshots instead of the slot-one and didn't check for valid value for parameter slot -> fixed
  • ArrangeView Snapshots: IsValidArrangeviewSnapshot - regression, didn't return false, if no snapshot was available in a certain slot -> fixed
  • ArrangeView Snapshots: RetrieveArrangeviewSnapshot - had inner variable exposed -> fixed
  • ConfigurationManagement: CountValuesByPattern - didn't count at all(for some reason), errors in docs -> fixed(thanks to reapero)
  • Developer: ultraschall_developertool_Display-Altered-Config-Vars.lua - didn't work with rc-pre-releases of Reaper -> fixed
  • Marker Management: AddCustomRegion - was expecting length, although declared as regionend in the docs -> fixed
  • Marker Management: MoveRegionsBy - still had debug-code in it, which could display messageboxes and overwrite global variables -> fixed (sorry for that)
  • Marker Management: SetCustomRegion - had docs of AddCustomRegion -> fixed
  • Project Management: GetProject_MarkersAndRegions - supports now guids of markers and regions, as introduced in Reaper 6.02
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-20-2019, 02:03 AM   #363
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

Nice for the uploading speed ! It was my main concern with using such big library :P (not for my personal scripts but for script I share at least).



So if it now only loads what is necessary... Seems as good as it can get !


Thx !
X-Raym is offline   Reply With Quote
Old 12-20-2019, 09:17 AM   #364
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

I think, I can improve even further(I have...ideas*), but need some time to rest, after that much stuff I coded this year for the API


*that's how every evolutionary step or amargeddon starts
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-23-2019, 03:47 AM   #365
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 304
Default

I'm waiting for an Armageddon
Ivannn Bennnettt is offline   Reply With Quote
Old 01-05-2020, 10:05 AM   #366
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Hotfix 1 now available.
5th of January 2020

Changes:
- EventManager: Eventmanager_RemoveEvent - didn't work with new speedup-improvements -> fixed(thanks to rstockm)
- EventManager: Eventmanager_RemoveAllEvents_Script - - didn't work with new speedup-improvements -> fixed
- Docs: had typo in the functionnames of Eventmanager_RemoveEvent and Eventmanager_RemoveAllEvents_Script -> fixed

Please update your ReaPacks.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-07-2020, 06:40 AM   #367
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default SetFXStateChunk with FX chain file content

Hi Mespotine,


Code:
boolean retval, optional string alteredStateChunk = ultraschall.SetFXStateChunk(string StateChunk, string FXStateChunk)

I tried to use it to insert FX chains file content, but it doesn't seems to work,
the validator functions tolds me that this file content isn't a valid FX state chunk (which I think it i supposed to be)



Is there a subtle differnece I missed between FX chains file content and FX state chunk ?


Thx for your assistance !
X-Raym is offline   Reply With Quote
Old 01-07-2020, 06:54 AM   #368
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

Ok I see,


regular take FXs have
Code:
 <TAKEFX
...
>

which isn't present in FX chains file content.


A funciton to support this would be very nice :P


----
Bug report:


Doc says that take ID is optionnal for GetFXStateChunk but it doesn't seems to be the case. I had to put '1' as ID.


Question, if optional, would it only consider active take right ?
X-Raym is offline   Reply With Quote
Old 01-07-2020, 07:09 AM   #369
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default Set FX chain chunk bug

I tried to add <Take FX > to my FX chain file content to see if it could works,


the FX chain is validated by ultrashall validator function but I get this error when trying to set the altered string to an item:


Code:
...i//Modules/ultraschall_functions_FXManagement_Module.lua:1726: bad argument #1 to 'gsub' (string expected, got nil)

Code:
      if ultraschall.IsValidFXStateChunk(FXStateChunk) then
        retval, StateChunk = reaper.GetItemStateChunk( item, '', false )
        retval, alteredStateChunk = ultraschall.SetFXStateChunk(StateChunk, FXStateChunk)
        reaper.SetItemStateChunk( item, alteredStateChunk, true)
      end

Do you see any error in this code ?

Can this because I didn't add propper indendation to every line of my FX chain chunk ?
(I suspect - cause the chunk is validated by your validator funciton) and hope that the set Chunk functions doesn't need propper indendations).

EDIT
I discover that we have to put take ids

Code:
      if ultraschall.IsValidFXStateChunk(FXStateChunk) then
        take_id = reaper.GetMediaItemInfo_Value( item, "I_CURTAKE" )
        retval, StateChunk = reaper.GetItemStateChunk( item, '', false )
        retval, alteredStateChunk = ultraschall.SetFXStateChunk(StateChunk, FXStateChunk)
        reaper.SetItemStateChunk( item, alteredStateChunk, true, take_id  )
      end
In this case, no crash, bu it still don't work.

Last edited by X-Raym; 01-07-2020 at 07:36 AM. Reason: Remove ID
X-Raym is offline   Reply With Quote
Old 01-07-2020, 07:22 AM   #370
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default Missing parameter in doc

Code:
boolean retval, optional string alteredStateChunk = ultraschall.SetFXStateChunk(string StateChunk, string FXStateChunk)

Just discover that this definition lacks the optional ID parameter :P
X-Raym is offline   Reply With Quote
Old 01-07-2020, 07:26 AM   #371
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Thanks, I'll look into it.

Looks like it's time for Hotfix 2

It's all probably oversights on my side, as fas as I see.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-07-2020, 07:38 AM   #372
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

@mespotine
Ok many thanks !



I edit my post on https://forum.cockos.com/showpost.ph...&postcount=369


with code with and without take ID.


With take ID it doesnt break but it still don't work. The reutrned alteredStateChunk is nil.
X-Raym is offline   Reply With Quote
Old 01-07-2020, 08:49 AM   #373
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Yeah, it's time, I take on the take-management to take it to new heights.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-07-2020, 08:55 AM   #374
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

Ok then I pause my script for now,


waiting for your magic :P


Good luck !
X-Raym is offline   Reply With Quote
Old 01-07-2020, 09:07 AM   #375
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Thank you for your detailed bugreports. This may help me getting my head around that more quickly, especially with my limited time right now(we're working on our next Ultraschall4-Extension release so API-development is very limited currently).
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-14-2020, 09:19 AM   #376
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

@XRaym

I fixed all the bugs for the next version of the API, but I couldn't really get the problem you have with FXStateChunks.
Can you give me two FXStateChunks, the original one and the one after insertion of the new FX?
With thatm I could work with the actual material for debugging.

One more thing: Currently there's no function for inserting, removing and counting FX in FXStateChunks, so SetFXStateChunk only supports setting already existing FXses.
Maybe this is the confusion(and I reworked the docs to clear up this confusion a bit).

Also means: I'll add the missing functions in the next update.


BTW: Did I understand correctly, that you're working on the first official US-API-requiring script?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-14-2020, 10:27 AM   #377
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

@mespotine
Thx for your work !


Quote:
Can you give me two FXStateChunks, the original one and the one after insertion of the new FX?
FX chunk are just one coming from FXchain file. No matter which one. You can try with any of your
X-Raym is offline   Reply With Quote
Old 01-14-2020, 10:29 AM   #378
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

Quote:
BTW: Did I understand correctly, that you're working on the first official US-API-requiring script?
What do you mean ? There are various scripts which uses ultraschall API already !
X-Raym is offline   Reply With Quote
Old 01-14-2020, 11:03 AM   #379
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Oh, didn't know that
How can I find them. Via ReaPack?
One thing still missing, that I should write a small code-snippet for insertion into such a script, that gives feedback to the user, if Ultraschall-API is not installed.
ToDoList.



In regards of FXStateChunk, I need yours, as mine may not have the problems yours have, so I may not be able to reproduce the buggy behavior.
At least, I tried yesterday to no avail.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-14-2020, 11:13 AM   #380
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,530
Default

Quote:
Originally Posted by mespotine View Post
Oh, didn't know that
How can I find them. Via ReaPack?
One thing still missing, that I should write a small code-snippet for insertion into such a script, that gives feedback to the user, if Ultraschall-API is not installed.
Try:
Code:
local UltraSchall, err = loadfile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
if err then reaper.MB("Couldn't load Ultraschall:\n\n"..err, 0); return; end
UltraSchall()
For performance you'd be better off having US return itself so it can be stored in a local variable rather than a global. The difference can be significant for scripts accessing it frequently.
Lokasenna is offline   Reply With Quote
Old 01-14-2020, 11:14 AM   #381
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,782
Default

Thanks, will try that.

Everything that makes the stuff faster is appreciated
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-14-2020, 11:37 AM   #382
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,189
Default

this how I put the dependency in my scripts


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

if not (ultraschall and ultraschall.CopyMediaItemToDestinationTrack and ultraschall.AddItemSpectralEdit) then
  reaper.ShowConsoleMsg("Please Install Ultraschall API via Reapack\nhttps://raw.githubusercontent.com/Ultraschall/ultraschall-lua-api-for-reaper/master/ultraschall_api_index.xml")
  return false
end

Advantages :
  • Users have full detailed about the missing stuffs and how to install them
  • it is in console so they can copy the link easily
  • it does check for the necessary functions used in the script
I'll have to compare with lokasenna method though for the "local" improvements.

---
Not all ultraschall scripts are shared publicly, especially because it allows complex functions so it is used for very specific workflow which are not always shared, but for those which are just CTRL+SHIFT+F in a code editor (usually, search in content of all files) in the REAPER / Scripts folder and search for ultraschall. You will have all scripts with used it :P


But I have to admit that I have more ultraschall scripts in my private repo and test files than shared publicly !


Anyway, your API is useful ! I'm not the only one who have commented this thread so far :P There is various things for which having to code solutions from scratch would have been very tedious (like spectrogram edit).


EDIT: GetProject_Extensions also very useful.
X-Raym 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 02:41 AM.


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