Function-component creation from C code

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Function-component creation from C code

Post by Mantas »

Hi,

Would it be possible and how to implement the possibility to create new components, or functions directly from C code, and them have them as standard library, like for the example I did with the inverse sqrt() function? Instead of having them as macros? Or is this just a no brain'er? :roll:

Cheers,
Mantas
Science is my true religion.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Function-component creation from C code

Post by Benj »

Hi Mantas,

The Embedded Macro and Hidden Embedded Macro options in the Interface manager are basically for this very purpose and allows us to build components which either call existing C functions without any additional overhead or to call code e.g. to read or write to an array as used in the DSP components.

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: Function-component creation from C code

Post by Mantas »

Hi Benj,

Sorry for the stupid question, but where do I find this Interface manager? :oops:

Cheers,
Mantas
Science is my true religion.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Function-component creation from C code

Post by Benj »

Hi Mantas,

I talk briefly about the interface manager in this vid.
http://www.matrixmultimedia.com/mmforum ... 58&t=12735

More info can be found in the Wiki but I have some writing on this section still to do so I could try and add to this extra info in later today.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Function-component creation from C code

Post by JonnyW »

Hi. Dave has produced a video on the interface manager here:

[/youtube]

Jonny

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: Function-component creation from C code

Post by Mantas »

Hi Gents,

Could you create a video of showing how to create a component, or a function specifically from C code? I know there is a supplementary section in the settings manager an others, but this is still mind boggling for me :? What if a C code function to call has a pointer in the parameter section...you know some more complicated functions implementation done by you in a video would be very interested to see.

Thanks in advance! You are doing an amazing job there!

Best regards,
Mantas
Science is my true religion.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Function-component creation from C code

Post by JonnyW »

Hi Mantas. Yes, it would certainly be possible to do a video on this.

As far as pointers go, we get around that when using DLLs by using an array of 1 element, but all macros must conform to Flowcodes procedure-call standard, that is that every array is followed by its size, and the return type (if a string) is the final argument. This is easily fixed with a #define though:

#define FlowcodeFunc(arrayptr, arraylen) RealFunc(arrayptr)

I've wanted to do a video on embedded component macros for a bit, so see if there is time today now I know there is demand.

Cheers,

Jonny

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: Function-component creation from C code

Post by Mantas »

Hi Jonny,

I would really appreciate that! This would simplify a big part of my work were I need to convert C code to flowcode!

Cheers,
Mantas
Science is my true religion.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Function-component creation from C code

Post by JonnyW »

Because we moved buildings the audio equipment is tucked away somewhere, but I have scripted a video and hopefully can roll that out when the box with the microphone us uncovered.

Jonny

Post Reply