Welcome to %s forums

BrainModular Users Forum

Login Register

Template procedures : manipulation of variables?

I need help on a Patch
Post Reply
User avatar
Vincent
Member
Posts: 317
Location: PACA
Contact:

Unread post by Vincent » 02 Jan 2009, 18:17

Hi,

Question:
is it possible to do stuffs like this:

Code: Select all

CREATE_LINK SRC_MODULE SRC_TERMNUM+1 out1 2
// where 1 is added to the variable SRC_TERMNUM (this line doesn't work)
Could be fine for stereo connections or for multi-module insertion.

And is it possible to add conditions, etc...?
And, in the modular mood, is it possible to call other templates from a template?

Thanks
vincent michel
composer & novelist

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

Unread post by senso » 05 Jan 2009, 20:13

actually no way, the syntax of the IML is very simple.
but you can use a script to compose your message and make complex manipulations.

User avatar
Vincent
Member
Posts: 317
Location: PACA
Contact:

Unread post by Vincent » 05 Jan 2009, 22:38

Thanks Olivier,

Yes, scripts, sure, but it's not the same domain.
I'm thinking to something, here: to the possibility of mixing TXT templates with small C++ dll.
Those TXT files used by the template engine should be able to call an external procedure with parameters. Would'nt it be fine?

cheers
vincent michel
composer & novelist

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 06 Jan 2009, 10:48

Hope I'm not hijacking your thread Vincent, but I have a related question to Olivier:

Is there a way to retrieve the values of the variables used in the IML from within a script or a user module? Something like GetUsineMessageVar('VARIABLE_NAME')?
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 06 Jan 2009, 15:08

Yes, this is interesting.
How to retrieve and make manipulations to IML variables using scripting? A tiny example would be great.
And is this the key to getting the IML syntax to work within scripting the quotes as in bsorks example? I.e. SendUsineMsg('CREATE_MODULE fader1 3 100 100');

Cause I didn't get it to work as I mentioned in another thread...

Thanks.

antwan

User avatar
Vincent
Member
Posts: 317
Location: PACA
Contact:

Unread post by Vincent » 06 Jan 2009, 17:33

bsork wrote:Hope I'm not hijacking your thread Vincent, but I have a related question to Olivier:
No Bjorn, you're not hijacking.
Questions on IMI are important, since they proove to who needs that this feature will become one of the greatest mana in this game. Mana AND quad damage!
I think that Olivier will appreciate if we are interested in his crazy implemntations, isn't it?
Actually, hijacking is a background question!

I've tried to do some templates files also because scripting tool in Usine is not yet quite user-friendly, but both are related of corse.
Bjorn, is C++ your developing langage? Did you have a look to the SDK and thout that C++ + templates... that could be devastating?

cheers
vincent michel
composer & novelist

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

Unread post by senso » 06 Jan 2009, 22:47

actually impossible
I'll implement functions like:
get variables, etc.

I didn't anticipate the success of the IML!

User avatar
Vincent
Member
Posts: 317
Location: PACA
Contact:

Unread post by Vincent » 06 Jan 2009, 23:01

senso wrote:I didn't anticipate the success of the IML!
Of course.
I must say it's much more easyer for me to add some bitmaps and draw some wires. Perhaps am I not alone in this simple case!
vincent michel
composer & novelist

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 07 Jan 2009, 08:54

Vincent wrote:Bjorn, is C++ your developing langage? Did you have a look to the SDK and thout that C++ + templates...
No, when I first started to learn myself programming eons ago, it was with a version of Pascal on the Atari ST which helps somewhat when doing scripts... I've been using different languages/dialects up through the years, but I've never done anything in C++; the closest thing being Pro*C (an Oracle pre-compiler for C with embedded SQL) and a little Java. At work I mostly use PL/SQL (a 3G language tightly integrated with SQL) that looks similar to Pascal in a lot of ways, but the similarities also means that I can sit a while and wonder why my "IF () THEN ... END IF;" is giving a compilation error when doing a script in Usine. :)

I've taken a very quick look at the SDK - that is the UserDefinitions - and I think I've understood most of it. Some time ago, I downloaded Delphi and tried to compile a couple of the examples with success, but I've never really got around to use it for anything real.

At my work, we've developed a new client framework using .Net and C#, but so far I haven't been involved with it at all, but I guess I'll be looking more into C++ when I start with C#.

@Olivier:
Thanks for your answer, looking forward to new functions!
BTW, am I right when I think that the Delphi SDK is still v1?
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 07 Jan 2009, 10:32

Okay, I'm loving every minute of this.
Definitely in scripting there's endless possibilities and - as Olivier said - things like what Vincent was asking for can already be carried out. I'm having lines of code like this, which are doing exactly what I want them to do:
SendUsineMsg('CREATE_MODULE fader_' + intToStr(faderCount + 1) + ' 3 ' + intToStr(posY) + ' ' + intToStr(posY));

Nice!

Of course for Vincent's purpose this would need to be possible also outside of the scripting environment (i.e. in Templates Engine and plain IML in SendUsineMessage-module) but in scripting this is all working very nicely already.

I'm a happy man. 4.1 is the bomb!

antwan

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 07 Jan 2009, 10:45

Hi bsork,
bsork wrote:BTW, am I right when I think that the Delphi SDK is still v1?
Yes you are right.
In fact, i 'translated' the SDK to C++when olivier was coding all these groovy 4.1 features, so they are naturally integrated in, but so far, the Pascal version wasn't updated has olivier couldn't duplicate himself.

I believe the Pascal version will be sync again soon...when olivier (or other ?) will put his hand one.
Maybe there is a need here for a 'Pascal SDK maintainer' ? as olivier seems very busy with Usine itself.
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by senso » 07 Jan 2009, 11:02

Yes I'm very busy with Usine !
I'll try to update tve delphi SDK soon.

also I add 3 new functions in the script language:

function GetVariableString(name:string):string;
function GetVariableInteger(name:string):integer;
function GetVariableFloat(name:string):double;

to retrieve the global IML values.

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 07 Jan 2009, 11:28

Thanks!
Bjørn S

amiga909
Member
Posts: 324
Contact:

Unread post by amiga909 » 07 Jan 2009, 12:48

+1 for the greatness of IML :)

personal note:
did/do web programming jobs with PHP/JS/SQL.
at university I have to do a lot of Java. also learnt Prolog for computational linguistics. right now I have to work with Perl for a chatbot typography module.
for usine I got a little into Pascal Script.
lot of other scripting languages for different stuff too.. (including IML soon)
for serious usine and vst coding I'd need to learn C++ (or Pascal derivat Delphi).
result is: I understand a lot of languages but I am not good at one particular language (PHP when it has to be one). help ;)

-> the rapid development of usine, not only adding new modules in a breeze, moreover adding new programming languages/representations is fascinating.
but: its impossible for me to keep up! I'd like to see more time spent into documentation and tutorials. or put differently: there are so many ways to achieve something in usine, it should be more clear (for me) which is the best way to do something (means: use already built-in functionality, make visual subpatch, use IML, use Pascal script, compile C++ or Delphi module, etc.).

Post Reply

Who is online

Users browsing this forum: No registered users and 90 guests