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
Default

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:
https://mespotin.uber.space/Ultrasch...ackHeightState
https://mespotin.uber.space/Ultrasch...ackHeightState

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.

https://mespotin.uber.space/Ultrasch...Functions.html

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:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote