Welcome to %s forums

BrainModular Users Forum

Login Register

speed of scripts

I need help on a Patch
Post Reply
manecante
Member
Posts: 71
Contact:

Unread post by manecante » 16 Nov 2010, 15:51

hello

just trying out scripts in usine.

the one below is very basic, it just connects one output to an input.
(in a nearly empty patch, just 2 subpatches with dummy ins/outs).
it works but it takes nearly 1 second to connect/disconnect.

so:
- is it because of some code uglyness or is that intended (i.e. this method should *not* be used in an audio context) ?
- the same thing in a "Send Usine Internal Messages module" does not have this problem (but is much less flexible).

thanks for your hints.

Code: Select all

[snip]
Procedure Callback(N:integer); 
BEGIN

  if (n = InCmd) then begin

    if (GetValue(InCmd) = 1) then begin

      cmd := 'CREATE_LINK';

    end
    else begin

      cmd := 'DELETE_LINK';

    end;

    SendInternalMsg ('SET_TARGET_PATCH','SENDER_PATCH');
    SendInternalMsg ('SET_TARGET_PATCH', '1', '1');
    SendInternalMsg (cmd, 'foo', 'output', 'bar', 'input');

  end;

END;

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 16 Nov 2010, 16:17

globally IML is not targeteted at real time audio applications, even if it can performs very decently very fast, in some data cases
as i saw with the vst automations send via IML, however i feel the thing that can be really slow here is the
the process of creating/deleting wires or modules, cause it's not a priority process and take a certain amount of time.
maybe try in init to set InCmd FastCallback using
SetFastCallback(inCmd, TRUE); and disable undo could speed up a bit the thing, but not sure it can be really increased.
(don't remember but there is a command to send for usine to bypass undo, think it's in wiki)

I feel such 'audio Dispatcher' would work better with a real modules wiring indeed.
IML could be cool for adaptative changing setup, but not real time audio switcher.
as creating/deteleting wires is not as efficient as changing a dispatcher nb.

manecante
Member
Posts: 71
Contact:

Unread post by manecante » 17 Nov 2010, 19:43

thanks for your advices, that's more clear for me now ;)

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 17 Nov 2010, 19:59

yes this part of the IML is processed as a very low priority task.
In an audio process it can be used only in extreme circumstances.
But it's an interesting way to explore!

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests