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

Reply
 
Thread Tools Display Modes
Old 10-02-2019, 06:51 AM   #321
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Just for info, hat is the basic concept under the hood ? Does it defer the script somehow ? It is made in pure Lua right ?
X-Raym is offline   Reply With Quote
Old 10-02-2019, 06:56 AM   #322
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

All pure Lua.

There's a defer-script called ultraschall_eventmanager.lua, which gets started(or it should, but it seems like, it doesn't get started in your case for some reason).

The functions communicate back and forth with it using magic extstate-management.


This features also technology intended for my collaboration with lokasenna.

Edit: You could run the EventManager by hand, by adding the ultraschall_eventmanager.lua-script as action, run it and see, whether my script-snippet works after that.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-02-2019, 07:21 AM   #323
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

I confirm the issue is that https://raw.githubusercontent.com/Ul...entManager.lua isn't downloaded.


I manually added it and it works now.


Now I'll be able to experiment when I'll face event style scripting needs. :P
X-Raym is offline   Reply With Quote
Old 10-02-2019, 07:34 AM   #324
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Great

Will fix that on friday in Hotfix 1.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-04-2019, 07:23 AM   #325
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

@XRaym

Forgot to ask, which OS and ReaPack-version do you use?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-04-2019, 02:58 PM   #326
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Win 10, last reapack version.
X-Raym is offline   Reply With Quote
Old 10-05-2019, 02:13 PM   #327
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

@XRaym
Ok, I only could find a potential bug on Linux due UpperLowercase-filname problems but I can't reproduce the bug you have...

Especially, as ReaPack would need to show an error, when downloading the EventManager.lua didn't work(it is definately in the reapack-index file).

And all my tests successfully load the full package.

So, I have no idea what the problem is. Maybe some filesystem-versioning stuff on Win10?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-05-2019, 02:30 PM   #328
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

New Hotfix 1 from October, 5th, 2019

Build: 40677.01

Changes
- Docs: Reaper Internals - updated to JS-extension 0.993 and some additional bits about gfx.mouse_cap and get_action_context(); was missing gfx -> fixed
- EventManager: ultraschall_EventManager.lua - couldn't be installed/loaded under some circumstances due Upper/LowerCase-issues in filename -> fixed

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

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-13-2019, 09:31 AM   #329
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Thanks mespotine you added all the great parameter learn functionality, with set and get. I still did not try them yet. But the most obvious and general use case scenario of this would be as follows, especially also useful to non-programmers:

1. only simple .txt files are used for parameter mappings
2. for saving and loading, simple .txt files
3. format could be 5 columns per line
4. using tab or ; as delimiter might work, or any of them
5. columns are: trackname;fxname;parametername;type;value

And the lua script would scan this .txt file, line by line and do following:
if (project contains any track with trackname AND any fx in that track with fxname AND any parameter in that fx with parametername)
use type for midi mapping
and value for its value

That's it. Then you could define any mappings for any scenarios for any complex project. Those .rpp templates could be shared together with those mapping .txt files.

Especially when thinking in terms of certain starndard mappings for certain devices, we could have many such templates for certain devices. Over time there could be many useful fun projects to play with, 100's of templates for device x, e.g. reason mode. Has your device reason mode, switch it on, load template, ready to go, all would work, immediately. In short it would allow making normal reaper .rpp projects, something like grooveboxes, all parameters mapped immediately to your hardware. Ready to have fun.

You plug in your project to your hardware(s) and not the opposite.

save_midi_mappings.lua would save midi_mappings.txt to project directory, which would simply contain all tracknames, all fxnames per track and all parameternames per fx, where no mapping is columns type and value would be empty. Optionally those empty mapping entry lines could be left out.

load_midi_mappings.lua would load midi_mappings.txt from project directory, if available. Wonderful way of sharing them in this forum, together with their .rpp templates.

And if load_midi_mappings.lua would be a bit more intelligent, it could even add the missing fx to the project first, then apply the midi mapping!

Typical mapping targets could be: Bypass, Wet, Cutoff, Resonance, Volume, Pan.

Last edited by TonE; 10-13-2019 at 10:07 AM.
TonE is offline   Reply With Quote
Old 10-21-2019, 09:27 AM   #330
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Quote:
Originally Posted by TonE View Post
Thanks mespotine you added all the great parameter learn functionality, with set and get. I still did not try them yet. But the most obvious and general use case scenario of this would be as follows, especially also useful to non-programmers:

1. only simple .txt files are used for parameter mappings
2. for saving and loading, simple .txt files
3. format could be 5 columns per line
4. using tab or ; as delimiter might work, or any of them
5. columns are: trackname;fxname;parametername;type;value

And the lua script would scan this .txt file, line by line and do following:
if (project contains any track with trackname AND any fx in that track with fxname AND any parameter in that fx with parametername)
use type for midi mapping
and value for its value

That's it. Then you could define any mappings for any scenarios for any complex project. Those .rpp templates could be shared together with those mapping .txt files.

Especially when thinking in terms of certain starndard mappings for certain devices, we could have many such templates for certain devices. Over time there could be many useful fun projects to play with, 100's of templates for device x, e.g. reason mode. Has your device reason mode, switch it on, load template, ready to go, all would work, immediately. In short it would allow making normal reaper .rpp projects, something like grooveboxes, all parameters mapped immediately to your hardware. Ready to have fun.

You plug in your project to your hardware(s) and not the opposite.

save_midi_mappings.lua would save midi_mappings.txt to project directory, which would simply contain all tracknames, all fxnames per track and all parameternames per fx, where no mapping is columns type and value would be empty. Optionally those empty mapping entry lines could be left out.

load_midi_mappings.lua would load midi_mappings.txt from project directory, if available. Wonderful way of sharing them in this forum, together with their .rpp templates.

And if load_midi_mappings.lua would be a bit more intelligent, it could even add the missing fx to the project first, then apply the midi mapping!

Typical mapping targets could be: Bypass, Wet, Cutoff, Resonance, Volume, Pan.
Will think about that but first, I will finish off the functions, so that is fully programmable.

The most important thing to take care of would be, future compatibility. Means, if the devs add new features, the txt-file must be extendable without breaking anything. This is where things become difficult and tedious in the design-process.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-21-2019, 12:45 PM   #331
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

No problem, I started already playing around with it, modifying some available csv import/export scripts, so far only track names are saved, when finished I will share it of course. All these you would finish probably in 2 minutes, but that is not the point anyway, if there would be more tutorials for basic lua tasks, all would be much easier, most time is spent finding out first, which functions to use in which order correctly, plus how to set their parameters correctly, some start counting with 1, some with 0. Somehow this is the bad part of the whole lua story.

Even when trying to understand the available lua functions, there are too many, I can not find the right place in the documentation, so I am mainly just rgrep'ing in the entire reaper scripts + userplugins directory, looking at available 3000 .lua scripts as examples, then trying to figure out things. Examples which I do not like, I ignore, mpl scripts are typically unnecessarily complicated in their design, just to give one example. The main idea of a script should be understandable at first look, not looking like a cryptical task, splitting the main task into sub functions.

If you have any recommendations who's scripts are most elegant in design, that would be useful as well. One perfect design for csv file export and import would be cool, also. Best example I found is "Import Chordino chords to regions", but even this script contains elements not used in the script, like this line
PHP Code:
  folder filetxt:match[[^@?(.*[\/])[^\/]-$]] 
TonE is offline   Reply With Quote
Old 10-21-2019, 12:56 PM   #332
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by TonE View Post
plus how to set their parameters correctly, some start counting with 1, some with 0. Somehow this is the bad part of the whole lua story.
Any functions provided by Lua use 1-based indexes. The Reaper API (reaper.___, gfx.___) uses 0-based indexes because the API comes from C++ and has to work EEL and Python, all of which use 0.

Quote:
The main idea of a script should be understandable at first look, not looking like a cryptical task, splitting the main task into sub functions.
Splitting tasks into smaller functions is critical for making code easy to write, debug, and maintain. There are entire books devoted to this idea.

The original version of my GUI library was all in one file with functions that were hundreds of lines long, and it was a nightmare to work with. The version I'm working on now is split into a few dozen files, I think there might only be one function over a hundred lines, most are a dozen or less, and I'm able to make changes much more quickly while knowing exactly what other parts of the code have been affected.

That said, naming functions clearly is also a valuable skill and is unfortunately overlooked quite often.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 10-21-2019, 02:17 PM   #333
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Quote:
Originally Posted by Lokasenna View Post
The original version of my GUI library was all in one file with functions that were hundreds of lines long, and it was a nightmare to work with. The version I'm working on now is split into a few dozen files, I think there might only be one function over a hundred lines, most are a dozen or less, and I'm able to make changes much more quickly while knowing exactly what other parts of the code have been affected.
Especially lua not offering { } blocks, usually, so even the best editor like emacs is not of big help for quickly jumping between blocks.

Java has each class in a sepeparate .java file, along your description above, making things simpler, all stuff together in one place, the attributes and the functions which can deal with them. Plus there is inheritance, in lua are objects available?
TonE is offline   Reply With Quote
Old 10-21-2019, 02:34 PM   #334
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by TonE View Post
Especially lua not offering { } blocks, usually, so even the best editor like emacs is not of big help for quickly jumping between blocks.
Lua has blocks just like every other language - function ... end or do ... end rather than curly braces. If your editor has difficulty with them, that's the editor's problem - I've never had any trouble in that department using Notepad++ or VS Code.

That said, because Lua is so flexible it is much more difficult to write a language server that can parse everything correctly. I only came across a server for VS Code the other day that can pick up class methods and the like.

Quote:
Plus there is inheritance, in lua are objects available?
Lua uses prototypal inheritance (like Javascript) rather than classical inheritance (Java or C++). Most ReaScripts don't make use of it, though, because most of what we're doing wouldn't benefit from being stuffed into a class structure.

Larger scripts like my GUI library use OOP all over the place because it does make sense there; I also found it helpful in Lokasenna_Smart fill gaps by stretching item tails because the work involved is a) repetitive and b) requires exposing a lot of values from one step of the process to the next.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 10-21-2019, 04:53 PM   #335
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

What you mean with problems and editor? It is emacs.
If code has curly braces, you can use ctrl-alt-u, to go one level up in block hierarchy, if you hit ctrl-alt-d, you go one level down in block hierarchy, using ctrl-alt-n/p you can jump between blocks in same level. Not having those curly braces, removes this cool and quick jumping and diving in/out around codes. This is what I meant. So begin and end do not work, here on my emacs at least, with my settings.

Last edited by TonE; 10-21-2019 at 04:59 PM.
TonE is offline   Reply With Quote
Old 10-21-2019, 07:59 PM   #336
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by TonE View Post
This is what I meant. So begin and end do not work, here on my emacs at least, with my settings.
Curly braces are how some languages denote a block of code, but not all. If Emacs is specifically looking for curly braces rather than what the current language uses, that's not Lua's fault - that's Emacs missing some fairly basic functionality.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 10-22-2019, 04:43 AM   #337
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

But only for the above mentioned advanced navigation, can your editor do such navigation at all? Also with .lua codes? Diving in and out of block hierarchies?
TonE is offline   Reply With Quote
Old 10-22-2019, 06:48 AM   #338
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by TonE View Post
But only for the above mentioned advanced navigation, can your editor do such navigation at all? Also with .lua codes? Diving in and out of block hierarchies?
The behavior isn't perfect, but this extension appears to do it.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 10-23-2019, 07:41 AM   #339
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Quote:
Originally Posted by TonE View Post
The main idea of a script should be understandable at first look, not looking like a cryptical task, splitting the main task into sub functions.
I disagree: the main idea of a script is to provide the functionality in the first place.
Subfunctions can be very helpful with that, as you can split the work into individual tasks.
You can, however, try to make that stuff as easy to read as possible, by naming functions clearly, so you can see right away, what a certain function does.
So a main-function just calls the functions needed and their names tell you, what they are supposed to do.

But: what that "easy to read" means, is an individual thing. I try to name all my US-API-functions as clearly as possible, so reading the code is also like reading its description. But I have no idea, whether I succeeded in it at all, as others may have another idea of readability and find my naming-scheme confusing.

It's complicated and you can just try to make it as good as possible.

Another thing is, that maybe we need a better collection of tutorial-scripts, who are written to be understandeable in the first place, including extensive-descriptive-comments. But this isn't as easy as it may sound, as you need to find easy words for complicated tasks and this takes time to do correctly.
MPL's scripts are probably not written as example-scripts but more written as efficient as possible, so he can get the stuff working and as maintainable as possible for him.

It's complicated.

BTW: If you get your CSV-stuff working, I would be happy to include it into the Ultraschall-API officially. Sounds like a really helpful feature in the first place.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-23-2019, 02:47 PM   #340
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

mespotine, I wrote in general, not meaning at all your scripts, only mpl scipts were one counter example, from my understanding. I guess you read/understood the same sentence in a different form.

Of course you can include it, but I am not far yet and it can take some time.
TonE is offline   Reply With Quote
Old 10-26-2019, 05:49 AM   #341
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Yes I know. Maybe my writing sounded a little bit too harsh, sorry for that.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-04-2019, 11:11 AM   #342
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Ultraschall Framework - Changelog[/big]

4.00 Beta 2.78: - "Tchaikovski - Overture 1812" - 5th of November 2019

Has now 1070 functions, with 41 new ones

New in this release:
  • Event Manager
    Additional functions and features to improve handling, development, monitoring and debugging of events.
    Fixed some bugs, that need startup-events to be readded again. Sorry for that.
  • SLEM
    like ultraschall.ShowLastErrorMessage() but faster to type. I should have added this much more earlier.
  • MIDI-notes
    Now you can send easily Midi: notes, cc-messages, pc and pitchbends.
  • Defer
    One Defer-function to rule them all. You can set, how often to run the defer-cycle and give it an identifier.
    With that identifier, you can stop that specific defer-cycle from the outside!
    Way better than killing all scripts with the action "ReaScript: Close all running reaScripts".
  • PingMe
    Puts out a message including linenumber and function, in which the PingMe-function was executed.
    You can output the message in the ReaScript-console, as messagebox and into the clipboard, even retaining old clipboard-contents.
    This can be used as simpler version of hooks to monitor internal behavior.
  • StateInspector supports gmem
    You can monitor now gmem-states as well, which is handy for developers of JSFX and Video-Processor-related scripts.
New features in 4.00beta2.78
  • DeferManagement: Defer - runs a deferred loop; you can decide how often it runs; allows you to give it a unique identifier to access, watch and stop it from anywhere!
    better than Defer1 through Defer20!
    Use this one, when in doubt! (requested by rstockm)
  • Debug: PingMe - shows a message with the current scriptfilename and linenumbers of execution for debugging purposes, like hooks but "lighter"
  • Docs: Concepts - added chapters EventManager_The_Basic_Concept, EventManager_AlterRetrieve and EventManager_Debugging
  • ErrorMessagingSystem: SLEM - this works like ultraschall.ShowLastErrorMessage() but is easier to type.
  • EventManager: EventManager_DebugMode - starts/stops the debug-mode of the EventManager, which adds additional debugging features
  • EventManager: EventManager_DebugMode_UserSpace - allows getting the contents of the userspace as used by a registered eventcheck-function, for debugging purposes(DebugMode must be set to on)
  • EventManager: EventManager_GetEventIdentifier - returns the EventIdentifier of a registered event, by id
  • EventManager: EventManager_GetLastCheckfunctionState - returns the last state of the checkfunction of a certain event, by numbered id(requested by rstockm)
  • EventManager: EventManager_GetLastCheckfunctionState2 - returns the last state of the checkfunction of a certain event, by EventIdentifier(requested by rstockm)
  • EventManager: EventManager_GetLastUpdateTime - returns the last time, when any event got updated(requested by rstockm)
  • EventManager: EventManager_GetPausedState - returns, if a certain event is paused or not, by numbered id(requested by rstockm)
  • EventManager: EventManager_GetPausedState2 - returns, if a certain event is paused or not, by EventIdentifier(requested by rstockm)
  • EventManager: EventManager_GetRegisteredEventID - returns the id of a certain event by EventIdentifier, which is the position within all currently registered events
  • Examplescript: US_Api_Examples_EventManager_HowTo.lua - an example on how to add an event to the EventManager(requested by rstockm)
  • Helper Functions: ConvertFunction_FromHexString - converts and loads a function from hexstring as generated by function ConvertFunction_ToHexString
  • Helper Functions: ConvertFunction_ToHexString - converts a function into a hexstring which can be reconverted into a function by function ConvertFunction_FromHexString
  • MIDIManagement: MIDI_SendMidiCC - sends a MIDI-CC-message to a device or virtual keyboard or Reaper itself as shortcut
  • MIDIManagement: MIDI_SendMidiNote - sends a MIDI-note to a device or virtual keyboard or Reaper itself as shortcut
  • MIDIManagement: MIDI_SendMidiPC - sends a MIDI-PC-message to a device or virtual keyboard or Reaper itself as shortcut
  • MIDIManagement: MIDI_SendMidiPitch - sends a MIDI-Pitchbend-message to a device or virtual keyboard or Reaper itself as shortcut
  • Project Management: SetProject_MasterFXByp - sets the fx-bypass-state of the master-track in a projectfile or a ProjectStateChunk
  • Project Management: SetProject_MasterMuteSolo - sets the mute-solo-state of the master-track in a projectfile or a ProjectStateChunk
  • Project Management: SetProject_MasterNChans - sets the number of channels and vu-metering-settings of the mastertrack in a projectfile or a ProjectStateChunk
  • Project Management: SetProject_MasterPanMode - sets the panmode of the track
  • Project Management: SetProject_MasterTrackColor - sets the color of the track
  • TrackManagement: AnyTrackFreeItemPositioningMode - returns, if any track has free item positioning mode activated
  • TrackManagement: AnyTrackFXBypass - returns, if any track has fx-bypass activated(optionally with master-track)
  • TrackManagement: AnyTrackHiddenTCP - returns, if any track is hidden in TCP(optionally with master-track)
  • TrackManagement: AnyTrackHiddenMCP - returns, if any track is hidden in MCP(optionally with master-track)
  • TrackManagement: AnyTrackPhased - returns, if any track is phase-inverted
  • TrackManagement: AnyTrackRecarmed - returns, if any track is recarmed
  • TrackManagement: AnyTrackRecMonitored - returns, if any track is rec-monitored
  • UltraschallSoundboard: Soundboard_Play - starts playing a certain player within the Ultraschall Soundboard
  • UltraschallSoundboard: Soundboard_PlayList_Next - starts the next Soundboard-player-slot
  • UltraschallSoundboard: Soundboard_PlayList_Previous - starts the previous Soundboard-player-slot
  • UltraschallSoundboard: Soundboard_PlayList_SetIndex - sets the current Soundboard-player-slot, optionally starts playing it
  • UltraschallSoundboard: Soundboard_PlayList_CurrentIndex - returns the current Soundboard-player-slot
  • UltraschallSoundboard: Soundboard_Stop - stops playing a certain player within the Ultraschall Soundboard
  • UltraschallSoundboard: Soundboard_StopAllSounds - stops all player within the Ultraschall Soundboard
  • UltraschallSoundboard: Soundboard_TogglePlay_FadeOutStop - toggles playing and stop with fadeout of a certain player within the Ultraschall Soundboard
  • UltraschallSoundboard: Soundboard_TogglePlayStop - toggles play-stop of a certain player within the Ultraschall Soundboard
  • UltraschallSoundboard: Soundboard_TogglePlayPause - toggles play-pause of a certain player within the Ultraschall Soundboard


Changes from Beta 2.77 to Beta 2.78
  • Configuration Management: GetIniFileExternalState - was missing retval in the docs
  • DeferManagement: GetDeferRunState - gets now Defer-cycles-runstate, of deferred-functions, started by the new function Defer, as well
  • DeferManagement: StopDeferCycle - stops now Defer-cycles, started by the new function Defer, as well
  • DeveloperTools: StateInspector - supports now displaying gmem-states as well(hit g or look in the menu)
  • Docs: Reaper-Internals - updated JS-extension to 0.995
  • DocEngine: Docs_GetUSDocBloc_Description - didn't return right markup-type and version -> fixed
  • EventManager: EventManager_EnumerateStartupEvents - was missing retval paused -> fixed
  • EventManager: EventManager_EnumerateStartupEvents2 - was missing retval paused -> fixed
  • EventManager: EventManager_PauseEvent - had typo in parameter-name, so it was ignored -> fixed(thanks to rstockm)
  • EventManager: EventManager_RemoveStartupEvent2 - had wrong functionname in docs -> fixed
  • EventManager: EventManager_ResumeEvent - had typo in parameter-name, so it was ignored -> fixed(thanks to rstockm)
  • EventManager: EventManager_SetEvent - you can now pass nil for parameters, who you don't want to change
  • EventManager: EventManager_SetStartupEvent - you can now pass nil for parameters, who you don't want to change
  • EventManager: EventManager_Start - checks now, if EventManager-script exists and returns false if not; didn't unregister the EventManager-script again, after it was run -> fixed(thanks to rstockm)
  • EventManager: StartupEvent-functions - had to rewrite the function-encoding, so StartupEvents must be re-registered by you to work, sorry for that
  • EventManager: EventManager-script - returns now the current event-check-function's state and a debugmode
  • Helper Functions: Base64_Encoder - was completely broken due "improvements" -> fixed now
  • Helper Functions: GetApiVersion - put retval "number versionnumber" as first returnvalue, for easier versioncomparison(sorry for any inconvenience)
  • RenderManagement: RenderProject_RenderTable - didn't return filearray -> fixed
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-04-2019, 11:11 AM   #343
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

further changes:
  • TrackManagement: AnyTrackMute - hadn't parameter master documented -> fixed
  • Ultraschall.ini: CountUSExternalState_key - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
  • Ultraschall.ini: CountUSExternalState_sec - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
  • Ultraschall.ini: DeleteUSExternalState - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini; didn't work for the last key in the ini-file -> fixed
  • Ultraschall.ini: EnumerateUSExternalState_key - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
  • Ultraschall.ini: EnumerateUSExternalState_sec - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
  • Ultraschall.ini: GetUSExternalState - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
  • Ultraschall.ini: SetUSExternalState - allows now to set a different filename within the Ressource-folder, other than ultraschall.ini
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-25-2019, 10:00 AM   #344
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

Hi!

Trying to use ExtStates for the first time here. I think i am not getting it right though.

Code:
reaper.SetExtState( "menubox_EXAMPLE", "preset1", "a bunch of data", false )

number_of_keys, _ = ultraschall.CountValuesByPattern("menubox_EXAMPLE", reaper.get_ini_file())
Then when i print number_of_keys its = 0, while i thought it should be 1.

Didnt i just create a key value in reaper´s ini file?
reapero is offline   Reply With Quote
Old 11-25-2019, 10:02 AM   #345
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

No, as you created it in reaper-extstate.ini, not reaper.ini.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-25-2019, 10:31 AM   #346
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

Oh, so ExtStates have their own ini file. Nice, thanks.

I cant succeed with this either, though

Code:
reaper_extstate_ini_path = reaper.GetResourcePath()..[[\reaper-extstate.ini]]

reaper.SetExtState( "menubox_EXAMPLE", "preset1", "a bunch of data", false )

number_of_keys, _ = ultraschall.CountValuesByPattern("menubox_EXAMPLE",  reaper_extstate_ini_path)
number_of_keys still = 0
reapero is offline   Reply With Quote
Old 11-25-2019, 10:35 AM   #347
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Ah, I didn't look good enough into your code, the last parameter "persist" of SetExtState must be true for values stored into the extstate.ini.
That way, they are retained the next time you restart Reaper. If the last parameter is false, Reaper forgets the extstate you've just set after exiting.

There's unfortunately no way to enumerate or count extstates, that are saved with persist=false, so setting persist=true is your only option.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-25-2019, 10:38 AM   #348
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

It returns 0 with true as well :/
reapero is offline   Reply With Quote
Old 11-25-2019, 10:42 AM   #349
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

I'll check...

Edit: What do you want to achieve?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-25-2019, 10:47 AM   #350
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

I want to save presets for my script uisng Extstates. The structure would be:

section "my_plugin", key "my_preset" , value "preset_data"

I want to update a menubox object (from Lokasenna´s GUI) to list all of the presets (keys). Thats why i was trying to use your API, since it provided better acces to just the keys or sections, etc.
reapero is offline   Reply With Quote
Old 11-25-2019, 10:52 AM   #351
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

I confirm, it's a bug on my side, but have no idea, why... O_O

Give me a few days to fix it and to upload a hotfix...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-25-2019, 10:54 AM   #352
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

Allright! Thanks again
reapero is offline   Reply With Quote
Old 11-28-2019, 07:13 AM   #353
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Hotfix 1: 26th of November 2019

Changes:
- API: Reapack-API-xml-generator.lua - didn't correctly create zip-archive of the API stored in GitHub -> fixed
- API: ultraschall_api4.00_beta2.78.zip - didn't include full API -> fixed
- ConfigurationManagement: CountValuesByPattern - didn't count at all(for some reason) -> fixed(thanks to (thanks to reapero)
- Developer: ultraschall_developertool_Display-Altered-Config-Vars.lua - didn't work with rc-pre-releases of Reaper -> fixed
- Marker Management: MoveRegionsBy - still had debug-code in it, which could display messageboxes and overwrite global variables -> fixes (sorry for that)


Please update your ReaPacks


@reapero
It should work now.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-28-2019, 08:03 AM   #354
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

Thx Mespotine!

Number_of_presets = 0 here though, with the following code:

Code:
reaper.SetExtState( "menubox_EXAMPLE", "preset1", "a bunch of data", true )

reaper_extstate_ini_path = reaper.GetResourcePath().."\\reaper-extstate.ini"

number_of_presets, _ = ultraschall.CountValuesByPattern("menubox_EXAMPLE",  reaper_extstate_ini_path)
Am i missing something?
reapero is offline   Reply With Quote
Old 11-28-2019, 09:17 AM   #355
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

The function CountValuesByPattern returns the number of values, who follow a certain pattern.

Ini-files and extstates follow that scheme:

[section]
key=value

in your case
[menubox_EXAMPLE]
preset1=a bunch of data


It returns 0, as there's no value, which holds the string "menubox_EXAMPLE" in it, as value is "a bunch of data".

Look for "data" or "bunch", and it shouldn't return 0 anymore.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-29-2019, 07:58 AM   #356
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 522
Default

Ah, of course! I guess i was confused a bit by the documentation.


integer number_of_keys, string sections_and_keys
= ultraschall.CountValuesByPattern(string pattern, string ini_filename_with_path)

Shouldnt this be better named number_of_values_found or something instead? Anyway, looks like ultraschall.CountIniFileExternalState_key is what i was looking for.

Thanks for the clarification!
reapero is offline   Reply With Quote
Old 11-29-2019, 08:43 AM   #357
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Oopps, you're right, that is wrong in my docs.
Thanks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-02-2019, 08:16 AM   #358
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Hotfix 2: Arrangeview Snapshots

Changes:
  • 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

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

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-05-2019, 09:38 AM   #359
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
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.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-19-2019, 09:35 AM   #360
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
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
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:22 PM.


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