Thanks Bj?rn,
It seems to me that you know what your talking about much more than I do...
Well, I'm working with small steps. I think I first have to well know how to manipulate arrays with that new language form me.
So, here are two script modules, I don't know how to write them and there is a bug (or more!) somewhere. They are not complete, but it's enough to see what it means.
Could anybody have a look at them:
1. "Ctrls To Array"
Code: Select all
// Ctrls To Array
// Vincent Michel
// 14-02-2007
//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var in_1 : Tparameter;
var in_2 : Tparameter;
var in_3 : Tparameter;
var in_4 : Tparameter;
var in_5 : Tparameter;
var in_6 : Tparameter;
var in_7 : Tparameter;
var in_8 : Tparameter;
var ArrayOut : Tparameter;
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin
in_1 := CreateParam('MinPos',ptDatafader);
in_2 := CreateParam('MaxPos',ptDatafader);
in_3 := CreateParam('VSTi',ptDatafader);
in_4 := CreateParam('Preset',ptDatafader);
in_5 := CreateParam('Vol',ptDatafader);
in_6 := CreateParam('Pan',ptDatafader);
in_7 := CreateParam('Oct',ptDatafader);
in_8 := CreateParam('Velo',ptDatafader);
SetIsOutput(in_1,false); SetMin(in_1,0); SetMax(in_1,127); SetSymbol(in_1,''); SetDefaultValue(in_1,0);
SetIsOutput(in_2,false); SetMin(in_2,0); SetMax(in_2,127); SetSymbol(in_2,''); SetDefaultValue(in_2,127);
SetIsOutput(in_3,false); SetMin(in_3,0); SetMax(in_3,16); SetSymbol(in_3,''); SetDefaultValue(in_3,0);
SetIsOutput(in_4,false); SetMin(in_4,0); SetMax(in_4,127); SetSymbol(in_4,''); SetDefaultValue(in_4,0);
SetIsOutput(in_5,false); SetMin(in_5,0); SetMax(in_5,127); SetSymbol(in_5,''); SetDefaultValue(in_5,48);
SetIsOutput(in_6,false); SetMin(in_6,-100); SetMax(in_6,100); SetSymbol(in_6,' %'); SetDefaultValue(in_6,0);
SetIsOutput(in_7,false); SetMin(in_7,-4); SetMax(in_7,4); SetSymbol(in_7,''); SetDefaultValue(in_7,0);
SetIsOutput(in_8,false); SetMin(in_8,0); SetMax(in_8,200); SetSymbol(in_8,'%'); SetDefaultValue(in_8,100);
ArrayOut := CreateParam('Out',ptArray);
SetIsInput(ArrayOut,false);
end;
//////////////////////////////////////////////////////
// Main proc
//////////////////////////////////////////////////////
begin
SetLength(ArrayOut,8);
SetDataArrayValue(ArrayOut,0,in_1);
SetDataArrayValue(ArrayOut,1,in_2);
SetDataArrayValue(ArrayOut,2,in_3);
SetDataArrayValue(ArrayOut,3,in_4);
SetDataArrayValue(ArrayOut,4,in_5);
SetDataArrayValue(ArrayOut,5,in_6);
SetDataArrayValue(ArrayOut,6,in_7);
SetDataArrayValue(ArrayOut,7,in_8);
end.
2. "Array To Ctrls"
Code: Select all
// Array To Ctrls
// Vincent Michel
// 14-02-2007
//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var ArrayIn : Tparameter;
var out_1 : Tparameter;
var out_2 : Tparameter;
var out_3 : Tparameter;
var out_4 : Tparameter;
var out_5 : Tparameter;
var out_6 : Tparameter;
var out_7 : Tparameter;
var out_8 : Tparameter;
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin
ArrayIn := CreateParam('In',ptArray);
SetIsOutput(ArrayIn,false);
out_1 := CreateParam('MinPos',ptDatafader);
out_2 := CreateParam('MaxPos',ptDatafader);
out_3 := CreateParam('VSTi',ptDatafader);
out_4 := CreateParam('Preset',ptDatafader);
out_5 := CreateParam('Vol',ptDatafader);
out_6 := CreateParam('Pan',ptDatafader);
out_7 := CreateParam('Oct',ptDatafader);
out_8 := CreateParam('Velo',ptDatafader);
SetIsInput(out_1,false); SetMin(out_1,0); SetMax(out_1,127); SetSymbol(out_1,''); SetDefaultValue(out_1,0);
SetIsInput(out_2,false); SetMin(out_2,0); SetMax(out_2,127); SetSymbol(out_2,''); SetDefaultValue(out_2,127);
SetIsInput(out_3,false); SetMin(out_3,0); SetMax(out_3,16); SetSymbol(out_3,''); SetDefaultValue(out_3,0);
SetIsInput(out_4,false); SetMin(out_4,0); SetMax(out_4,127); SetSymbol(out_4,''); SetDefaultValue(out_4,0);
SetIsInput(out_5,false); SetMin(out_5,0); SetMax(out_5,127); SetSymbol(out_5,''); SetDefaultValue(out_5,48);
SetIsInput(out_6,false); SetMin(out_6,-100); SetMax(out_6,100); SetSymbol(out_6,' %'); SetDefaultValue(out_6,0);
SetIsInput(out_7,false); SetMin(out_7,-4); SetMax(out_7,4); SetSymbol(out_7,''); SetDefaultValue(out_7,0);
SetIsInput(out_8,false); SetMin(out_8,0); SetMax(out_8,200); SetSymbol(out_8,'%'); SetDefaultValue(out_8,100);
end;
//////////////////////////////////////////////////////
// Main proc
//////////////////////////////////////////////////////
begin
SetValue(out_1, GetDataArrayValue(ArrayIn,0));
SetValue(out_2, GetDataArrayValue(ArrayIn,1));
SetValue(out_3, GetDataArrayValue(ArrayIn,2));
SetValue(out_4, GetDataArrayValue(ArrayIn,3));
SetValue(out_5, GetDataArrayValue(ArrayIn,4));
SetValue(out_6, GetDataArrayValue(ArrayIn,5));
SetValue(out_7, GetDataArrayValue(ArrayIn,6));
SetValue(out_8, GetDataArrayValue(ArrayIn,7));
end.
Purpose:
On one side, I have 3 keyboard splits (or 2 or only one!).
On the other side, I have 8 instruments ( "" "" "" ).
From each split start values, including Midi data (min and max split range, Instrument Destination, # preset or PC, Lvl, Pan, velocity, and so on).
To each instrument (or non-plugin instruments) arrive many values, including of course MIDI data!
Can you imagine the way it looks? I'd bet that a spider lost itself.
So my idea was to "join" in an array whole groups of data, one array per keyboard split, then a central module-submodule-subsubmodule splits arrays, dispatch and then re-join arrays, this time one per instrument.
Well, just an idea. 'cause I can't do it!
Thanks to the doctor that tells me what's wrong in my code.
BTW:
bsork wrote:There are a couple of pitfalls in Usine that are easy to fall into... Many times I've wondered why more or less nothing happens when I edit some values in a patch. And of course; either the track or the the whole audio engine is off...
Oh yes... do we have sometimes the same bug?
bsork wrote:I've noticed however, that sometimes when I'm programming a patch I have to exit the edit mode, maybe choose another patch, and then go back into edit mode again, in order for the interface elements to be updated.
I've noticed those things... Many very small things that confuse the beginner I am!
Synchronize works OK for my quantized delay, as a matter of fact.