quick question regarding file saving

If you require help or assistance with anything then please post here

Moderators: electrogear, exonerate

quick question regarding file saving

Postby tester on Fri Mar 23, 2012 10:08 pm

I have a quick question regarding file saving (simple txt files); I'm not there yet.

Is it possible to:
a) select existing txt file with some content and
b) append (via trigger) string values as new lines at the end of that file?
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby DigitalWhiteByte on Fri Mar 23, 2012 11:03 pm

I think so. depends on what you want to do.
tries to give an example.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: quick question regarding file saving

Postby CoreStyler on Sat Mar 24, 2012 7:04 am

DigitalWhiteByte wrote:I think so. depends on what you want to do.
tries to give an example.

Should be. depending if the text you mean has fixed index lines. but if you need to save a new line at every load, just save a file containing last line, then you add string array find of the past line content, and you get the new index (+1)
http://www.thecorestylerz.net
Sound Design, synth development and websites building...
Image
SM COMMUNITY IS MOVING TO
www.synthmakers.net
User avatar
CoreStyler
essemilian
 
Posts: 474
Joined: Sun May 23, 2010 1:25 pm

Re: quick question regarding file saving

Postby tester on Sat Mar 24, 2012 9:58 am

The text file inside will be like this:

name,value
name,value
name,value
name,value

I thought that I can do this. "Select file" opens a text file in a specific location. It's content is loaded into an array. Then, on "add new value" - a new line is added to the array at the end, the array is automatically saved in that specific source location/filename, and automatically reloaded again to SM. Items are added one per cycle (user entered values are converted to array items).
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby DigitalWhiteByte on Sat Mar 24, 2012 4:51 pm

you can not use the preset manager for this?
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: quick question regarding file saving

Postby tester on Sat Mar 24, 2012 5:04 pm

I did as I thought/described and it works.

Preset manager - no. It's an "additional tool" inside the app, that allows you to convert variety of parameters into common representations (in Hz), which can be exported into (inside) an existing list file, that is loaded by user in other section of the app.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby DigitalWhiteByte on Sat Mar 24, 2012 5:18 pm

I've adapted the preset manager, to use it simply as a collector of parameters that I want. so as to take advantage of its characteristics of wireless link, which send the parameters from the bottom of the module, to the outside.

This of course in addition to the existing preset manager who does his classic work.

but I read that you got in your intent. :)
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: quick question regarding file saving

Postby tester on Sat Mar 24, 2012 5:37 pm

Generally I'm trying to not touch the preset manager right now. The reason is - I'm building/thinking the architecture for further projects, in which preset manager will deal with global application, and sub-modules will have their own handy sub-presets / memory storages - probably managed by simple array/trigger/filesave setups. Reading all around the SM forum - I'm trying to predict potential trouble I meet to avoid them before they appear ;-)

I read, that preset manager does not likes too much variables, but I don't know how much is too much. But thanks for interest.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby DigitalWhiteByte on Sat Mar 24, 2012 5:57 pm

(just to talk a little bit)
In fact I use it for just such purposes.
for sub preset manager for a group of parameters.
I try to explain it.
The primitive preset manager, the most exposed to the outside, will have its traditional function.
For example: if you create one in a specific module where there are a group of parameters to be saved,
it will not be exposed to the host, and using options, NoRecompile, it will only work as a collector of parameters.

regard that the preset manager does not like variables,
I do not know what you mean, all the parameters are variables .... ;)
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: quick question regarding file saving

Postby tester on Sat Mar 24, 2012 6:03 pm

I meant the amount of variables to store; i.e. if I understand correctly, 1000 separate variables = 1000 separate triggers/talks between preset manager and multiple locations, 20 arrays (each with 50 variables) - a bit different management (only 20 different locations to talk). I admit - I'm was guessing how it works :-)

I'm reading your post over and over, and have some difficulties to understand (technical english / sentence construction). Could you make a simple osm example with main preset and let say two sub-presets to illustrate?
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby DigitalWhiteByte on Sat Mar 24, 2012 6:12 pm

The preset manager can store arrays.
The advantage is that the parameters would be stored in memory,
and not continually written to and read from file, but only saved or loaded when needed.
will post a simple example.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: quick question regarding file saving

Postby CoreStyler on Sun Mar 25, 2012 12:25 pm

Just follow the way i suggested.
For example your software stores float a.
Save float a into the main text file : mainfile and the last float in : lastfloat
Reopening the software, load last float do a find a string in an array and find float a index into mainfile.
Save? ok stamp
float a, float b (last) in mainfile. Then save float b in lastfloat.
Don't know if you undestand and if is good for you. ;)
by the way you can collect any string/float/int/text in main file. And you can find the last line using lastfloat index and add a new line lastfloatindex + 1 (the new value).
http://www.thecorestylerz.net
Sound Design, synth development and websites building...
Image
SM COMMUNITY IS MOVING TO
www.synthmakers.net
User avatar
CoreStyler
essemilian
 
Posts: 474
Joined: Sun May 23, 2010 1:25 pm

Re: quick question regarding file saving

Postby tester on Sun Mar 25, 2012 1:41 pm

I needed something simple like this (see atachement).
Select existing txt file, and then add values.
Click led to unload file.
There is no "refresh file" icon when you edit txt file externally during processing.
Don't use commas in (noname) field - reserved as a separator.

But still curious about the example on what DigitalWhiteByte wrote.
Attachments
saver.osm
(8.99 KiB) Downloaded 50 times
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: quick question regarding file saving

Postby CoreStyler on Sun Mar 25, 2012 2:33 pm

This should be a simple way for adding new lines:
Simple.PNG
Simple.PNG (23.21 KiB) Viewed 607 times

For getting values just find the string at index x. :D
http://www.thecorestylerz.net
Sound Design, synth development and websites building...
Image
SM COMMUNITY IS MOVING TO
www.synthmakers.net
User avatar
CoreStyler
essemilian
 
Posts: 474
Joined: Sun May 23, 2010 1:25 pm

Re: quick question regarding file saving

Postby tester on Sun Mar 25, 2012 2:42 pm

Ah, I see what you mean. ;-) Thanks.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 688
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests