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:41 AM   #321
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,089
Default

the error is simply "Event manager not started"..


So I put ultraschall.EventManager_Start() at top of the script, before calling the error message and after.


Still get the same error :S



Is there something I'm missing about it ?



(not I'm using last pre).
X-Raym is offline   Reply With Quote
Old 10-02-2019, 06:43 AM   #322
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

Ok, that's a hint. Maybe something went wrong with the ReaPack-indexfile and something is missing.

Will investigate into that.
__________________
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 10-02-2019, 06:51 AM   #323
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,089
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   #324
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 10-02-2019, 07:21 AM   #325
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,089
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   #326
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

Great

Will fix that on friday in Hotfix 1.
__________________
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 10-04-2019, 07:23 AM   #327
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

@XRaym

Forgot to ask, which OS and ReaPack-version do you use?
__________________
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 10-04-2019, 02:58 PM   #328
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,089
Default

Win 10, last reapack version.
X-Raym is offline   Reply With Quote
Old 10-05-2019, 02:13 PM   #329
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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?
__________________
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 10-05-2019, 02:30 PM   #330
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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
__________________
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 10-13-2019, 09:31 AM   #331
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #332
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 10-21-2019, 12:45 PM   #333
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #334
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,422
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.
Lokasenna is offline   Reply With Quote
Old 10-21-2019, 02:17 PM   #335
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #336
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,422
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.
Lokasenna is offline   Reply With Quote
Old 10-21-2019, 04:53 PM   #337
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #338
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,422
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.
Lokasenna is offline   Reply With Quote
Old 10-22-2019, 04:43 AM   #339
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #340
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,422
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.
Lokasenna is offline   Reply With Quote
Old 10-23-2019, 07:41 AM   #341
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 10-23-2019, 02:47 PM   #342
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,923
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   #343
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

Yes I know. Maybe my writing sounded a little bit too harsh, sorry for that.
__________________
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 11-04-2019, 11:11 AM   #344
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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
__________________
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 11-04-2019, 11:11 AM   #345
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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
__________________
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 11-25-2019, 10:00 AM   #346
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
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   #347
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

No, as you created it in reaper-extstate.ini, not reaper.ini.
__________________
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 11-25-2019, 10:31 AM   #348
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
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   #349
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 11-25-2019, 10:38 AM   #350
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
Default

It returns 0 with true as well :/
reapero is offline   Reply With Quote
Old 11-25-2019, 10:42 AM   #351
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

I'll check...

Edit: What do you want to achieve?
__________________
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 11-25-2019, 10:47 AM   #352
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
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   #353
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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...
__________________
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 11-25-2019, 10:54 AM   #354
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
Default

Allright! Thanks again
reapero is offline   Reply With Quote
Old 11-28-2019, 07:13 AM   #355
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 11-28-2019, 08:03 AM   #356
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
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   #357
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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 11-29-2019, 07:58 AM   #358
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 247
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   #359
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

Oopps, you're right, that is wrong in my docs.
Thanks
__________________
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-02-2019, 08:16 AM   #360
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
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.
__________________
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
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 11:35 PM.


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