Also there is another method that you can find in Chris McCormick's s-abstractions s-controlsurface: https://mccormick.cx/projects/s-abstractions/. The method is to traverse the pointer to the subpatch and then use [next( so many times until you reach the desired scalar. Which you then can access.
Edit: i should add that the way Chris McCormick does it, the scalars are appended to the head of the subpatch (same as i did above). Therefore the last added scalar becomes the first in the subpatch and [next( is therefore not in the expected order. Anyhow it should be possible to implement it correctly (only traverse the pointer of the append on load and on clear or instead count elements and use inverse number), but i couldn't quite figure it out on first try, so i just recommend the above method with lists which also gives the most control in my opinion