ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2006-09-29T10:33:30+02:00 https://brainmodular.com/forums/app.php/feed/topic/150 2006-09-29T10:33:30+02:00 2006-09-29T10:33:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=661#p661 <![CDATA[Selector and multiplexers]]>
and to runagate; hope you'll get your problems sorted out quickly.

Statistics: Posted by bsork — 29 Sep 2006, 10:33


]]>
2006-09-29T09:03:10+02:00 2006-09-29T09:03:10+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=660#p660 <![CDATA[Selector and multiplexers]]>
GetValue(src0+15)
You are right. Now I'm shure you understand the tricky script.
Faders created by ctrl-drag from the srcX inputs, can be scrolled with the mouse wheel outside of the min/max-values, but only in the module parameters panel.
yes, yes. you found the most absurd bug of the world...
When the srcX inputs get values above max, the outX sends zero values or some other inX value. I can't quite figure out any pattern in the behaviour; you,ll have to try it.
it's almost normal if you think about the order of the parameters.

Your script is perfect, and each value is evaluated any 8x8=64 cycles (about 100ms at 44100Hz) . In most situations it can be enough!

Statistics: Posted by senso — 29 Sep 2006, 09:03


]]>
2006-09-28T09:27:59+02:00 2006-09-28T09:27:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=659#p659 <![CDATA[Selector and multiplexers]]>
There are a couple of things with this method though:
1) Faders created by ctrl-drag from the srcX inputs, can be scrolled with the mouse wheel outside of the min/max-values, but only in the module parameters panel.
2) When the srcX inputs get values above max, the outX sends zero values or some other inX value. I can't quite figure out any pattern in the behaviour; you,ll have to try it.

The above two issues is not of any practical consequence for me since they're both connected to "illegal" values, so I continued with your version of the script to create an even CPU friendlier version, that only sends values at intervals. I ended up running the code every 8th time, and then only for one srcX at the time, and ended up with a CPU usage of (mostly) below 1%:

CODE:

// parametersVAR d1 &#58; Tparameter;VAR d2 &#58; Tparameter;VAR d3 &#58; Tparameter;VAR d4 &#58; Tparameter;VAR d5 &#58; Tparameter;VAR d6 &#58; Tparameter;VAR d7 &#58; Tparameter;VAR d8 &#58; Tparameter;VAR i1 &#58; Tparameter;VAR i2 &#58; Tparameter;VAR i3 &#58; Tparameter;VAR i4 &#58; Tparameter;VAR i5 &#58; Tparameter;VAR i6 &#58; Tparameter;VAR i7 &#58; Tparameter;VAR i8 &#58; Tparameter;VAR o1 &#58; Tparameter;VAR o2 &#58; Tparameter;VAR o3 &#58; Tparameter;VAR o4 &#58; Tparameter;VAR o5 &#58; Tparameter;VAR o6 &#58; Tparameter;VAR o7 &#58; Tparameter;VAR o8 &#58; Tparameter;var src1 &#58; integer;var src2 &#58; integer;var src3 &#58; integer;var src4 &#58; integer;var src5 &#58; integer;var src6 &#58; integer;var src7 &#58; integer;var src8 &#58; integer;CONST MAX_INPUTS = 8;// initialisationPROCEDURE init;BEGIN     d1 &#58;= CreateParam&#40;'src1', ptDataField&#41;;    SetIsOutput&#40;d1, FALSE&#41;; SetMin&#40;d1, 0&#41;; SetMax&#40;d1, MAX_INPUTS&#41;; SetFormat&#40;d1,'%.0f'&#41;; SetSymbol&#40;d1, ''&#41;;   d2 &#58;= CreateParam&#40;'src2', ptDataField&#41;;    SetIsOutput&#40;d2, FALSE&#41;; SetMin&#40;d2, 0&#41;; SetMax&#40;d2, MAX_INPUTS&#41;; SetFormat&#40;d2,'%.0f'&#41;; SetSymbol&#40;d2, ''&#41;;   d3 &#58;= CreateParam&#40;'src3', ptDataField&#41;;    SetIsOutput&#40;d3, FALSE&#41;; SetMin&#40;d3, 0&#41;; SetMax&#40;d3, MAX_INPUTS&#41;; SetFormat&#40;d3,'%.0f'&#41;; SetSymbol&#40;d3, ''&#41;;   d4 &#58;= CreateParam&#40;'src4', ptDataField&#41;;    SetIsOutput&#40;d4, FALSE&#41;; SetMin&#40;d4, 0&#41;; SetMax&#40;d4, MAX_INPUTS&#41;; SetFormat&#40;d4,'%.0f'&#41;; SetSymbol&#40;d4, ''&#41;;   d5 &#58;= CreateParam&#40;'src5', ptDataField&#41;;    SetIsOutput&#40;d5, FALSE&#41;; SetMin&#40;d5, 0&#41;; SetMax&#40;d5, MAX_INPUTS&#41;; SetFormat&#40;d5,'%.0f'&#41;; SetSymbol&#40;d5, ''&#41;;   d6 &#58;= CreateParam&#40;'src6', ptDataField&#41;;    SetIsOutput&#40;d6, FALSE&#41;; SetMin&#40;d6, 0&#41;; SetMax&#40;d6, MAX_INPUTS&#41;; SetFormat&#40;d6,'%.0f'&#41;; SetSymbol&#40;d6, ''&#41;;   d7 &#58;= CreateParam&#40;'src7', ptDataField&#41;;    SetIsOutput&#40;d7, FALSE&#41;; SetMin&#40;d7, 0&#41;; SetMax&#40;d7, MAX_INPUTS&#41;; SetFormat&#40;d7,'%.0f'&#41;; SetSymbol&#40;d7, ''&#41;;   d8 &#58;= CreateParam&#40;'src8', ptDataField&#41;;    SetIsOutput&#40;d8, FALSE&#41;; SetMin&#40;d8, 0&#41;; SetMax&#40;d8, MAX_INPUTS&#41;; SetFormat&#40;d8,'%.0f'&#41;; SetSymbol&#40;d8, ''&#41;;   i1 &#58;= CreateParam&#40;'in1', ptDataField&#41;; SetIsOutput&#40;i1, FALSE&#41;;   i2 &#58;= CreateParam&#40;'in2', ptDataField&#41;; SetIsOutput&#40;i2, FALSE&#41;;   i3 &#58;= CreateParam&#40;'in3', ptDataField&#41;; SetIsOutput&#40;i3, FALSE&#41;;   i4 &#58;= CreateParam&#40;'in4', ptDataField&#41;; SetIsOutput&#40;i4, FALSE&#41;;   i5 &#58;= CreateParam&#40;'in5', ptDataField&#41;; SetIsOutput&#40;i5, FALSE&#41;;   i6 &#58;= CreateParam&#40;'in6', ptDataField&#41;; SetIsOutput&#40;i6, FALSE&#41;;   i7 &#58;= CreateParam&#40;'in7', ptDataField&#41;; SetIsOutput&#40;i7, FALSE&#41;;   i8 &#58;= CreateParam&#40;'in8', ptDataField&#41;; SetIsOutput&#40;i8, FALSE&#41;;   o1 &#58;= CreateParam&#40;'out1', ptDataField&#41;; SetIsInput&#40;o1, FALSE&#41;;   o2 &#58;= CreateParam&#40;'out2', ptDataField&#41;; SetIsInput&#40;o2, FALSE&#41;;   o3 &#58;= CreateParam&#40;'out3', ptDataField&#41;; SetIsInput&#40;o3, FALSE&#41;;   o4 &#58;= CreateParam&#40;'out4', ptDataField&#41;; SetIsInput&#40;o4, FALSE&#41;;   o5 &#58;= CreateParam&#40;'out5', ptDataField&#41;; SetIsInput&#40;o5, FALSE&#41;;   o6 &#58;= CreateParam&#40;'out6', ptDataField&#41;; SetIsInput&#40;o6, FALSE&#41;;   o7 &#58;= CreateParam&#40;'out7', ptDataField&#41;; SetIsInput&#40;o7, FALSE&#41;;   o8 &#58;= CreateParam&#40;'out8', ptDataField&#41;; SetIsInput&#40;o8, FALSE&#41;;END;VAR i, j&#58; Integer;// MainBEGIN   i &#58;= i + 1;   IF &#40;&#40;i mod &#40;MAX_INPUTS&#41;&#41; = 0&#41; THEN   BEGIN     j &#58;= j + 1;     CASE &#40;j mod MAX_INPUTS&#41; OF       0 &#58; BEGIN j &#58;= 0; src1 &#58;= trunc&#40;GetValue&#40;d1&#41;&#41;; IF &#40;src1 > 0&#41; THEN SetValue&#40;o1, GetValue&#40;src1+MAX_INPUTS-1&#41;&#41;; EXIT; END       1 &#58; BEGIN src2 &#58;= trunc&#40;GetValue&#40;d2&#41;&#41;; IF &#40;src2 > 0&#41; THEN SetValue&#40;o2, GetValue&#40;src2+MAX_INPUTS-1&#41;&#41;; EXIT; END;       2 &#58; BEGIN src3 &#58;= trunc&#40;GetValue&#40;d3&#41;&#41;; IF &#40;src3 > 0&#41; THEN SetValue&#40;o3, GetValue&#40;src3+MAX_INPUTS-1&#41;&#41;; EXIT; END;       3 &#58; BEGIN src4 &#58;= trunc&#40;GetValue&#40;d4&#41;&#41;; IF &#40;src4 > 0&#41; THEN SetValue&#40;o4, GetValue&#40;src4+MAX_INPUTS-1&#41;&#41;; EXIT; END;       4 &#58; BEGIN src5 &#58;= trunc&#40;GetValue&#40;d5&#41;&#41;; IF &#40;src5 > 0&#41; THEN SetValue&#40;o5, GetValue&#40;src5+MAX_INPUTS-1&#41;&#41;; EXIT; END;       5 &#58; BEGIN src6 &#58;= trunc&#40;GetValue&#40;d6&#41;&#41;; IF &#40;src6 > 0&#41; THEN SetValue&#40;o6, GetValue&#40;src6+MAX_INPUTS-1&#41;&#41;; EXIT; END;       6 &#58; BEGIN src7 &#58;= trunc&#40;GetValue&#40;d7&#41;&#41;; IF &#40;src7 > 0&#41; THEN SetValue&#40;o7, GetValue&#40;src7+MAX_INPUTS-1&#41;&#41;; EXIT; END;       7 &#58; BEGIN src8 &#58;= trunc&#40;GetValue&#40;d8&#41;&#41;; IF &#40;src8 > 0&#41; THEN SetValue&#40;o8, GetValue&#40;src8+MAX_INPUTS-1&#41;&#41;; EXIT; END;      END;      i &#58;= 0;   END;END.

