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: May 2017
Location: Leipzig
Posts: 6,621
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 - Donate, if you wish

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