Automation of on/off switches
Posted: Sat Feb 20, 2021 9:18 am
My current project is a Hurdy Gurdy simulator so I needed to simulate being able to turn individual strings on/off like on a real HG. My plan was that the soft (click-free) string on/off switches could be recorded and automated in the DAW. However, when I tested this it didn’t work correctly in Reaper.
The automation would correctly register my turning the switches on and off and show the action correctly in the automation lane’s envelope. BUT, when I played it back, the switches would turn on but not off until the track had stopped. Thus followed a few hours of investigation as to what was going on and going wrong.
I found that the float value from the automation envelope coming out of the preset parameter prim was not steady at zero, but fluctuating at a very low value, like 0.00000xx.
So I checked and it seems that any float used as a Bool will produce TRUE if it’s not exactly zero. So when the automation value should have been exactly zero it was slightly higher so, since the switch operates as Boolean true/false, it was always True due to this “non-zero noise” and thus the switch never turned off again. I also noticed that the float value of 1 was slightly noisy. I have no idea why DAW zero isn’t actually zero but I made a work-around by using Greater than prims to set a threshold of 0.5 and that works reliably. Maybe someone knows why Reaper’s automation values are not accurate…
The attached schematic is a modified version of the stock bitmap slide switch also with the preset module separate which you could use to replace preset modules in any other toggle switch. I used it in my own LED/switch which is not a bitmap toggle and it works there too.
Of course this will only be interesting if you think the user might want to automate a specific toggle switch.
The automation would correctly register my turning the switches on and off and show the action correctly in the automation lane’s envelope. BUT, when I played it back, the switches would turn on but not off until the track had stopped. Thus followed a few hours of investigation as to what was going on and going wrong.
I found that the float value from the automation envelope coming out of the preset parameter prim was not steady at zero, but fluctuating at a very low value, like 0.00000xx.
So I checked and it seems that any float used as a Bool will produce TRUE if it’s not exactly zero. So when the automation value should have been exactly zero it was slightly higher so, since the switch operates as Boolean true/false, it was always True due to this “non-zero noise” and thus the switch never turned off again. I also noticed that the float value of 1 was slightly noisy. I have no idea why DAW zero isn’t actually zero but I made a work-around by using Greater than prims to set a threshold of 0.5 and that works reliably. Maybe someone knows why Reaper’s automation values are not accurate…
The attached schematic is a modified version of the stock bitmap slide switch also with the preset module separate which you could use to replace preset modules in any other toggle switch. I used it in my own LED/switch which is not a bitmap toggle and it works there too.
Of course this will only be interesting if you think the user might want to automate a specific toggle switch.