Statistics: Posted by bsork — 28 Sep 2006, 09:27


]]>
2006-09-28T08:54:12+02:00 2006-09-28T08:54:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=658#p658 <![CDATA[Selector and multiplexers]]>
The script is designed for very specific use but I want to keep Usine as intuitive as possible. The most interesting is the way you produce music with it!
I was also thinking that scripts in designed to handle control messages and not audio, it would be acceptable to "thin" out the execution, and eg run the code just for Nth calls to the script
You are right bsork, in some situations it can be enough to run the script every 10,20, cycles respectively to 15, 30 ms.

about the tricky code getvalue(src0+7)....

when you use the writeln(inttostr(i1)) code, you obtain
i1=8
i2=9
because i1 and i2 are integer in order of the declaration bloc.

now the expanded code is

src0 := getValue(d1) ;
if src0=0 then nothing
if src0 = 1 then SetValue(o1, i1);
if src0 = 2 then SetValue(o1, i2);
...
but if you think that i1 = 8 and i2=9 you can replace above

if src0 = 1 then SetValue(o1, 8);
if src0 = 2 then SetValue(o1, 9);
...


if src0 = 1 then SetValue(o1, src0+7);
if src0 = 2 then SetValue(o1, src0+7);

almost the same line...

finally,
if src0<>0 then then SetValue(o1, src0+7);

I know that it's a hard programming tip!

Statistics: Posted by senso — 28 Sep 2006, 08:54


]]>
2006-09-28T05:31:20+02:00 2006-09-28T05:31:20+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=657#p657 <![CDATA[Selector and multiplexers]]>

I'd be much further into understanding (and using) Usine had my soundcard not chosen this time to have an apparently unsolvable problem.

What I can accomplish leaves me very, very impressed still.

Hopefully I'll become very active on the forums here as I imagine the more details discussed amongst users the easier it'll be for the next new people.

Statistics: Posted by runagate — 28 Sep 2006, 05:31


]]>
2006-09-27T14:46:15+02:00 2006-09-27T14:46:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=656#p656 <![CDATA[Selector and multiplexers]]>
I was also thinking that scripts in designed to handle control messages and not audio, it would be acceptable to "thin" out the execution, and eg run the code just for Nth calls to the script, something I'm going to try out on this one.

