View Single Post
Old 06-21-2021, 12:58 AM   #2
Meo-Ada Mespotine
Human being with feelings
Meo-Ada Mespotine's Avatar
Join Date: Apr 2020
Location: Leipzig
Posts: 2,632

Working with Statechunks is fiddly, so the easiest way to work with them is to use Ultraschall-Api for this.
In Ultraschall-Api, I have added tons of functions, that allow passing a statechunk as parameter to get and to set the values in there.

For instance, if you want to get and set the current trackheight of a TrackStateChunk, you can use GetTrackHeightState and SetTrackHeightState:

You get a TrackStateChunk with reaper.GetTrackStateChunk and you can commit a TrackStateChunk back into a track with reaper.SetTrackStateChunk.

The functions of Ultraschall-Api who probably support TrackStateChunks begin with GetTrackXXX and SetTrackXXX, where XXX is the name of the state.
Look in the functionindex in the docs for Track Management -> Get Track States and Set Track States for a list of them.

If you have a specific statechunk-entry you want to get/set, you can also look for the statechunk-entry's name in the docs, for instance TRACKHEIGHT to find the functions, who deal with the TRACKHEIGHT-statechunk-entry.
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Off for some time. Bugreports&Docs notes please do here: - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote