tester ·
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?
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
tester ·
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?
DigitalWhiteByte ·
I think so. depends on what you want to do. tries to give an example.
CoreStyler ·
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)
tester ·
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).
DigitalWhiteByte ·
you can not use the preset manager for this?
tester ·
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.
DigitalWhiteByte ·
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. 🙂
tester ·
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.
DigitalWhiteByte ·
(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 .... 😉
tester ·
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?
DigitalWhiteByte ·
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.
CoreStyler ·
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).
tester ·
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.
CoreStyler ·
This should be a simple way for adding new lines:
For getting values just find the string at index x. 😀
tester ·
Ah, I see what you mean. 😉 Thanks.
DigitalWhiteByte ·
tester wrote: 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.
I'm sorry, but when I'm on my PC, I'll post an example. takes patience. But I have some more info. These parameters are related to knobs, buttons, etc.. And will serve to update and store their state, or are they just a random list of parameters you will use in some way .... but what? Data entry will be made only by hand, as in your example?
Your method does not do any checking on the parameters for the list loaded and will have no particular order. So, how extract the data from the list? You want to explain better what would you do? I ask this in order to propose a functional example. ops too many questions ....
tester ·
This particular example is a part of a converter, that performs certain calculations on input data (like on this example: SM cern and neutrinos :-D which I added yesterday) and allows to create output list files by user; importable in different section of the app. That why I said earlier, that I've got it.
But what you wrote about preset manager awoke my curiosity, because it is a part of my general interest. Before me - there is a lot of job to do; I'm slowly finalizing my basic engine, and then - I'm going to put it into larger cluster. The cluster will be made of several copies of the engine plus some additional tools. While the whole app will need to store presets of the wholeness - I'd like to add sub-presets to particular sub-units in the cluster. Each sub-unit will have between 50 and 150 single parameters (name/value - sliders, switches, editboxes, filepaths), and the whole - I don't know, maybe between 2000-3000 single parameters then?
It's rather a sound research project than synth, but certainly it will produce cool sounds. In a few days I should be able to post some first pre-release version of the engine, which will be free app. Right randomness LFO generator is still stalking behind me and some better gui elements than I have right now 😉
p.s.: here is a workflow picture of the engine: gui elements
Wrote something here? To have a post removed or your name hidden, write to [email protected].