Statistics: Posted by bsork — 27 Sep 2006, 14:46


]]>
2006-09-27T13:31:04+02:00 2006-09-27T13:31:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=655#p655 <![CDATA[Selector and multiplexers]]> It can be use to create complex patches, Ie: counters, midi handlers, witch are hard to built with normal modules.

Especially, boolean evaluations like:
If (input1)
and (not input2)
or ((input1> 45) and (input2>input1)
then ...
is easy to calulate in a script.

I have just impemented the 'Dispatcher' module (1 in -> 8 out), witch is the inverse of the selector.
Contrary as I said to Lalo, the actual version of the selector doesn't work with audio. Now, it works.
Next release.

You'll find bellow, another version of the matrix script witch is 25% faster on my system (CPU 3% instead CPU 4%).

PS: In the next version of Usine, script engine will be 2 times faster.


The improvements are:

1) if you specify a min or a max value, you don't need to verify bounds, because in Usine, a value can't be out of range.
so
IF (src[5] > 0) AND (src[5] <= MAX_INPUTS) THEN
can be replaced by
IF (src[5] > 0) THEN
2) variables are faster than array.
src[N] is replaced by src1, src2, etc...

3) the Tparameter type is, in fact, Integer, witch is the order of declaration. So you can make additions to assign the input, like: GetValue(src0+7). I know it's tricky...



// parameters
VAR d1 : Tparameter;
VAR d2 : Tparameter;
VAR d3 : Tparameter;
VAR d4 : Tparameter;
VAR d5 : Tparameter;
VAR d6 : Tparameter;
VAR d7 : Tparameter;
VAR d8 : Tparameter;

VAR i1 : Tparameter;
VAR i2 : Tparameter;
VAR i3 : Tparameter;
VAR i4 : Tparameter;
VAR i5 : Tparameter;
VAR i6 : Tparameter;
VAR i7 : Tparameter;
VAR i8 : Tparameter;

VAR o1 : Tparameter;
VAR o2 : Tparameter;
VAR o3 : Tparameter;
VAR o4 : Tparameter;
VAR o5 : Tparameter;
VAR o6 : Tparameter;
VAR o7 : Tparameter;
VAR o8 : Tparameter;

var src0:integer;
var src1:integer;
var src2:integer;
var src3:integer;
var src4:integer;
var src5:integer;
var src6:integer;
var src7:integer;

CONST MAX_INPUTS = 8;

// initialisation
PROCEDURE init;
BEGIN
d1 := CreateParam('src1', ptDataField); SetIsOutput(d1, FALSE); SetMin(d1, 0); SetMax(d1, MAX_INPUTS); SetFormat(d1,'%.0f');
d2 := CreateParam('src2', ptDataField); SetIsOutput(d2, FALSE); SetMin(d2, 0); SetMax(d2, MAX_INPUTS); SetFormat(d2,'%.0f');
d3 := CreateParam('src3', ptDataField); SetIsOutput(d3, FALSE); SetMin(d3, 0); SetMax(d3, MAX_INPUTS); SetFormat(d3,'%.0f');
d4 := CreateParam('src4', ptDataField); SetIsOutput(d4, FALSE); SetMin(d4, 0); SetMax(d4, MAX_INPUTS); SetFormat(d4,'%.0f');
d5 := CreateParam('src5', ptDataField); SetIsOutput(d5, FALSE); SetMin(d5, 0); SetMax(d5, MAX_INPUTS); SetFormat(d5,'%.0f');
d6 := CreateParam('src6', ptDataField); SetIsOutput(d6, FALSE); SetMin(d6, 0); SetMax(d6, MAX_INPUTS); SetFormat(d6,'%.0f');
d7 := CreateParam('src7', ptDataField); SetIsOutput(d7, FALSE); SetMin(d7, 0); SetMax(d7, MAX_INPUTS); SetFormat(d7,'%.0f');
d8 := CreateParam('src8', ptDataField); SetIsOutput(d8, FALSE); SetMin(d8, 0); SetMax(d8, MAX_INPUTS); SetFormat(d8,'%.0f');

i1 := CreateParam('in1', ptDataField); SetIsOutput(i1, FALSE);
i2 := CreateParam('in2', ptDataField); SetIsOutput(i2, FALSE);
i3 := CreateParam('in3', ptDataField); SetIsOutput(i3, FALSE);
i4 := CreateParam('in4', ptDataField); SetIsOutput(i4, FALSE);
i5 := CreateParam('in5', ptDataField); SetIsOutput(i5, FALSE);
i6 := CreateParam('in6', ptDataField); SetIsOutput(i6, FALSE);
i7 := CreateParam('in7', ptDataField); SetIsOutput(i7, FALSE);
i8 := CreateParam('in8', ptDataField); SetIsOutput(i8, FALSE);

o1 := CreateParam('out1', ptDataField); SetIsInput(o1, FALSE);
o2 := CreateParam('out2', ptDataField); SetIsInput(o2, FALSE);
o3 := CreateParam('out3', ptDataField); SetIsInput(o3, FALSE);
o4 := CreateParam('out4', ptDataField); SetIsInput(o4, FALSE);
o5 := CreateParam('out5', ptDataField); SetIsInput(o5, FALSE);
o6 := CreateParam('out6', ptDataField); SetIsInput(o6, FALSE);
o7 := CreateParam('out7', ptDataField); SetIsInput(o7, FALSE);
o8 := CreateParam('out8', ptDataField); SetIsInput(o8, FALSE);

END;



// Main
BEGIN
src0 := trunc(GetValue(d1));
src1 := trunc(GetValue(d2));
src2 := trunc(GetValue(d3));
src3 := trunc(GetValue(d4));
src4 := trunc(GetValue(d5));
src5 := trunc(GetValue(d6));
src6 := trunc(GetValue(d7));
src7 := trunc(GetValue(d8));

IF (src0 > 0) THEN
SetValue(o1, GetValue(src0+7));
IF (src1 > 0) THEN
SetValue(o2, GetValue(src1+7));
IF (src2 > 0) THEN
SetValue(o3, GetValue(src2+7));
IF (src3 > 0) THEN
SetValue(o4, GetValue(src3+7));
IF (src4 > 0) THEN
SetValue(o5, GetValue(src4+7));
IF (src5 > 0) THEN
SetValue(o6, GetValue(src5+7));
IF (src6 > 0) THEN
SetValue(o7, GetValue(src6+7));
IF (src7 > 0) THEN
SetValue(o8, GetValue(src7+7));
END.

