Plug'n Script: read/write XML files

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

does Plug'n Script provide built in functionality to read / write xml files? The factory presets contain examples of reading / writing wav files, but I did not find examples for any other file types. Can someone provide an example for xml files?

Thanks,
Paul

Post

I don't think there is an XML parser/writer available in Angelscript. You can however port a simple one from C++ quite quickly I think. Why do you need Xml by the way?

Post

I assume that porting a C++ xml parser involves rebuilding Angelscript. Would I also need to rebuild the Plug'n Script dlls? I'm assuming I cannot do that, since I don't have the source code. Please let me know how I should proceed.
The reasons why I'm asking for an xml parser is that I need to save and reload additional info than the data that is saved in presets. For example, I developed a simple multi-clip player using Plug'n Script, and I would like to save the recorded clips to files along with some metadata, and be able to reload them on demand. I was thinking of using xml for the metadata part, as it would be easier to adapt my metadata structure with time. I was also thinking of building an arpeggiator, that would have more input parameters than Plug'n Script currently allows, so I would need to swap the currently edited steps in and out the input parameters. Once swapped out, I was thinking of keeping their state in xml. I would also need to keep the complete patterns in xml, since the preset files would not be able to keep everything. Does that make sense? Do you know of other ways to achieve this, without writing some kind of file parser or hard coding a file format?
Thanks,
Paul

Post

I was actually thinking about finding some very simple java or C++ code that does the parsing/writing and just adapting it to angelscript (the same way the wav file reader/writer was done) - the problem is that a full-featured xml parser is not THAT simple... So maybe if your metadata is simple enough (a list of items without much structure), a plain text file with one name/value per line would work?

Post

or JSON. But I don't think that would be simple to port either
MacPro 5,1 12core x 3.46ghz-96gb MacOS 12.2 (opencore), X32+AES16e-50

Post

JSON may be a bit simpler than XML in this regard but we have not checked it out yet. However, unless you need complex data structures, a plain text file usually works well enough.

Post Reply

Return to “Blue Cat Audio”