Old 12-17-2018, 01:47 AM   #81
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 423
Default

Thank you for putting all the time behind this project
to be honest i am just a script leech .. can't even script hello world without seeing a tutorial , but thanks to good people like you we get to see new powers added to reaper !

regards
zook
zookthespook is offline   Reply With Quote
Old 12-17-2018, 06:44 AM   #82
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Hotfixes I - fixes issues with GetMarker/GetRegion-functions:

https://api.mespotine.de/ultraschall_hotfixes.lua

Just replace the ultraschall_hotfixes.lua with that new file.

The full downloadpackage of the API itself includes this hotfix as well.
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 12-17-2018 at 06:58 AM.
mespotine is offline   Reply With Quote
Old 12-17-2018, 06:49 AM   #83
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Let's get started with fulfilling a first Feature Request:

Quote:
Originally Posted by reapero View Post
Mmmm...would it be possible then use Get the current Marker/Region at mouse-position + the render feature to do something like:

a) activate script
b) roll over the regions you want to render with the mouse
c) then render these regions without having to go thru the region matrix, etc
Try this script.
When you run it, Ctrl+LeftClick(or CMD+LeftClick on Mac) on the Region you want to render. A dialog will pop up, asking you, where to render it and it's filename. Enter that and hit OK.
It will remember that typed filename, when you click on the next region to render.


https://mespotin.uber.space/Mespotin...nt_Project.lua

Don't know, if this works good on Mac and Linux, haven't tested that yet.
Needs JS-Extension-plugin 0.951 and SWS installed.
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-19-2018, 07:59 AM   #84
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 249
Default COM Objects?

Hey Meo,
In all of your coding experience with Reaper, have you had any occasion/need/desire to mess around with COM objects such as MS Access, Word, Excel, Power Point, and Outlook?

The simplest example that I can think of for a FR on this would be to email a render directly from Reaper using an Outlook COM Object.

Another possible use could be OneDrive for collaborative projects.

Just curious what you thought of that.

Thanks for all of your contributions to Reaper!
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 12-19-2018, 08:10 AM   #85
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

No, haven't thought about that and no idea how to do that.
Can't this be done in some way using a shell/commandline?
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-19-2018, 08:37 AM   #86
chip mcdonald
Human being with feelings
 
chip mcdonald's Avatar
 
Join Date: May 2006
Location: NA - North Augusta South Carolina
Posts: 3,516
Default

Would the render capability allow a script or batch file to render all .rpp reaper projects in a directory?
__________________
]]]>-guitar lessons - www.chipmcdonald.com-<[[[
Experiencing Guitar: Essays from Teaching by Chip McDonald https://www.amazon.com/dp/1521877823..._QZJxAbA4GVDC1
chip mcdonald is offline   Reply With Quote
Old 12-19-2018, 09:33 AM   #87
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 249
Default

Quote:
Originally Posted by mespotine View Post
No, haven't thought about that and no idea how to do that.
Can't this be done in some way using a shell/commandline?
That's how I'm currently adopting things... using AHK to communicate with Excel and Outlook.


Skip the 'long version' of my answer.

Long Version
My recordings are of our church services, from before the first piano note and all the way to the last, to include song specials (choir and solos) to sermons to special announcements, etc. My Lua script is designed to extract portions of that recording and render them to individual MP3's (using templates which contain FX chains and such). Currently (and due to my own limited knowledge) this is only for the sermons, but I hope to include the song specials and such later on... which may happen sooner than expected now that your API has been released.

I store all of my marker data in a spreadsheet for each recording and use that to email various entities (depending on what's being marked, which is indicated by the text of the markers (songs vs sermons vs speeches vs blah). This spreadsheet is also used by others in my church for their own purposes (new membership, baptisms, legalities (hey, it happens from time to time), etc.).

There are timing issues with using the shell / commandline that can cause all kinds of headaches if one little thing goes wrong... this is why it's taken me 18 months to get to where I am today. Just this month I've finally been able to build a script that successfully does the above with the sermons. However, and quite sadly, this script still involves using 5 other AHK scripts to automate things. Things like GetSceneNumber(OSC), Render, Save File, Compose Email, and Watchdog (to close things that are left open by some reason or another). Render and Save File looks to be something that can now be done within Reaper thanks especially to you and your API... I haven't had a chance to dig into it yet.


Short Answer
Golly! It sure would be keen / neato if Lua in Reaper supported DLL and COM objects! (insert mega cheesy grin here)
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 12-19-2018, 09:42 AM   #88
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 23,154
Default

Quote:
Originally Posted by tXShooter View Post
There are timing issues with using the shell / commandline that can cause all kinds of headaches if one little thing goes wrong... this is why it's taken me 18 months to get to where I am today.
I have no idea what languages you know but in C#/.NET you could create a FileSystemWatcher that monitors some directory for changes and when a create file event occurs (the render), pull the file that caused the change then email it using .NET's System.Net.Mail component. This would avoid Outlook/COM altogether. Or you could use Outlook's .NET Office Library to interop and send it via Outlook but it's much easier to avoid having to use such a heavy mail client for this IMHO. You would have to know when the render is complete before acting though - doable just mentioning for awareness.

Or you could just take the folder watching out of the equation and write a similar app that whenever you execute it, it emails everything in folder X. That's how I would most likely do it.

Quote:
Short Answer
Golly! It sure would be keen / neato if Lua in Reaper supported DLL and COM objects! (insert mega cheesy grin here)
It's probably available in C++ as an extension assuming you can Import the needed libraries but I still think tying all this directly into Reaper is potentially less desirable long-term, or maybe not. It may be even remotely available in Lua - or at least starting an external app via Lua when the render completes.

Last edited by karbomusic; 12-19-2018 at 09:48 AM.
karbomusic is online now   Reply With Quote
Old 12-19-2018, 10:45 AM   #89
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Quote:
Originally Posted by chip mcdonald View Post
Would the render capability allow a script or batch file to render all .rpp reaper projects in a directory?
Yes, you just need to pass the filename+path of the rpp-file to the render-function.

There's a function, that gets all files in a path into an array:

https://mespotin.uber.space/Mespotin...lesnamesInPath

Iterate over the array and pass the filenames+path to
https://mespotin.uber.space/Mespotin...ject_RenderCFG

Don't forget to create a renderstring first:
https://mespotin.uber.space/Mespotin..._Renderstrings


You should reading the Introduction-chapters about Rendering as well: https://mespotin.uber.space/Mespotin...1_Introduction

They'll explain you a lot about, how to do rendering of files.
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-19-2018, 10:52 AM   #90
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Quote:
Originally Posted by karbomusic View Post
It's probably available in C++ as an extension assuming you can Import the needed libraries but I still think tying all this directly into Reaper is potentially less desirable long-term, or maybe not. It may be even remotely available in Lua - or at least starting an external app via Lua when the render completes.
I'm currently coding Lua only, so I'm not capable at all to write such a thing. I also try to make the API as system-independent as possible, so there's no "you can do this, but only on Windows"-stuff in there.
So, I'll probably not looking into it, unless there's an easy possibility for Linux and Mac as well.

It would be cool, however, if Reaper's Lua would support modules, like dll-modules and such. But unfortunately, it doesn't :/
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-19-2018, 11:35 AM   #91
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 249
Default

Quote:
Originally Posted by karbomusic View Post
I have no idea what languages you know but in C#/.NET you could create a FileSystemWatcher that monitors some directory for changes and when a create file event occurs (the render), pull the file that caused the change then email it using .NET's System.Net.Mail component. This would avoid Outlook/COM altogether. Or you could use Outlook's .NET Office Library to interop and send it via Outlook but it's much easier to avoid having to use such a heavy mail client for this IMHO. You would have to know when the render is complete before acting though - doable just mentioning for awareness.

Or you could just take the folder watching out of the equation and write a similar app that whenever you execute it, it emails everything in folder X. That's how I would most likely do it.
That's why I said,
Quote:
However, and quite sadly, this script still involves using 5 other AHK scripts to automate things. Things like GetSceneNumber(OSC), Render, Save File, Compose Email, and Watchdog (to close things that are left open by some reason or another).
(I forgot about a script... a Database Parser that parses all of the Reaper markers into Excel immediately after the recording stops.)

The roughest parts have been outside of the COM Object, and that's mostly due to a lack of good/proper documentation, support, and example.
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 12-27-2018, 08:06 AM   #92
lachinhan
Human being with feelings
 
lachinhan's Avatar
 
Join Date: Nov 2014
Location: Can Tho - Viet Nam
Posts: 77
Default

I like this features of Ultraschall https://youtu.be/14jFONiA83g
__________________
NK Recording Studio
Email: lachinhan@gmail.com or admin@thuamninhkieu.com
Website:nkpro.top
lachinhan is offline   Reply With Quote
Old 12-27-2018, 09:47 AM   #93
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Quote:
Originally Posted by lachinhan View Post
I like this features of Ultraschall https://youtu.be/14jFONiA83g
Yes, and we're already working on the next iteration of it
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 12-29-2018, 09:07 AM   #94
chip mcdonald
Human being with feelings
 
chip mcdonald's Avatar
 
Join Date: May 2006
Location: NA - North Augusta South Carolina
Posts: 3,516
Default

Quote:
Originally Posted by mespotine View Post
Yes, you just need to pass the filename+path of the rpp-file to the render-function.

There's a function, that gets all files in a path into an array:
Ok, thanks! Too much to undertake at the moment but good to know.
__________________
]]]>-guitar lessons - www.chipmcdonald.com-<[[[
Experiencing Guitar: Essays from Teaching by Chip McDonald https://www.amazon.com/dp/1521877823..._QZJxAbA4GVDC1
chip mcdonald is offline   Reply With Quote
Old 12-29-2018, 11:40 AM   #95
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

If anyone is at the 35th Chaos Communication Congress in Leipzig/Germany, I'm there at the "Sendezentrum" in the CCL.
So if you have questions regarding the API and are there, gimme a wink here or at https://twitter.com/mespotineshows
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-03-2019, 03:37 PM   #96
Travesty
Human being with feelings
 
Join Date: Nov 2014
Posts: 378
Default

This is amazing
Travesty is online now   Reply With Quote
Old 01-05-2019, 02:30 PM   #97
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Thanks


@all

anyone already trying to do something with this API? If yes, what are you currently trying to do?

I'm curious


@mods
Could you make this sticky? This will be developed much more further in the future...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-06-2019, 01:20 PM   #98
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 265
Default

Since I am seeing you are very interested in color transformation, I thought I would see if you would want to look into supporting HCL.

A very nice introduction here:

https://howlettstudios.com/articles/...oblem-with-hsv

It's something I'd love to implement in my guis. I typically have lightness controlled by the program, depending on whether it's background under black text, or colored text on a black background, etc, and have user controls for saturation and hue. But this results in drastic difference in lightness, which can make reading the text very problematic. HCL solves this problem. And if you set up a horizontal line in the color picker at this link, you can see how delightfully you get a spectrum of colors of identical brightness.

Just a thought!

EDIT: Some good links to existing code here:
https://www.vis4.net/blog/2011/12/av...nt-hsv-colors/
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<

Last edited by woodslanding; 01-06-2019 at 01:28 PM.
woodslanding is offline   Reply With Quote
Old 01-06-2019, 01:43 PM   #99
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 265
Default

Looking at this:

https://gka.github.io/chroma.js/

There is support for HCL, so the code is in there somewhere.

I like how you can take an existing color and set it to a particular luminance.... I am going to have a look at the code that does that, that seems like a good way of allowing the user to select any color, and still have it show up properly against various colors of background or text
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 01-07-2019, 05:18 AM   #100
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

Quote:
Originally Posted by mespotine View Post
Thanks


@all

anyone already trying to do something with this API? If yes, what are you currently trying to do?

I'm curious
Nothing fancy: exporting audio based on the project name, adding the start timecode and choose FLAC as format.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-07-2019, 10:30 AM   #101
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

@mespotine

I'm just digging thru the Render functions.

1. Do we always need to make a copy of a project to set the render options,
or can we use the current one that is opened?

2. I want to generate the filename based on wildcards. Do I need to use both functions sequentially in that case?

SetProject_RenderFilename and put "" to use a render pattern instead
and SetProject_RenderPattern to generate the pattern
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-07-2019, 02:05 PM   #102
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

Okay, next confusion(s).

Although, I'm referring to the current project (which is already open), Reaper ones the project again to render it.

And the second thing: how can I write the RenderPattern to the actual file?
When I execute RenderProject_RenderCFG, I have to set render_filename, without the possibility to refer to the RenderPattern.

What I got is:

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
retval, projectfilename_with_path = reaper.EnumProjects(-1,"")

render_cfg_string = ultraschall.CreateRenderCFG_WAVPACK(3, 0, 0, true, false)

retval = ultraschall.SetProject_RenderPattern(nil, "$project $starttimecode")

retval, _, _, _ = ultraschall.RenderProject_RenderCFG(nil, "m:/Projekte/Export/", -1, -1, false, false, false, render_cfg_string)
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-07-2019, 02:20 PM   #103
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

@stevie

The reopening of a currently opened project to render it is a limitation I can't surpass. This is the only way of making the current-project-rendering possible.

Good observation with the render-pattern-problem. I will look into it and probably add a function, that renders a project by using a Renderpattern instead of a export-filename.
But need to dig deeper into RenderPattern, as I don't use them at all.

Otherwise, the only option is to set the Render-Pattern, load the altered project and use the action for render using the last render-settings.


I'll put also on my ToDo-List to create a temporary render-project, which can be altered using the render-setting-functions and rendered afterwards.


@woodslanding

I'll look into it. THanks for the links
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-07-2019, 06:14 PM   #104
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

Quote:
Originally Posted by mespotine View Post
@stevie

The reopening of a currently opened project to render it is a limitation I can't surpass. This is the only way of making the current-project-rendering possible.
I see, bummer. With a huge project, re-loading might take longer, than setting up the render dialog.

Quote:
Good observation with the render-pattern-problem. I will look into it and probably add a function, that renders a project by using a Renderpattern instead of a export-filename.
But need to dig deeper into RenderPattern, as I don't use them at all.

Otherwise, the only option is to set the Render-Pattern, load the altered project and use the action for render using the last render-settings.
Interessting, so the editings will be saved as "last render" settings.

Quote:
I'll put also on my ToDo-List to create a temporary render-project, which can be altered using the render-setting-functions and rendered afterwards.
Great, thanks!
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-08-2019, 03:04 AM   #105
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 103
Default

Yeah, same for me. Tried to use the render stuff but opening the project again just kills the computer.

Terrrific work Mespotine, thanks!!
reapero is offline   Reply With Quote
Old 01-08-2019, 09:10 AM   #106
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

New Hotfix for the Ultraschall-API.

Download it at https://api.mespotine.de/ultraschall_hotfixes.lua and replace the file ultraschall_hotfixes.lua with that one.


@stevie
The aforementioned hotfix includes some stuff interesting for you.

RenderProject_RenderCFG-function:
you can set renderfilename_with_path now to nil, which means, that it will use the rendername/renderpattern already set in the file


string tempfile = ultraschall.CreateTemporaryFileOfProjectfile(strin g projectfilename_with_path)
this creates a temporary-file of a rpp-projectfile. (Yet undocumented, but will be part of the next official beta of the Ultraschall-API.)


With that, you can do RenderPatterns, like in the following demoscript:
Code:
-- Ultraschall-API-demoscript - Meo Mespotine - 8th of January 2019
--
-- render the currently opened project, using renderpattern.
-- needs the currently opened project to be saved first!
--
-- needs at least Ultraschall-API 4.00 beta 2.7 including hotfixes from 8th of January 2019
-- get them all from ultraschall.fm/api 
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

-- First, we create a FLAC-render-cfg-string
render_cfg_string = ultraschall.CreateRenderCFG_FLAC(0, 5)

-- Lets create a tempfile of the project. If no parameter is given, it will use the projectfile of the currently opened project.
-- If that isn't possible(project not being saved for instance), end the script
tempfile = ultraschall.CreateTemporaryFileOfProjectfile()
if tempfile==nil then return end


-- Now do the manipulation with the tempfile (!!!)
-- for example, the render-pattern:
retval = ultraschall.SetProject_RenderPattern(tempfile, "$year-$monthname-$day this is my file")


-- now we render the stuff. Note: the renderfilename_with_path is set to nil here, but the projectfile is set to tempfile!
retval, renderfilecount, MediaItemStateChunkArray, Filearray = ultraschall.RenderProject_RenderCFG(tempfile, nil, -1, -1, false, true, true, render_cfg_string)


-- after all is done, we need to delete the tempfile again
os.remove(tempfile)

ultraschall.ShowLastErrorMessage()
I don't know, whether you need to set the rendername to "" when setting a renderpattern and I don't know, how to give a path. Maybe you can help me with that.


@reapero and stevie
With my FR fulfilled for Get/SetProjectStateChunk, I could get rid of the otherwise useless reloading of a project.
Maybe you could vote for it? (Hint Hint, Nudge Nudge)

https://forum.cockos.com/showthread.php?p=2059252

I hope, there's no technical limitation forbidding the Reaper-devs giving us the ProjectStateChunk of an opened project...


@myself
I should finally find a way delivering the API with ReaPack. Gonna look into it next week, hopefully...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-09-2019, 02:22 AM   #107
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 574
Default

Hi Mespotine

Thanks for all these functions, which I'll investigate as time goes on.

One question please - is calling one of your functions (eg "Select all items to the left") likely to be faster or slower than writing my own loop within a script to do that? Or does it just depend whether your code is more efficient than mine in the way it works?

In other words, is the advantage of your library of functions simply that it saves me having to write them, or will they potentially run faster too?

Thanks
Andy

Last edited by andyp24; 01-09-2019 at 08:51 AM.
andyp24 is offline   Reply With Quote
Old 01-09-2019, 11:33 AM   #108
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Quote:
Originally Posted by andyp24 View Post
Hi Mespotine

Thanks for all these functions, which I'll investigate as time goes on.

One question please - is calling one of your functions (eg "Select all items to the left") likely to be faster or slower than writing my own loop within a script to do that? Or does it just depend whether your code is more efficient than mine in the way it works?

In other words, is the advantage of your library of functions simply that it saves me having to write them, or will they potentially run faster too?

Thanks
Andy
Depends. My implementations are mostly to save me from having to code stuff time and again, though some of my code is probably slower than it could.
In a future version, I'll add the option for you to suggest a better implementation. So if performance is a thing for you and you'll find that your code is faster than mine, drop me a note in how you did that and I'll try to improve speed.


@stevie and reapero
I might have an idea of speeding up the rendering by getting rid of the loading of a project by maybe exploiting the render-queue.
No promises, but my yesterday's tests looked quite promising.

Thanks for your feedback, by the way, as it inspired me to this new idea
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-09-2019, 02:41 PM   #109
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 574
Default

Great, thanks for the explanation.
Andy
andyp24 is offline   Reply With Quote
Old 01-09-2019, 04:08 PM   #110
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

Quote:
Originally Posted by mespotine View Post

@stevie and reapero
I might have an idea of speeding up the rendering by getting rid of the loading of a project by maybe exploiting the render-queue.
No promises, but my yesterday's tests looked quite promising.

Thanks for your feedback, by the way, as it inspired me to this new idea
That sounds great! Awesome idea, looking forward to it
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-11-2019, 08:36 AM   #111
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Is anyone interested in a "Ultraschall-API-feature of the week" post, in which I show and explain certain cool features I provided?

Just to help you getting what you can do with it actually, without being overwhelmed by the amount of functions...

What do you think?
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 01-11-2019, 10:55 AM   #112
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 103
Default

That ´d be nice. I´d follow it at least.
reapero is offline   Reply With Quote
Old 01-11-2019, 07:45 PM   #113
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,437
Default

Sure man, if you find the time to do so, it would be highly appreciated!
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old 01-12-2019, 05:08 AM   #114
cyrano
Human being with feelings
 
cyrano's Avatar
 
Join Date: Jun 2011
Location: Belgium
Posts: 3,428
Default

Quote:
Originally Posted by mespotine View Post
Is anyone interested in a "Ultraschall-API-feature of the week" post, in which I show and explain certain cool features I provided?

Just to help you getting what you can do with it actually, without being overwhelmed by the amount of functions...

What do you think?
That would be great! Especially for dumbo's like me...
__________________
“It has become appallingly obvious that our technology has exceeded our humanity” Albert Einstein
cyrano is offline   Reply With Quote
Old 01-13-2019, 05:35 PM   #115
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 679
Default

Ultraschall Api
Feature of the Week
#1

Before we start with cool features, I would love to introduce you to a very helpful feature in day-to-day-programming, which usually means: fixing bugs.
One of the main problems of fixing bugs are cryptic error-messages or even worse: error-codes.
I hate that and if you're programming a lot, you probably hate it too.
So I added an error-messaging system. You can do a lot with it, but I want to focus on one aspect that's most useful for you.

All API-functions create useful error-messages, when a problem arises. Yes, all of them!

So let me introduce to you:

ShowLastErrorMessage
This function is simple. If an error happened in one of the Ultraschall-API-functions, calling this function will open a messagebox showing you the problematic function, the problematic parametername(if applicable) and the error-message. It will be the last error that occurred, before calling ShowLastErrorMessage.

So let's assume, you want to read a file using ReadFullFile, but for some reasons, you don't give the function a filename, but rather something else, like the number "1"

Code:
-- let's add the Ultraschall-API to our script
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

-- let's pass a wrong parameter to this function
ultraschall.ReadFullFile(1)

-- see, whether we produced an error
ultraschall.ShowLastErrorMessage()
When we run this script, ShowLastErrorMessage will show us, that the first parameter filename_with_path must be a string, which tells us: it can't be a number.
PS: if you pass to ReadFullFile a filename of a file that doesn't exist, it will raise the error that the file does not exist, that you passed in parameter filename_with_path, when running ShowLastErrorMessage.

So everytime you pass a wrong value into a parameter or something else goes wrong, it will show you, what went wrong.

Include this function into your prayers, as it will quickly help you finding obvious bugs in your scripts.
I added this as programming-sugar for all of you, but quickly understood, how helpful it is for me as well.

I often put this at the end of my script, so it will show me the last error that happened in my script, if at all. If you have weird behaving functions, you should include ShowLastErrorMessage after the weird behaving functions to see, if it created an error.

This is especially useful for those of you, who use an external editor, but if you use Reaper's own ReaScript-IDE, it is helpful as well.



If you are programming in the ReaScript-IDE and want to have the error-messages shown at the bottom, just as any other error-message by Reaper or Lua, you can use another nice function:

ToggleIDE_Errormessages
This toggles, whether error-messages shall be shown like any other ReaScript/Reaper-API-function/Lua-error at the bottom of the IDE or in an error-window opened, while the IDE is closed.


Whatever you prefer, getting useful debug-information by Ultraschall-API-functions isn't hard.


PS: I mostly use ShowLastErrorMessage and I love it

PSPS: It works only for Ultraschall-API-functions. Reaper's own functions don't create such error-messages, though I already think about, how to do that as well. Maybe some day...
__________________
Ultraschall-API: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs for Reaper: https://forum.cockos.com/showthread.php?t=207635
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:10 AM.


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