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
content management
12 posts
• Page 1 of 2 • 1, 2
content management
I just noticed, that the old modules I use - will not fit here. Guess this is ruby'ish part.
I'm looking for some content management tool, that allows to split and join data according to separators.
Let say that I have something like this:
a,b,c,d,e|x,y,z,v|q,w,e,r,t,y
p,f,g,h|3,5,6,2|b,6,4,k
So I have line separators, comma separators and column separators, and string (textual+numeric) data.
Loading from the text file - how to split these data according to various separators?
Saving file - how to mix it again according the same separators?
Are there limits on how long a single line can be?
I'm looking for some content management tool, that allows to split and join data according to separators.
Let say that I have something like this:
a,b,c,d,e|x,y,z,v|q,w,e,r,t,y
p,f,g,h|3,5,6,2|b,6,4,k
So I have line separators, comma separators and column separators, and string (textual+numeric) data.
Loading from the text file - how to split these data according to various separators?
Saving file - how to mix it again according the same separators?
Are there limits on how long a single line can be?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: content management
tester wrote:I'm looking for some content management tool, that allows to split and join data according to separators.
You may have missed this one from nubeat7....
Works great and does what you need..
http://www.dsprobotics.com/support/viewtopic.php?f=3&t=1592#p7069
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: content management
I'm totally split between two very different topics, so I'm missing everything I can...
Thanks!
Thanks!
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: content management
match whatever you want,
http://www.tutorialspoint.com/ruby/ruby ... ssions.htm
maybe also 'scan' instead of 'split', could be of interest, or 'join_with_prefix':
http://stackoverflow.com/questions/8033 ... h-a-prefix
also interesting:
http://drewolson.wordpress.com/2007/03/ ... ree-bonus/
http://www.tutorialspoint.com/ruby/ruby ... ssions.htm
maybe also 'scan' instead of 'split', could be of interest, or 'join_with_prefix':
http://stackoverflow.com/questions/8033 ... h-a-prefix
also interesting:
http://drewolson.wordpress.com/2007/03/ ... ree-bonus/
Last edited by Nubeat7 on Thu Oct 03, 2013 9:43 pm, edited 1 time in total.
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: content management
Also worth noting, you don't have to use the RegEx's for the 'split' method - you can use any string (even whole words) as the split points...
There are also a few strings that have special behaviour...
Split the string at ANY whitespace - that's; space, continuous runs of spaces, tab or new-lines.
Character codes...
You can specify many special characters using this 'backslash' notation - a backslash followed by a single character. The string must be inside double quotes for this to work ( " ", NOT ' ' ). The most useful are...
"\t" = TAB
"\v" = Vertical tab.
"\n" = New-line
"\r" = Carriage return
"\0xNN" = NN is a hex number, gives you the corresponding ACSII character
To reliably split lines...
There are different standards for terminating lines - sometimes 'newline', sometimes 'return', sometimes both - depending on where the string came from. Using 'split' with no separator value ensures that all possibilities are taken care of.
@Nubeat - nice tutorial links. Cheers!
- Code: Select all
@my_string.split(",")
There are also a few strings that have special behaviour...
Split the string at ANY whitespace - that's; space, continuous runs of spaces, tab or new-lines.
- Code: Select all
@my_string.split(" ") # A single space sharacter.
Character codes...
- Code: Select all
@my_string.split("\t")
You can specify many special characters using this 'backslash' notation - a backslash followed by a single character. The string must be inside double quotes for this to work ( " ", NOT ' ' ). The most useful are...
"\t" = TAB
"\v" = Vertical tab.
"\n" = New-line
"\r" = Carriage return
"\0xNN" = NN is a hex number, gives you the corresponding ACSII character
To reliably split lines...
- Code: Select all
@my_string.split()
There are different standards for terminating lines - sometimes 'newline', sometimes 'return', sometimes both - depending on where the string came from. Using 'split' with no separator value ensures that all possibilities are taken care of.
@Nubeat - nice tutorial links. Cheers!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: content management
Great stuff Guys !!
This stuff about RUBY is so helpful. I've been trying to use it more and more, spending most of the time hitting Google ... but there are plenty of times I've had to come back to the FS forum to really help.
I would be so good to have an FS database of RUBY stuff that could be searched out. It would probably be a nitemare to organize, but would be invaluable.
Nonetheless ... these posts help a lot !
This stuff about RUBY is so helpful. I've been trying to use it more and more, spending most of the time hitting Google ... but there are plenty of times I've had to come back to the FS forum to really help.
I would be so good to have an FS database of RUBY stuff that could be searched out. It would probably be a nitemare to organize, but would be invaluable.
Nonetheless ... these posts help a lot !
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: content management
Oh yes - just spotted that you asked how to join them back together.
Very simple...
The separator string (e.g. ","), works mostly like the examples for the .split method shown earlier - except for when you want to join lines.
'.join()' with no argument, just joins everything end to end with no separator. To join whole lines, you need to use the 'backslash' codes. I've found, that for best compatibility with FS text displays etc. it's best to use 'return' AND 'new-line'...
In any case, the array doesn't have to contain only strings - numbers etc. will automatically get converted.
Very simple...
- Code: Select all
@my_string = @my_array.join(",")
The separator string (e.g. ","), works mostly like the examples for the .split method shown earlier - except for when you want to join lines.
'.join()' with no argument, just joins everything end to end with no separator. To join whole lines, you need to use the 'backslash' codes. I've found, that for best compatibility with FS text displays etc. it's best to use 'return' AND 'new-line'...
- Code: Select all
@my_string = @my_array.join("\r\n")
In any case, the array doesn't have to contain only strings - numbers etc. will automatically get converted.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: content management
Trog - could you put your thoughts into copy/paste modules to play with? I have no idea what/how to deal with it.
Meanwhile I will try to get my thoughts on what exactly I need to get.
Meanwhile I will try to get my thoughts on what exactly I need to get.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: content management
Copy/paste of knob/switch etc. control values, yes?
So, I'm thinking something like - copying all settings from one oscillator to another one, and that kind of thing.
This is something, I think, to consider for my "meta project"...
Maybe it seems that I have many unfinished project posted here lately - Knob, XML parsing, Graphics classes, Table displays etc. But I am working steadily to bring all of these together to make a coherent system - one "Master" module to handle MIDI parameters, undo/redo, copy/paste, 'linked' controls, user preference files etc. - and a simple module that can drop into any control design to enable the features.
Sharing data between Ruby blocks is the key to this - and the MIDI learn from those knobs I posted a few days ago is a breakthough, I think; finally a robust design for such data sharing - previous things I built had too many chances of Ruby errors. That is crucial because I think this system needs to work without the user ever needing to edit any Ruby code - it must be as simple as the VST parameter/manager to use, just a couple of modules and handful of wireless links.
That is still a long way off, so in the meantime, as far as copy/paste goes, I have done it before in one of my old SM projects. In practice, it was a lot of "wiring" and duplicate parts, but in principle quite simple...
Copy = take current value and store into a sample-and-hold prim' (the 'clipboard')
Paste = read out the S&H into the destination.
It's effective enough, but laborious to set up - separate 'clipboards' for each module type (e.g. oscillator, filter, envelope etc.)
I have also used another method - using a small text file in place of the many S&H primitives. This is the best way IMHO - because the clipboard is on the HDD, settings can be copied between different plugin instances and projects.
I will look and see if there is anything from those old designs that I can post as a practical example.
So, I'm thinking something like - copying all settings from one oscillator to another one, and that kind of thing.
This is something, I think, to consider for my "meta project"...
Maybe it seems that I have many unfinished project posted here lately - Knob, XML parsing, Graphics classes, Table displays etc. But I am working steadily to bring all of these together to make a coherent system - one "Master" module to handle MIDI parameters, undo/redo, copy/paste, 'linked' controls, user preference files etc. - and a simple module that can drop into any control design to enable the features.
Sharing data between Ruby blocks is the key to this - and the MIDI learn from those knobs I posted a few days ago is a breakthough, I think; finally a robust design for such data sharing - previous things I built had too many chances of Ruby errors. That is crucial because I think this system needs to work without the user ever needing to edit any Ruby code - it must be as simple as the VST parameter/manager to use, just a couple of modules and handful of wireless links.
That is still a long way off, so in the meantime, as far as copy/paste goes, I have done it before in one of my old SM projects. In practice, it was a lot of "wiring" and duplicate parts, but in principle quite simple...
Copy = take current value and store into a sample-and-hold prim' (the 'clipboard')
Paste = read out the S&H into the destination.
It's effective enough, but laborious to set up - separate 'clipboards' for each module type (e.g. oscillator, filter, envelope etc.)
I have also used another method - using a small text file in place of the many S&H primitives. This is the best way IMHO - because the clipboard is on the HDD, settings can be copied between different plugin instances and projects.
I will look and see if there is anything from those old designs that I can post as a practical example.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: content management
I mean - I read fractions of your ruby code, but have no idea where to paste them and what else to modify in order to make the ruby module work.
Playing with dozens of green connections in visual modular mode - at least the amount of choices is limited, this is how I see it; I often find solutions there even if I don't know how I did it. Playing with ruby content - "hmm... you are screaming, I don't know - did I just cut your leg?", I have no vague idea what is going on.
Playing with dozens of green connections in visual modular mode - at least the amount of choices is limited, this is how I see it; I often find solutions there even if I don't know how I did it. Playing with ruby content - "hmm... you are screaming, I don't know - did I just cut your leg?", I have no vague idea what is going on.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 95 guests