I recently got the idea of controlling a bunch of effects using the coordinates particles on a plane with physics, so I coded this rudimentary physics system and was having a lot of fun playing around with it when I wondered if I could convert those coordinates into points of a table, use it to distort a signal and basically make a complex dynamically-changing waveshaper. After struggling a lot I managed to get everything working, but when I tried visualizing the table in real time using gentable or soundfiler it instantly crashed. After fiddling around I got to the conclusion that running an i event for an instrument that updated the table every frame at such a high rate together with the massive physics system code was too much for the plugin to handle, so i came up with the idea of using signaldisplay to visualize the table using an oscilator to play the table 20hz onto an a-rate signal. That worked quite well but as you can see on the video it flickers a lot every time the particles move. After experimenting for a while I can tell that the problem isn’t updating the table using copya2ftab every cycle because when I change the table in real time modifying the smooth parameter while the particles are frozen there is no flickering (as you can see right at the end of the video). I have already tried guifreshrate(0) but the flickering is still going on. Maybe it’s the cabbageSet updating the particle image bounds in a while loop every cycle? because it seems as the faster the particles move the more flickering problems there are. I honestly have no idea how to fix this and I’m kinda lost.
Signaldisplay flickering
I recently got the idea of controlling a bunch of effects using the coordinates particles on a plane with physics, so I coded this rudimentary physics system and was having a lot of fun playing around with it when I wondered if I could convert those coordinates into points of a table, use it to distort a signal and basically make a complex dynamically-changing waveshaper. After struggling a lot I managed to get everything working, but when I tried visualizing the table in real time using gentable or soundfiler it instantly crashed. After fiddling around I got to the conclusion that running an i event for an instrument that updated the table every frame at such a high rate together with the massive physics system code was too much for the plugin to handle, so i came up with the idea of using signaldisplay to visualize the table using an oscilator to play the table 20hz onto an a-rate signal. That worked quite well but as you can see on the video it flickers a lot every time the particles move. After experimenting for a while I can tell that the problem isn’t updating the table using copya2ftab every cycle because when I change the table in real time modifying the smooth parameter while the particles are frozen there is no flickering (as you can see right at the end of the video). I have already tried guifreshrate(0) but the flickering is still going on. Maybe it’s the cabbageSet updating the particle image bounds in a while loop every cycle? because it seems as the faster the particles move the more flickering problems there are. I honestly have no idea how to fix this and I’m kinda lost.
Alr nevermind I finally found what was causing the issue. There’s an svg image on top of the display that displays a couple crosses showing the average values of all particles and it also updates every cycle. When I don’t update it the display doesn’t flicker anymore. I’m guessing it stops the display from drawing for one frame every time it updates. I’ll just display the crosses with labels set as “+” and update those instead of an svg image. One lssue I have though is that the line stops displaying in regions where something is already displaying, like the silder popups or the particle images. I’m guessing this is for optimization reasons, and it would be fine if it updated correctly but it takes a frame to update and as a result the line looks choppy as when the particles are moving the spot that they were the previows frame appears as a gap in the signaldisplay line for a split second. Is there a way to get around this?