Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

opening xml files in Flowstone

For general discussion related FlowStone

opening xml files in Flowstone

Postby KG_is_back » Mon Mar 09, 2015 2:38 am

I'm attempting to open an XML file in flowstone. I've realized that when opened in notepad, the XML file is fairly easy to extract data from (using ruby). However flowstone "open text file" prim does not open XMLs as TXTs - I first have to manually temporarely rename the XML file to .txt and open it then.

I've attempted to rename the file using shell execute prim by calling cmd.exe
the argument is
Code: Select all
ren C:\studio\Synthmaker\Flowstone\Projects\xml\table.xml table.txt


It works well, when I open cmd.exe and type it in manually, but it does nothing when used from flowstone via shell execute prim. This is my first attempt to use shell execute prim, so don't really know what I'm doing. Can someone help me? What am I doing wrong?
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: opening xml files in Flowstone

Postby RJHollins » Mon Mar 09, 2015 4:04 am

Hi KG,

I load XML files for a bunch of my MIDI controller programs.

What I do ... and I'm not sure it is the BESTest way ... but it does work.

From the LOAD prim I send to a TEXT prim. That's the basics.

From there I parse through the text array [using a GETAT Loop] that feeds a RUBY module that is a series of CASE statements. I'm needed to parse out a series of patch names and patch numbers that are headers in the XML file.

Like I say ... nothing cool or fancy [at least not yet]. I've no doubt a full RUBY design might be better to handle anything more complex. I've a better Ruby understanding since putting this part together ... just to find time.

You might want something more 'cool', but if I can help a bit ... just ask.

NOTE: I remember back on the SM forum that our beloved TROG had started to outline an XML routine. Don't know what happen [and definitely miss Him from the forum]. Please stop by and tell us your OK TROG !!! :)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: opening xml files in Flowstone

Postby Exo » Mon Mar 09, 2015 1:37 pm

As far as I'm aware it should load as a text file, the extension shouldn't matter.

Regarding the shell try this...
Code: Select all
ren "C:\studio\Synthmaker\Flowstone\Projects\xml\table.xml" table.txt


I have found wrapping in quotes usually works.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: opening xml files in Flowstone

Postby tulamide » Tue Mar 10, 2015 2:05 am

I want to confirm that the Text Load Prim loads as text whatever path it is given. Use it with File Dialog for fast access. Works for me.

Alternatively the Ruby version (with trigger input "doit" and string input "path"):
Code: Select all
def init
   @content = ""
end

def event i, v
   if i == 'doit'
      @content = IO.read(@path)
      watch "content", @content
   end
end
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: opening xml files in Flowstone

Postby KG_is_back » Tue Mar 10, 2015 2:51 am

Strangely it wasn't working yesterday but it works now... perhaps I did something wrong or stupid, that made it not work. Nevertheless, I wasn't able to make the execute shell to work. Perhaps I will have a look at it once the DSPcode2 project is finished. I stumbled upon few problems in my design there, that made me rework the code generator part from ground up. The development is so sluggish because Flowstone RubyEdit debug screen is bitterly unhelpful.

And thanks Tulamide. Pure ruby version is also very helpful.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: opening xml files in Flowstone

Postby RJHollins » Tue Mar 10, 2015 4:01 am

Alternatively the Ruby version


Nice Tulamide .... THANKS !! 8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 72 guests