ArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2017-07-25T11:32:16+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/5792 2017-07-25T11:32:16+02:00 2017-07-25T11:32:16+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37452#p37452 <![CDATA[store data to file]]> XML is brilliant as it can organize data and we can make query and mad stuff.

filestream is more straight forwards and is a good candidate for plain array data.

time vs ideas...

cheers

Olivar

Statistics: Posted by oli_lab — 25 Jul 2017, 11:32


]]>
2017-07-20T02:33:27+02:00 2017-07-20T02:33:27+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37397#p37397 <![CDATA[store data to file]]> Statistics: Posted by sm_jamieson — 20 Jul 2017, 02:33


]]>
2017-07-19T12:46:31+02:00 2017-07-19T12:46:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37395#p37395 <![CDATA[store data to file]]> So far I managed to save in the patch with the chunk system. But definitly will complete the module with a save /load to file option.
Also made a 128x128 for crazy midi stuff
Cheers

Statistics: Posted by oli_lab — 19 Jul 2017, 12:46


]]>
2017-07-07T10:55:09+02:00 2017-07-07T10:55:09+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37317#p37317 <![CDATA[store data to file]]> read/write binary or classic text files mainly, there are several methods. i don't recall all but can check c++ reference, filestream for ex

found back in kinda preset manager that stored datas as text lines i used something like this for ex:

void Preset::SaveToFile(string Path)
{
ofstream outfile;
outfile.open(Path);

// do your lines stuff here ie float to string
outfile << "blablastring" << endl; //line0
outfile << "second line txt" << endl; //line 1 ect, or use a loop

outfile.close();
}
///////////////////////////////
void Preset::ReadFromFile(string Path)
{
fstream infile;
infile.open(Path);

string line;
float F_value = 0;

while (getline(infile, line))
{
getline(infile, line);
F_value = atof(line.c_str()); //string to F value line after line
}
infile.close();
}
//////////////////////////////////////////

or used a different binary one on in other project, among those lines to read wav floats that where saved in a raw binary file, so easier as had no header to mess with
but maybe could start the 'effective' reading after the number of bytes of header if plan using wave files

myfile = fopen(input_file_name, "rb"); //read binary mode
fseek(myfile, 0L, SEEK_END); //scrub all the file
nb_elements = ftell(myfile); // retrieve nb of elements
nb_elements /= 4; // as floats are 4 bytes
rewind(myfile); //returns back at start

values = new float[nb_elements]; // array of float that will get values

fread(values, sizeof(float), nb_elements, myfile); // read file bytes and store to values array
fclose(myfile);

// do stuff with the retrieved array then
//////////

Statistics: Posted by 23fx23 — 07 Jul 2017, 10:55


]]>
2017-07-06T23:54:21+02:00 2017-07-06T23:54:21+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37316#p37316 <![CDATA[store data to file]]> what are the options to save datas to a file with SDK ? seems to me it is only possible to save a wavefile

maybe it is possible to use sdkSaveToDiskAudioFile (AudioFilePtr audiofile, AnsiCharPtr name, int nbChannels)

with a different extention (for exemple .dhh)

and make a special reader

TPrecision only tho, so not good for timestamps...

any idea ?

cheers

Statistics: Posted by oli_lab — 06 Jul 2017, 23:54


]]>
BrainModular BrainModular Users Forum 2017-07-25T11:32:16+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/5792 2017-07-25T11:32:16+02:00 2017-07-25T11:32:16+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37452#p37452 <![CDATA[store data to file]]> XML is brilliant as it can organize data and we can make query and mad stuff.

filestream is more straight forwards and is a good candidate for plain array data.

time vs ideas...

cheers

Olivar

Statistics: Posted by oli_lab — 25 Jul 2017, 11:32


]]>
2017-07-20T02:33:27+02:00 2017-07-20T02:33:27+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37397#p37397 <![CDATA[store data to file]]> Statistics: Posted by sm_jamieson — 20 Jul 2017, 02:33


]]>
2017-07-19T12:46:31+02:00 2017-07-19T12:46:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37395#p37395 <![CDATA[store data to file]]> So far I managed to save in the patch with the chunk system. But definitly will complete the module with a save /load to file option.
Also made a 128x128 for crazy midi stuff
Cheers

Statistics: Posted by oli_lab — 19 Jul 2017, 12:46


]]>
2017-07-07T10:55:09+02:00 2017-07-07T10:55:09+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37317#p37317 <![CDATA[store data to file]]> read/write binary or classic text files mainly, there are several methods. i don't recall all but can check c++ reference, filestream for ex

found back in kinda preset manager that stored datas as text lines i used something like this for ex:

void Preset::SaveToFile(string Path)
{
ofstream outfile;
outfile.open(Path);

// do your lines stuff here ie float to string
outfile << "blablastring" << endl; //line0
outfile << "second line txt" << endl; //line 1 ect, or use a loop

outfile.close();
}
///////////////////////////////
void Preset::ReadFromFile(string Path)
{
fstream infile;
infile.open(Path);

string line;
float F_value = 0;

while (getline(infile, line))
{
getline(infile, line);
F_value = atof(line.c_str()); //string to F value line after line
}
infile.close();
}
//////////////////////////////////////////

or used a different binary one on in other project, among those lines to read wav floats that where saved in a raw binary file, so easier as had no header to mess with
but maybe could start the 'effective' reading after the number of bytes of header if plan using wave files

myfile = fopen(input_file_name, "rb"); //read binary mode
fseek(myfile, 0L, SEEK_END); //scrub all the file
nb_elements = ftell(myfile); // retrieve nb of elements
nb_elements /= 4; // as floats are 4 bytes
rewind(myfile); //returns back at start

values = new float[nb_elements]; // array of float that will get values

fread(values, sizeof(float), nb_elements, myfile); // read file bytes and store to values array
fclose(myfile);

// do stuff with the retrieved array then
//////////

Statistics: Posted by 23fx23 — 07 Jul 2017, 10:55


]]>
2017-07-06T23:54:21+02:00 2017-07-06T23:54:21+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=5792&p=37316#p37316 <![CDATA[store data to file]]> what are the options to save datas to a file with SDK ? seems to me it is only possible to save a wavefile

maybe it is possible to use sdkSaveToDiskAudioFile (AudioFilePtr audiofile, AnsiCharPtr name, int nbChannels)

with a different extention (for exemple .dhh)

and make a special reader

TPrecision only tho, so not good for timestamps...

any idea ?

cheers

Statistics: Posted by oli_lab — 06 Jul 2017, 23:54


]]>