Page 1 of 1

Posted: 02 Nov 2014, 17:15
by oli_lab
I'm building an interactive patch were someone can choose from a soundbank, choose to fiddle with some parameters, and then listen to the result.

to do that, I have to attach some metadatas to each files, such as markers, the range of the pitch values, filter values that make the particular sound interesting...

I managed to do that with a array memorizer and a preset manager... but it is not as professionnal as it should be... and a pain to edit.

What I'd like to do is a spreadsheet (.CVS) that can be saved as a file and be externally edited from a text editor, the readback from Usine to load a file (from long file name), and taking into account the metadatas.

would anyone has an idea ?

thanx

Olivar

Posted: 03 Nov 2014, 00:22
by oli_lab
I managed something, not a CVS but many text files...
used the "write text example" and made a "text file reader"

<code>
/////////////////////////
// write text File
/////////////////////////
// declaration


const filenameDefault = 'c:speak.txt';
var fname,input : Tparameter;
var st : TStringList;

// save
procedure SaveToTextFile;
begin
st.create;
st.add(GetStringValue(input));
st.SaveToFile(GetStringValue(fname));
st.free;
end;

// Callback
procedure callBack(n:integer);
begin
SaveToTextFile;
end;

// initialisation : create parameters
procedure init;
var i : integer;
begin

Input := CreateParam('in',ptTextField);
SetIsOutPut(Input,false);
fname := CreateParam('file name',ptTextField);
SetStringValue(fname,filenameDefault);
SetIsOutPut(fname,false);
end;


</code>

<code>
//////////////////////////
// Read text File example
/////////////////////////
// declaration


const filenameDefault = 'c:speak.txt';
var fname,textOut : Tparameter;


var st : TStringList;
var data : array of single;

// initialisation : create parameters
procedure init;
var i : integer;
begin
// initialisation : create parameters

textOut := CreateParam('out',ptTextField);
SetIsInPut(textOut,false);
fname := CreateParam('file name',ptTextField);
SetStringValue(fname,filenameDefault);
SetIsOutPut(fname,false);
end;

// read
procedure ReadTextFile;
begin
//read the previously saved file
st.create;
st.clear;
st.loadfromFile(GetStringValue(fname));
SetStringValue(textOut,st.GetStrings(0));
st.free;
end;

// Callback
procedure callBack(n:integer);
begin
ReadTextFile;
end;


</code>

Posted: 04 Nov 2014, 12:23
by 23fx23
nice!, thx 4 sharing

Posted: 04 Nov 2014, 20:04
by oli_lab
well, I'm getting somewhere :)

tell me what you think !

http://www.sensomusic.com/forums/upload ... datas1.pat