Statistics: Posted by senso — 27 Sep 2006, 13:31


]]>
2006-09-27T11:54:08+02:00 2006-09-27T11:54:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=654#p654 <![CDATA[Selector and multiplexers]]>
As you can see earlier in the post, if a matrix is what're you looking for, it's quite easy to create a patch using as many data/selectors as you need outputs. A bit tiresome connecting all the wires from the 8 data sources to the 8 first inputs on the selectors (8*8=64 wires+wires to the destinations), but you'll be done in 10 minutes or so I guess.

Personally I haven't found much use for such a multiplexer thing, it's just an exercise in using the script module. I have gotten an idea to lower the CPU drain though, that I maybe try to code tonight.

Statistics: Posted by bsork — 27 Sep 2006, 11:54


]]>
2006-09-27T11:29:39+02:00 2006-09-27T11:29:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=653#p653 <![CDATA[Selector and multiplexers]]> Bug fixed, now available for download

Statistics: Posted by senso — 27 Sep 2006, 11:29


]]>
2006-09-27T10:51:15+02:00 2006-09-27T10:51:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=652#p652 <![CDATA[Selector and multiplexers]]>
It is a great idea, though, the answer to exactly what I need right as I'm learning to use Usine.

And congrats - it appears that yours is the first add-on by anyone other than Uso.

I'd like to think I'll eventually be posting up add-ons, too, once I am experienced with this lovely program.

Statistics: Posted by runagate — 27 Sep 2006, 10:51


]]>
2006-09-26T20:34:12+02:00 2006-09-26T20:34:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=650#p650 <![CDATA[Selector and multiplexers]]> your script is very good. Of course I can give you some tips to improve the speed. I'll do that very soon.

Some of my MIDI scripts are complicated but if you look carefully, you can see that they don't do anything, most of time. The calculation is done only when MIDI events are received, and in fact it's very rare. Remember that the script calculation appears about 1000 times per seconds. Even if you play a Chopin sonata, less than 20 MIDI events arrive per seconds.

In you patch, 1000 time per second your script does:
- 16 assignations to variables or arrays
- 16 boolean evaluations.
- 8 out assignation
Hard job for the CPU...

I'm working on a CPU friend version of scripts. Not so easy but not impossible!

The % is the default value when no symbol is specified. Maybe it's not a good idea...I'll chek that point.
Actually, if you dont want any symbol, use the setSymbol procedure with an ' ' (space bar) in the initialization bloc.

Statistics: Posted by senso — 26 Sep 2006, 20:34


]]>
2006-09-26T08:45:23+02:00 2006-09-26T08:45:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=649#p649 <![CDATA[Selector and multiplexers]]>
I also took a look at how much your MIDI delay etc patch used when idle (not sending any MIDI data through it), and it varied between 2% and 2.5%, even though that patch includes two scripts which both are more complicated than mine. Could it be that the big difference is there because mine contains so many in/out-parameters?

For the record, I also created a normal patch using 8 selectors that actually does exactly the same as the script, and it used between 0.5% and 0.7% with a spike or two at 1.2%...

Please don't spend time figuring out how my script can be improved as such, unless you think I've done something in a very impractical or inefficient way. I have no need for it - it used it just as an exercise - but maybe you can use it to check what can be improved in the script module. And please remove it from the Add-ons...

I also noticed a minor bug: The faders connected to the script (whose in- and output don't have any defined symbols) looked ok when created using ctrl-drag, but when reloaded after a restart of Usine, a '%' sign had been added after the value.

Statistics: Posted by bsork — 26 Sep 2006, 08:45


]]>
2006-09-25T13:58:19+02:00 2006-09-25T13:58:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=647#p647 <![CDATA[Selector and multiplexers]]>
I might even try to make a similar patch using 8 selectors just to make a comparison of the CPU usage.

Even if the scripts are slow and heavy on the CPU, I still find this to be a great addition to Usine, and some problems I've had creating patches with the "normal" modules should be gone now. (The problems may arise because I'm more used to writing lines of program code than connecting small boxes...)

Statistics: Posted by bsork — 25 Sep 2006, 13:58


]]>
2006-09-25T12:04:53+02:00 2006-09-25T12:04:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=646#p646 <![CDATA[Selector and multiplexers]]> it's interesting. You can post you scrip in the add-ons section. I'll take a look, if you want.
I know that the script language is very slow, and request a lot of CPU (too much...).
Actually, the script is not suitable for audio process, (only for data's or Midi calculation).

I'm working on.

Statistics: Posted by senso — 25 Sep 2006, 12:04


]]>
2006-09-25T08:47:55+02:00 2006-09-25T08:47:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=645#p645 <![CDATA[Selector and multiplexers]]>
This is my first attempt at writing a Usine script, so I'm sure I can make this little program a bit better. The CPU usage (according to the new and for me very welcome display in the upper rigth corner of the patch design window) was a bit high for my taste considering the simple code involved. However, I don't quite see any practical situation where I really would need to use as many as 8 inputs and 8 outputs. but it's much faster to delete than add some lines of code...

Statistics: Posted by bsork — 25 Sep 2006, 08:47


]]>
2006-09-20T11:22:33+02:00 2006-09-20T11:22:33+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=630#p630 <![CDATA[Selector and multiplexers]]> Statistics: Posted by senso — 20 Sep 2006, 11:22


]]>
2006-09-20T09:08:39+02:00 2006-09-20T09:08:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=629#p629 <![CDATA[Selector and multiplexers]]> Statistics: Posted by lalo — 20 Sep 2006, 09:08


]]>
2006-09-20T08:34:37+02:00 2006-09-20T08:34:37+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=628#p628 <![CDATA[Selector and multiplexers]]>
select multiple sources to 1 output
already exists: It's the data/selector.

The
multiple outputs from 1 source
module will arrive soon, with a set of new objects.
If you are impatient, you can easilly create a subpatch witch do that (for few outputs).

Statistics: Posted by senso — 20 Sep 2006, 08:34


]]>
2006-09-19T17:01:51+02:00 2006-09-19T17:01:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=623#p623 <![CDATA[Selector and multiplexers]]> would be nice to have selectors and multiplexers...

to select multiple sources to 1 output
or multiple outputs from 1 source

Statistics: Posted by lalo — 19 Sep 2006, 17:01


]]>
BrainModular BrainModular Users Forum 2006-09-29T10:33:30+02:00 https://brainmodular.com/forums/app.php/feed/topic/150 2006-09-29T10:33:30+02:00 2006-09-29T10:33:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=661#p661 <![CDATA[Selector and multiplexers]]>
and to runagate; hope you'll get your problems sorted out quickly.

Statistics: Posted by bsork — 29 Sep 2006, 10:33


]]>
2006-09-29T09:03:10+02:00 2006-09-29T09:03:10+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=660#p660 <![CDATA[Selector and multiplexers]]>
GetValue(src0+15)
You are right. Now I'm shure you understand the tricky script.
Faders created by ctrl-drag from the srcX inputs, can be scrolled with the mouse wheel outside of the min/max-values, but only in the module parameters panel.
yes, yes. you found the most absurd bug of the world...
When the srcX inputs get values above max, the outX sends zero values or some other inX value. I can't quite figure out any pattern in the behaviour; you,ll have to try it.
it's almost normal if you think about the order of the parameters.

Your script is perfect, and each value is evaluated any 8x8=64 cycles (about 100ms at 44100Hz) . In most situations it can be enough!

Statistics: Posted by senso — 29 Sep 2006, 09:03


]]>
2006-09-28T09:27:59+02:00 2006-09-28T09:27:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=659#p659 <![CDATA[Selector and multiplexers]]>
There are a couple of things with this method though:
1) Faders created by ctrl-drag from the srcX inputs, can be scrolled with the mouse wheel outside of the min/max-values, but only in the module parameters panel.
2) When the srcX inputs get values above max, the outX sends zero values or some other inX value. I can't quite figure out any pattern in the behaviour; you,ll have to try it.

The above two issues is not of any practical consequence for me since they're both connected to "illegal" values, so I continued with your version of the script to create an even CPU friendlier version, that only sends values at intervals. I ended up running the code every 8th time, and then only for one srcX at the time, and ended up with a CPU usage of (mostly) below 1%:

CODE:

// parametersVAR d1 &#58; Tparameter;VAR d2 &#58; Tparameter;VAR d3 &#58; Tparameter;VAR d4 &#58; Tparameter;VAR d5 &#58; Tparameter;VAR d6 &#58; Tparameter;VAR d7 &#58; Tparameter;VAR d8 &#58; Tparameter;VAR i1 &#58; Tparameter;VAR i2 &#58; Tparameter;VAR i3 &#58; Tparameter;VAR i4 &#58; Tparameter;VAR i5 &#58; Tparameter;VAR i6 &#58; Tparameter;VAR i7 &#58; Tparameter;VAR i8 &#58; Tparameter;VAR o1 &#58; Tparameter;VAR o2 &#58; Tparameter;VAR o3 &#58; Tparameter;VAR o4 &#58; Tparameter;VAR o5 &#58; Tparameter;VAR o6 &#58; Tparameter;VAR o7 &#58; Tparameter;VAR o8 &#58; Tparameter;var src1 &#58; integer;var src2 &#58; integer;var src3 &#58; integer;var src4 &#58; integer;var src5 &#58; integer;var src6 &#58; integer;var src7 &#58; integer;var src8 &#58; integer;CONST MAX_INPUTS = 8;// initialisationPROCEDURE init;BEGIN     d1 &#58;= CreateParam&#40;'src1', ptDataField&#41;;    SetIsOutput&#40;d1, FALSE&#41;; SetMin&#40;d1, 0&#41;; SetMax&#40;d1, MAX_INPUTS&#41;; SetFormat&#40;d1,'%.0f'&#41;; SetSymbol&#40;d1, ''&#41;;   d2 &#58;= CreateParam&#40;'src2', ptDataField&#41;;    SetIsOutput&#40;d2, FALSE&#41;; SetMin&#40;d2, 0&#41;; SetMax&#40;d2, MAX_INPUTS&#41;; SetFormat&#40;d2,'%.0f'&#41;; SetSymbol&#40;d2, ''&#41;;   d3 &#58;= CreateParam&#40;'src3', ptDataField&#41;;    SetIsOutput&#40;d3, FALSE&#41;; SetMin&#40;d3, 0&#41;; SetMax&#40;d3, MAX_INPUTS&#41;; SetFormat&#40;d3,'%.0f'&#41;; SetSymbol&#40;d3, ''&#41;;   d4 &#58;= CreateParam&#40;'src4', ptDataField&#41;;    SetIsOutput&#40;d4, FALSE&#41;; SetMin&#40;d4, 0&#41;; SetMax&#40;d4, MAX_INPUTS&#41;; SetFormat&#40;d4,'%.0f'&#41;; SetSymbol&#40;d4, ''&#41;;   d5 &#58;= CreateParam&#40;'src5', ptDataField&#41;;    SetIsOutput&#40;d5, FALSE&#41;; SetMin&#40;d5, 0&#41;; SetMax&#40;d5, MAX_INPUTS&#41;; SetFormat&#40;d5,'%.0f'&#41;; SetSymbol&#40;d5, ''&#41;;   d6 &#58;= CreateParam&#40;'src6', ptDataField&#41;;    SetIsOutput&#40;d6, FALSE&#41;; SetMin&#40;d6, 0&#41;; SetMax&#40;d6, MAX_INPUTS&#41;; SetFormat&#40;d6,'%.0f'&#41;; SetSymbol&#40;d6, ''&#41;;   d7 &#58;= CreateParam&#40;'src7', ptDataField&#41;;    SetIsOutput&#40;d7, FALSE&#41;; SetMin&#40;d7, 0&#41;; SetMax&#40;d7, MAX_INPUTS&#41;; SetFormat&#40;d7,'%.0f'&#41;; SetSymbol&#40;d7, ''&#41;;   d8 &#58;= CreateParam&#40;'src8', ptDataField&#41;;    SetIsOutput&#40;d8, FALSE&#41;; SetMin&#40;d8, 0&#41;; SetMax&#40;d8, MAX_INPUTS&#41;; SetFormat&#40;d8,'%.0f'&#41;; SetSymbol&#40;d8, ''&#41;;   i1 &#58;= CreateParam&#40;'in1', ptDataField&#41;; SetIsOutput&#40;i1, FALSE&#41;;   i2 &#58;= CreateParam&#40;'in2', ptDataField&#41;; SetIsOutput&#40;i2, FALSE&#41;;   i3 &#58;= CreateParam&#40;'in3', ptDataField&#41;; SetIsOutput&#40;i3, FALSE&#41;;   i4 &#58;= CreateParam&#40;'in4', ptDataField&#41;; SetIsOutput&#40;i4, FALSE&#41;;   i5 &#58;= CreateParam&#40;'in5', ptDataField&#41;; SetIsOutput&#40;i5, FALSE&#41;;   i6 &#58;= CreateParam&#40;'in6', ptDataField&#41;; SetIsOutput&#40;i6, FALSE&#41;;   i7 &#58;= CreateParam&#40;'in7', ptDataField&#41;; SetIsOutput&#40;i7, FALSE&#41;;   i8 &#58;= CreateParam&#40;'in8', ptDataField&#41;; SetIsOutput&#40;i8, FALSE&#41;;   o1 &#58;= CreateParam&#40;'out1', ptDataField&#41;; SetIsInput&#40;o1, FALSE&#41;;   o2 &#58;= CreateParam&#40;'out2', ptDataField&#41;; SetIsInput&#40;o2, FALSE&#41;;   o3 &#58;= CreateParam&#40;'out3', ptDataField&#41;; SetIsInput&#40;o3, FALSE&#41;;   o4 &#58;= CreateParam&#40;'out4', ptDataField&#41;; SetIsInput&#40;o4, FALSE&#41;;   o5 &#58;= CreateParam&#40;'out5', ptDataField&#41;; SetIsInput&#40;o5, FALSE&#41;;   o6 &#58;= CreateParam&#40;'out6', ptDataField&#41;; SetIsInput&#40;o6, FALSE&#41;;   o7 &#58;= CreateParam&#40;'out7', ptDataField&#41;; SetIsInput&#40;o7, FALSE&#41;;   o8 &#58;= CreateParam&#40;'out8', ptDataField&#41;; SetIsInput&#40;o8, FALSE&#41;;END;VAR i, j&#58; Integer;// MainBEGIN   i &#58;= i + 1;   IF &#40;&#40;i mod &#40;MAX_INPUTS&#41;&#41; = 0&#41; THEN   BEGIN     j &#58;= j + 1;     CASE &#40;j mod MAX_INPUTS&#41; OF       0 &#58; BEGIN j &#58;= 0; src1 &#58;= trunc&#40;GetValue&#40;d1&#41;&#41;; IF &#40;src1 > 0&#41; THEN SetValue&#40;o1, GetValue&#40;src1+MAX_INPUTS-1&#41;&#41;; EXIT; END       1 &#58; BEGIN src2 &#58;= trunc&#40;GetValue&#40;d2&#41;&#41;; IF &#40;src2 > 0&#41; THEN SetValue&#40;o2, GetValue&#40;src2+MAX_INPUTS-1&#41;&#41;; EXIT; END;       2 &#58; BEGIN src3 &#58;= trunc&#40;GetValue&#40;d3&#41;&#41;; IF &#40;src3 > 0&#41; THEN SetValue&#40;o3, GetValue&#40;src3+MAX_INPUTS-1&#41;&#41;; EXIT; END;       3 &#58; BEGIN src4 &#58;= trunc&#40;GetValue&#40;d4&#41;&#41;; IF &#40;src4 > 0&#41; THEN SetValue&#40;o4, GetValue&#40;src4+MAX_INPUTS-1&#41;&#41;; EXIT; END;       4 &#58; BEGIN src5 &#58;= trunc&#40;GetValue&#40;d5&#41;&#41;; IF &#40;src5 > 0&#41; THEN SetValue&#40;o5, GetValue&#40;src5+MAX_INPUTS-1&#41;&#41;; EXIT; END;       5 &#58; BEGIN src6 &#58;= trunc&#40;GetValue&#40;d6&#41;&#41;; IF &#40;src6 > 0&#41; THEN SetValue&#40;o6, GetValue&#40;src6+MAX_INPUTS-1&#41;&#41;; EXIT; END;       6 &#58; BEGIN src7 &#58;= trunc&#40;GetValue&#40;d7&#41;&#41;; IF &#40;src7 > 0&#41; THEN SetValue&#40;o7, GetValue&#40;src7+MAX_INPUTS-1&#41;&#41;; EXIT; END;       7 &#58; BEGIN src8 &#58;= trunc&#40;GetValue&#40;d8&#41;&#41;; IF &#40;src8 > 0&#41; THEN SetValue&#40;o8, GetValue&#40;src8+MAX_INPUTS-1&#41;&#41;; EXIT; END;      END;      i &#58;= 0;   END;END.

Statistics: Posted by bsork — 28 Sep 2006, 09:27


]]>
2006-09-28T08:54:12+02:00 2006-09-28T08:54:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=658#p658 <![CDATA[Selector and multiplexers]]>
The script is designed for very specific use but I want to keep Usine as intuitive as possible. The most interesting is the way you produce music with it!
I was also thinking that scripts in designed to handle control messages and not audio, it would be acceptable to "thin" out the execution, and eg run the code just for Nth calls to the script
You are right bsork, in some situations it can be enough to run the script every 10,20, cycles respectively to 15, 30 ms.

about the tricky code getvalue(src0+7)....

when you use the writeln(inttostr(i1)) code, you obtain
i1=8
i2=9
because i1 and i2 are integer in order of the declaration bloc.

now the expanded code is

src0 := getValue(d1) ;
if src0=0 then nothing
if src0 = 1 then SetValue(o1, i1);
if src0 = 2 then SetValue(o1, i2);
...
but if you think that i1 = 8 and i2=9 you can replace above

if src0 = 1 then SetValue(o1, 8);
if src0 = 2 then SetValue(o1, 9);
...


if src0 = 1 then SetValue(o1, src0+7);
if src0 = 2 then SetValue(o1, src0+7);

almost the same line...

finally,
if src0<>0 then then SetValue(o1, src0+7);

I know that it's a hard programming tip!

Statistics: Posted by senso — 28 Sep 2006, 08:54


]]>
2006-09-28T05:31:20+02:00 2006-09-28T05:31:20+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=657#p657 <![CDATA[Selector and multiplexers]]>

I'd be much further into understanding (and using) Usine had my soundcard not chosen this time to have an apparently unsolvable problem.

What I can accomplish leaves me very, very impressed still.

Hopefully I'll become very active on the forums here as I imagine the more details discussed amongst users the easier it'll be for the next new people.

Statistics: Posted by runagate — 28 Sep 2006, 05:31


]]>
2006-09-27T14:46:15+02:00 2006-09-27T14:46:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=656#p656 <![CDATA[Selector and multiplexers]]>
I was also thinking that scripts in designed to handle control messages and not audio, it would be acceptable to "thin" out the execution, and eg run the code just for Nth calls to the script, something I'm going to try out on this one.

Statistics: Posted by bsork — 27 Sep 2006, 14:46


]]>
2006-09-27T13:31:04+02:00 2006-09-27T13:31:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=655#p655 <![CDATA[Selector and multiplexers]]> It can be use to create complex patches, Ie: counters, midi handlers, witch are hard to built with normal modules.

Especially, boolean evaluations like:
If (input1)
and (not input2)
or ((input1> 45) and (input2>input1)
then ...
is easy to calulate in a script.

I have just impemented the 'Dispatcher' module (1 in -> 8 out), witch is the inverse of the selector.
Contrary as I said to Lalo, the actual version of the selector doesn't work with audio. Now, it works.
Next release.

You'll find bellow, another version of the matrix script witch is 25% faster on my system (CPU 3% instead CPU 4%).

PS: In the next version of Usine, script engine will be 2 times faster.


The improvements are:

1) if you specify a min or a max value, you don't need to verify bounds, because in Usine, a value can't be out of range.
so
IF (src[5] > 0) AND (src[5] <= MAX_INPUTS) THEN
can be replaced by
IF (src[5] > 0) THEN
2) variables are faster than array.
src[N] is replaced by src1, src2, etc...

3) the Tparameter type is, in fact, Integer, witch is the order of declaration. So you can make additions to assign the input, like: GetValue(src0+7). I know it's tricky...



// parameters
VAR d1 : Tparameter;
VAR d2 : Tparameter;
VAR d3 : Tparameter;
VAR d4 : Tparameter;
VAR d5 : Tparameter;
VAR d6 : Tparameter;
VAR d7 : Tparameter;
VAR d8 : Tparameter;

VAR i1 : Tparameter;
VAR i2 : Tparameter;
VAR i3 : Tparameter;
VAR i4 : Tparameter;
VAR i5 : Tparameter;
VAR i6 : Tparameter;
VAR i7 : Tparameter;
VAR i8 : Tparameter;

VAR o1 : Tparameter;
VAR o2 : Tparameter;
VAR o3 : Tparameter;
VAR o4 : Tparameter;
VAR o5 : Tparameter;
VAR o6 : Tparameter;
VAR o7 : Tparameter;
VAR o8 : Tparameter;

var src0:integer;
var src1:integer;
var src2:integer;
var src3:integer;
var src4:integer;
var src5:integer;
var src6:integer;
var src7:integer;

CONST MAX_INPUTS = 8;

// initialisation
PROCEDURE init;
BEGIN
d1 := CreateParam('src1', ptDataField); SetIsOutput(d1, FALSE); SetMin(d1, 0); SetMax(d1, MAX_INPUTS); SetFormat(d1,'%.0f');
d2 := CreateParam('src2', ptDataField); SetIsOutput(d2, FALSE); SetMin(d2, 0); SetMax(d2, MAX_INPUTS); SetFormat(d2,'%.0f');
d3 := CreateParam('src3', ptDataField); SetIsOutput(d3, FALSE); SetMin(d3, 0); SetMax(d3, MAX_INPUTS); SetFormat(d3,'%.0f');
d4 := CreateParam('src4', ptDataField); SetIsOutput(d4, FALSE); SetMin(d4, 0); SetMax(d4, MAX_INPUTS); SetFormat(d4,'%.0f');
d5 := CreateParam('src5', ptDataField); SetIsOutput(d5, FALSE); SetMin(d5, 0); SetMax(d5, MAX_INPUTS); SetFormat(d5,'%.0f');
d6 := CreateParam('src6', ptDataField); SetIsOutput(d6, FALSE); SetMin(d6, 0); SetMax(d6, MAX_INPUTS); SetFormat(d6,'%.0f');
d7 := CreateParam('src7', ptDataField); SetIsOutput(d7, FALSE); SetMin(d7, 0); SetMax(d7, MAX_INPUTS); SetFormat(d7,'%.0f');
d8 := CreateParam('src8', ptDataField); SetIsOutput(d8, FALSE); SetMin(d8, 0); SetMax(d8, MAX_INPUTS); SetFormat(d8,'%.0f');

i1 := CreateParam('in1', ptDataField); SetIsOutput(i1, FALSE);
i2 := CreateParam('in2', ptDataField); SetIsOutput(i2, FALSE);
i3 := CreateParam('in3', ptDataField); SetIsOutput(i3, FALSE);
i4 := CreateParam('in4', ptDataField); SetIsOutput(i4, FALSE);
i5 := CreateParam('in5', ptDataField); SetIsOutput(i5, FALSE);
i6 := CreateParam('in6', ptDataField); SetIsOutput(i6, FALSE);
i7 := CreateParam('in7', ptDataField); SetIsOutput(i7, FALSE);
i8 := CreateParam('in8', ptDataField); SetIsOutput(i8, FALSE);

o1 := CreateParam('out1', ptDataField); SetIsInput(o1, FALSE);
o2 := CreateParam('out2', ptDataField); SetIsInput(o2, FALSE);
o3 := CreateParam('out3', ptDataField); SetIsInput(o3, FALSE);
o4 := CreateParam('out4', ptDataField); SetIsInput(o4, FALSE);
o5 := CreateParam('out5', ptDataField); SetIsInput(o5, FALSE);
o6 := CreateParam('out6', ptDataField); SetIsInput(o6, FALSE);
o7 := CreateParam('out7', ptDataField); SetIsInput(o7, FALSE);
o8 := CreateParam('out8', ptDataField); SetIsInput(o8, FALSE);

END;



// Main
BEGIN
src0 := trunc(GetValue(d1));
src1 := trunc(GetValue(d2));
src2 := trunc(GetValue(d3));
src3 := trunc(GetValue(d4));
src4 := trunc(GetValue(d5));
src5 := trunc(GetValue(d6));
src6 := trunc(GetValue(d7));
src7 := trunc(GetValue(d8));

IF (src0 > 0) THEN
SetValue(o1, GetValue(src0+7));
IF (src1 > 0) THEN
SetValue(o2, GetValue(src1+7));
IF (src2 > 0) THEN
SetValue(o3, GetValue(src2+7));
IF (src3 > 0) THEN
SetValue(o4, GetValue(src3+7));
IF (src4 > 0) THEN
SetValue(o5, GetValue(src4+7));
IF (src5 > 0) THEN
SetValue(o6, GetValue(src5+7));
IF (src6 > 0) THEN
SetValue(o7, GetValue(src6+7));
IF (src7 > 0) THEN
SetValue(o8, GetValue(src7+7));
END.

Statistics: Posted by senso — 27 Sep 2006, 13:31


]]>
2006-09-27T11:54:08+02:00 2006-09-27T11:54:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=654#p654 <![CDATA[Selector and multiplexers]]>
As you can see earlier in the post, if a matrix is what're you looking for, it's quite easy to create a patch using as many data/selectors as you need outputs. A bit tiresome connecting all the wires from the 8 data sources to the 8 first inputs on the selectors (8*8=64 wires+wires to the destinations), but you'll be done in 10 minutes or so I guess.

Personally I haven't found much use for such a multiplexer thing, it's just an exercise in using the script module. I have gotten an idea to lower the CPU drain though, that I maybe try to code tonight.

Statistics: Posted by bsork — 27 Sep 2006, 11:54


]]>
2006-09-27T11:29:39+02:00 2006-09-27T11:29:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=653#p653 <![CDATA[Selector and multiplexers]]> Bug fixed, now available for download

Statistics: Posted by senso — 27 Sep 2006, 11:29


]]>
2006-09-27T10:51:15+02:00 2006-09-27T10:51:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=652#p652 <![CDATA[Selector and multiplexers]]>
It is a great idea, though, the answer to exactly what I need right as I'm learning to use Usine.

And congrats - it appears that yours is the first add-on by anyone other than Uso.

I'd like to think I'll eventually be posting up add-ons, too, once I am experienced with this lovely program.

Statistics: Posted by runagate — 27 Sep 2006, 10:51


]]>
2006-09-26T20:34:12+02:00 2006-09-26T20:34:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=650#p650 <![CDATA[Selector and multiplexers]]> your script is very good. Of course I can give you some tips to improve the speed. I'll do that very soon.

Some of my MIDI scripts are complicated but if you look carefully, you can see that they don't do anything, most of time. The calculation is done only when MIDI events are received, and in fact it's very rare. Remember that the script calculation appears about 1000 times per seconds. Even if you play a Chopin sonata, less than 20 MIDI events arrive per seconds.

In you patch, 1000 time per second your script does:
- 16 assignations to variables or arrays
- 16 boolean evaluations.
- 8 out assignation
Hard job for the CPU...

I'm working on a CPU friend version of scripts. Not so easy but not impossible!

The % is the default value when no symbol is specified. Maybe it's not a good idea...I'll chek that point.
Actually, if you dont want any symbol, use the setSymbol procedure with an ' ' (space bar) in the initialization bloc.

Statistics: Posted by senso — 26 Sep 2006, 20:34


]]>
2006-09-26T08:45:23+02:00 2006-09-26T08:45:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=649#p649 <![CDATA[Selector and multiplexers]]>
I also took a look at how much your MIDI delay etc patch used when idle (not sending any MIDI data through it), and it varied between 2% and 2.5%, even though that patch includes two scripts which both are more complicated than mine. Could it be that the big difference is there because mine contains so many in/out-parameters?

For the record, I also created a normal patch using 8 selectors that actually does exactly the same as the script, and it used between 0.5% and 0.7% with a spike or two at 1.2%...

Please don't spend time figuring out how my script can be improved as such, unless you think I've done something in a very impractical or inefficient way. I have no need for it - it used it just as an exercise - but maybe you can use it to check what can be improved in the script module. And please remove it from the Add-ons...

I also noticed a minor bug: The faders connected to the script (whose in- and output don't have any defined symbols) looked ok when created using ctrl-drag, but when reloaded after a restart of Usine, a '%' sign had been added after the value.

Statistics: Posted by bsork — 26 Sep 2006, 08:45


]]>
2006-09-25T13:58:19+02:00 2006-09-25T13:58:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=647#p647 <![CDATA[Selector and multiplexers]]>
I might even try to make a similar patch using 8 selectors just to make a comparison of the CPU usage.

Even if the scripts are slow and heavy on the CPU, I still find this to be a great addition to Usine, and some problems I've had creating patches with the "normal" modules should be gone now. (The problems may arise because I'm more used to writing lines of program code than connecting small boxes...)

Statistics: Posted by bsork — 25 Sep 2006, 13:58


]]>
2006-09-25T12:04:53+02:00 2006-09-25T12:04:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=646#p646 <![CDATA[Selector and multiplexers]]> it's interesting. You can post you scrip in the add-ons section. I'll take a look, if you want.
I know that the script language is very slow, and request a lot of CPU (too much...).
Actually, the script is not suitable for audio process, (only for data's or Midi calculation).

I'm working on.

Statistics: Posted by senso — 25 Sep 2006, 12:04


]]>
2006-09-25T08:47:55+02:00 2006-09-25T08:47:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=645#p645 <![CDATA[Selector and multiplexers]]>
This is my first attempt at writing a Usine script, so I'm sure I can make this little program a bit better. The CPU usage (according to the new and for me very welcome display in the upper rigth corner of the patch design window) was a bit high for my taste considering the simple code involved. However, I don't quite see any practical situation where I really would need to use as many as 8 inputs and 8 outputs. but it's much faster to delete than add some lines of code...

Statistics: Posted by bsork — 25 Sep 2006, 08:47


]]>
2006-09-20T11:22:33+02:00 2006-09-20T11:22:33+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=630#p630 <![CDATA[Selector and multiplexers]]> Statistics: Posted by senso — 20 Sep 2006, 11:22


]]>
2006-09-20T09:08:39+02:00 2006-09-20T09:08:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=629#p629 <![CDATA[Selector and multiplexers]]> Statistics: Posted by lalo — 20 Sep 2006, 09:08


]]>
2006-09-20T08:34:37+02:00 2006-09-20T08:34:37+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=628#p628 <![CDATA[Selector and multiplexers]]>
select multiple sources to 1 output
already exists: It's the data/selector.

The
multiple outputs from 1 source
module will arrive soon, with a set of new objects.
If you are impatient, you can easilly create a subpatch witch do that (for few outputs).

Statistics: Posted by senso — 20 Sep 2006, 08:34


]]>
2006-09-19T17:01:51+02:00 2006-09-19T17:01:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=150&p=623#p623 <![CDATA[Selector and multiplexers]]> would be nice to have selectors and multiplexers...

to select multiple sources to 1 output
or multiple outputs from 1 source

Statistics: Posted by lalo — 19 Sep 2006, 17:01


]]>