I decided would like to be able to use OSC to toggle mono/stereo master output, so I now have my tool add a Stereo Expander device.
When the device is added the Lua code sets “Expand” to 0 (i.e. mono). But I also want to set “Mono Mix” to “L+R”. The device defaults to just “R”. I can not figure out how to set this to “L+R” using Lua.
A dirty way to access “any” property of a device would be to feed it preset data as an XML snippet.
How do you “feed it preset data as an XML excerpt”?
I tried assigning XML to the property but got an error
renoise.song().selected_device.active_preset_data = "<?xml version='1.0' encoding='UTF-8'?><FilterDevicePreset doc_version='10'> <DeviceSlot type='StereoExpanderDevice'> <IsMaximized>true</IsMaximized> <MonoMixMode>L+R</MonoMixMode> <StereoWidth> <Value>0.5</Value> </StereoWidth> <SurroundWidth> <Value>0.0</Value> </SurroundWidth> </DeviceSlot></FilterDevicePreset>"
*** exception: ''[BinStream]' was saved with an incompatible, more recent version of Renoise.'
*** stack traceback:
*** [C]: ?
*** [C]: in function '__newindex'
*** [string "do..."]:22: in function <[string "do..."]:11>
*** __assign-xml.lua:1: in main chunk
(It’s such an odd error it makes me wonder if it has nothing to do with trying to assign XML.)
Update: This seems to be an issue with my install of 2.8.2, since the same thing works fine in 3.0.1.
Update 2: Changing the doc_version attribute from “10” to “9” gets it working in 2.8.2 and 3.0.1.