Adding scripts : First Timer

spantini

COO of me, inc.
This is all new to me. I just learned how to add scripts in Reaper to perform custom actions. I haven't learned the scripting language(s) yet, but I can copy/paste others' scripts which have been posted in Reaper's forums.

My first script addition came about because there are times when Reaper shows "audio device closed", preventing Reaper from operating. With my old Tascam interface this meant the driver was not there - for whatever reason. In my Windows 10 desktop, I would have to go to ADD/Remove Programs and Repair/Install the driver again, which required a system restart and wasted time.

I'm not having these sorts of problems with my new interface, but sometimes I forget to turn the interface on before I open Reaper, which results in the "audio device closed" thing. Simply turning the interface on at this point doesn't work - doesn't activate the device. I would need to close Reaper and reopen it and that would detect and activate the device, making everything work.

Well, this isn't as bad as with the old interface having to reinstall the driver and restart the system, but I got to wondering if there was a way to activate the device (interface) without rebooting Reaper - do it with Reaper open. So I trotted on over to the Reaper Forums and posed my question. Lo and behold, a quick reply appeared.

At first, one simple suggestion from @lexaproductions didn't do the trick - reselecting audio device from Preferences/Audio, so he gave me a simple script to perform the required action - and it worked like a charm. I couldn't get it to work following his directions exactly, but I tweaked it around a bit until I got it done. Now when I get the "audio device closed" indication (and interface is on), I just go to Reaper's Action List and double-click the action, which I have saved as "Script: Reset Audio Hardware.lua", and BOOM! The interface activates and everything works without all that resetting/restarting crap.

 
Back
Top