Welcome to %s forums

BrainModular Users Forum

Login Register

SDK V2 Feedbacks, it's here

Create your own modules in C++
Post Reply
martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 24 Dec 2008, 17:53

I'll do my best to answer you're questions and feedbacks.
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by Vincent » 31 Dec 2008, 16:37

Hello Martin,

I've donwloaded and unpacked this SDK V2, and I'm very desappointed 'cause I cann't open any solution with my version of Visual C++ Express (the free one )!

cheers
vincent michel
composer & novelist

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

Unread post by martignasse » 31 Dec 2008, 16:52

hi vincent,

It's very strange, I've made the SDK V2 on VC++ Express, exactly on this version :

Image.

what kind of message VC Express bring you ?
Martin FLEURENT - Usine Developer - SDK maintainer

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

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

OK!!!!
Not strange at all!
I don't know how I did this, but I run a Visual C++ 2005!
Tell me pleazzze: where did you dwnload this C++ 2008?!
Thanks and sorry for this stupid post!
I'm impatient to start!

cheers
vincent michel
composer & novelist

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 02 Jan 2009, 18:20

google is your friend Vincent :



http://www.microsoft.com/express/vc/

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

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

Hello Yan,

Thanks for the link. Google doesn't like me and makes some jokes I don't appreciate!
I had to know that there was a 2008 edition and ask for it...
Now, let's go!

cheers
vincent michel
composer & novelist

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

Unread post by martignasse » 02 Jan 2009, 19:55

ok, good news,

let us know your 'not coder' feeling about it ;)
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by Vincent » 02 Jan 2009, 20:05

martignasse wrote:let us know your 'not coder' feeling about it ;)
'Not coder', exactly. I'll talk, don't worry!
vincent michel
composer & novelist

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

Unread post by Vincent » 03 Jan 2009, 00:07

Evrything works fine now.
Thanks Yan for the right link.

I had a look in the user modules.
Looks simple, but unfortunately for me, all what I know in coding is in Visual Basic (VB 2008 is nice!).
With Visual C++, I have to spend some time to re-learn...
And time, you know...
Yeah, I'll take it, every day.

cheers
vincent michel
composer & novelist

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

Unread post by martignasse » 03 Jan 2009, 00:47

Even if it's not directly related to Usine,
i'll try to put some links to CPP basics on the WIKI, as it can help to understand the syntaxe, and how to manipulate data.

Can't promise you 'll become a master, but you should arrive to make some user module pretty easly.

A+
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by Vincent » 03 Jan 2009, 03:45

Thanks, Martin.
Yes, I think I'll be able to have some good time!
Anyway, I won't make modules just as a game, I think that when I'll have do what I need, I'll comme back to Usine.

cheers
vincent michel
composer & novelist

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

Unread post by Vincent » 04 Jan 2009, 16:19

Bouh...
C++ give me headaches. I understand absolutely nothing, it seems *very* different from VB that I now know a little...
Architecture is different, concepts are different, ways of conception and ways to build... I'm just lost.
And the MSDN in this release is so poor! 2/3 help files are missing. I've tryed to download the whole ISO stuff, but download is bugged here. Maybe with Firefox... I'll try.
Could you please give me a couple of links toward efficient french tutos for newbleubite?

I had a clear project for a sync module, I think it will wait a while. But when I'll be somewhat ready, i'll come back for tons of questions!

Thanks for this SDK, Martin, it is really a good stuff.

cheers
vincent michel
composer & novelist

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

Unread post by martignasse » 04 Jan 2009, 16:42

Vincent wrote:Could you please give me a couple of links toward efficient french tutos for newbleubite?
Quick answer :
Apprenez à programmer en C !
Apprenez à programmer en C++ !

they are french tutorials from 'le site du zero' so, especially for 'newbleubite' :D.

C++ is built on top of C language, so it's recommended to read the C one before, has it speak about very basic and important things to understand C++.

PS : I'll add those links on the WIKI when i'll make the french pages.

Hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by Vincent » 04 Jan 2009, 16:48

Yes it helps! Anything helps where I am. Well, let's have a drink...
Thanks Martin.
I'll come back later.
vincent michel
composer & novelist

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

Unread post by Vincent » 12 Jan 2009, 20:19

martignasse wrote:Quick answer :
Apprenez à programmer en C !
Apprenez à programmer en C++ !

they are french tutorials from 'le site du zero' so, especially for 'newbleubite' :D.
Hope it help
Yes! Tremendously.
Nice tutos, clears and realy well thought.
I don't specialy like Bible, but actually...
vincent michel
composer & novelist

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

Unread post by martignasse » 13 Jan 2009, 15:54

hello Vincent,

you are in ideal position to make a 'User module tutorial for C++ newbie' :lol:
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by Vincent » 16 Jan 2009, 20:23

martignasse wrote:you are in ideal position to make a 'User module tutorial for C++ newbie' :lol:
Not yet!
I'm still with C++ learning tutos and I positively understand nothing in all your threads about SDK and user modules.
In some words: i'm not as good as a newbie and it seems to me that i'm far to be!
vincent michel
composer & novelist

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 26 Jan 2009, 17:37

Hi,

Just checking:
Are all the projects included in the CPP SDK supposed to build succesfully?

With UserDrawPad I get:

1>UseDrawPad.cpp
1>c:audiousine sdkcppusine cpp sdk v2auserdrawpadexampleusedrawpad.cpp(300) : error C2664: 'DrawTextW' : cannot convert parameter 2 from 'LPSTR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:audioUsine SDKCPPUsine CPP SDK V2aUserDrawPadExampleDebugBuildLog.htm"
1>UserDrawPadExample - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

With TemplateModule I get:

1>------ Build started: Project: TemplateModule, Configuration: Debug Win32 ------
1>Compiling...
1>TemplateModule.cpp
1>c:audiousine sdkcppusine cpp sdk v2atemplateprojecttemplatemodule.cpp(59) : warning C4065: switch statement contains 'default' but no 'case' labels
1>c:audiousine sdkcppusine cpp sdk v2atemplateprojecttemplatemodule.cpp(83) : warning C4065: switch statement contains 'default' but no 'case' labels
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1> Creating library DebugTemplateModuleCPP_D.lib and object DebugTemplateModuleCPP_D.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1>C:audioUsine SDKCPPUsine CPP SDK V2abinTemplateModuleCPP_D.usr : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:audioUsine SDKCPPUsine CPP SDK V2aTemplateProjectDebugBuildLog.htm"
1>TemplateModule - 3 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

UserPrototypeExample builds succesfully...

I thought I'd just ask before getting any deeper into this world :)

Thanks,
antwan

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

Unread post by martignasse » 27 Jan 2009, 13:11

Hi antwan,

Normally, all projects should build without errors, in release and debug mode...

But the fact is, there are some inconsistence in projects properties between release and debug configs.
So, will go for a V2b update shortly...

In the mean time, i can explain what is wrong to let you play with the SDK

for the DrawPad | Debug :
1>c:audiousine sdkcppusine cpp sdk v2auserdrawpadexampleusedrawpad.cpp(300) : error C2664: 'DrawTextW' : cannot convert parameter 2 from 'LPSTR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:audioUsine SDKCPPUsine CPP SDK V2aUserDrawPadExampleDebugBuildLog.htm"
1>UserDrawPadExample - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
In Project properties(Debug), you have to change the Configuration Properties->Ceneral->Character Set to No Set instead of Unicode, which cause this invalid cast.

For the ModuleTemplate | Debug :
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1>C:audioUsine SDKCPPUsine CPP SDK V2abinTemplateModuleCPP_D.usr : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:audioUsine SDKCPPUsine CPP SDK V2aTemplateProjectDebugBuildLog.htm"
1>TemplateModule - 3 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
In Project properties(Debug), you have to change the Configuration Properties->C/C++->Runtime Library to Multi-threaded Debug (/MTd) instead of Multi-threaded (/MT), which cause this libs conflict.

Note that the ModuleTemplate is here as a base to make new project easier, even if it should build out of the box, it miss some important code to be functional. You have to add at least what mentioned in code comments.

The best solution would be to make a VC wizard for new user module... if someone can do that, it will be perfect

Anyway, thanks a lot for the feedback, and sorry for these troubles, i haven't test enough before release :/
Martin FLEURENT - Usine Developer - SDK maintainer

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 27 Jan 2009, 16:43

Hi Martin,

Thanks for the clarification. That'll get me started. Though I'm still a bit scared of it all :)

antwan

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 27 Jan 2009, 23:56

Hello once again,

Okay, so I got these things to compile okay.
But how do I actually get from compiling/building to having an actual module in usine? I can't find any usr-file etc. created as a result of the release-build.

Cheers,

antwan

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

Unread post by martignasse » 28 Jan 2009, 10:32

hi,

Normally, the result of compilation for all projects are in the bin folder, named like the project and with a '_D' for debug version and a '.usr' extension.

If it's not the case, you have to check in the project properties (for Release and Debug mode) Configuration Properties->General->Output Directory it should be $(SolutionDir)bin. If it's something else, follow the path to find the file.

Those files should be copied or moved in the Usine folder installFilesModulesUser to be visible in the Usine Browser->Modules->User and usable.

Let me know if you get it right.
Martin FLEURENT - Usine Developer - SDK maintainer

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 28 Jan 2009, 10:41

Ah, of course the bin-folder! Found it.
Sorry I was looking in the ProjectDir/Release-folder... Silly me.

All good. Thanks,

antwan

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

Unread post by martignasse » 28 Jan 2009, 11:06

no problems,

The Release and Debug folders of each projects are user for intermediates files in the compilation process (and there a few...).

I decided to 'centralize' the place where to found finales files.... in a bin folder. It will be more praticable when you'll have tones of users modules projects ;)

Have fun
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 04 Mar 2009, 10:43

hallo!

thanks for the c++ SDK.
Is there a way to create or communicate with an audio buffer?

thanks

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

Unread post by martignasse » 05 Mar 2009, 08:51

Hi gizzeta,

What do you mean by audio buffer ?

If you make an audio input parameter in your module, you have access to his audio blocks as usine inject them in the module.
(assuming there is an effective connexion with some audio flux)

Also, you can create some audio blocks inside your module and put them in an audio output parameter too.

The related structure in the SDK is TEVT, which contain the event data of your parameter.

In fact, i believe the SDK work quite similar as the VST SDK V2.4.

Hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 06 Mar 2009, 12:56

Hi Martin,

I come from MaxMSP and within it there is a buffer object to store sounds or big datas.I can acces it from the C++ module programming.
In Usine, if I need to store for examle a 60 seconds incoming sound inside my module, have I to do a memory allocation myself?
Or there's a function to acces at, to create a 4Mb buffer?

thanks

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

Unread post by senso » 08 Mar 2009, 09:40

you have to manage memory yourself:
allocate in the create procedure and free it in the 'destroy'

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 08 Mar 2009, 13:16

i'll try, thanks!

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 09 Mar 2009, 11:01

hem....what kind of allocation?
an array of 7.000.000 floats elements? Or there's something better? ;)

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

Unread post by senso » 09 Mar 2009, 15:24

yes, it a good starting point to create an array of float; it's the easiest way.

you also have the possibility to allocate a PCHAR pointer (7.000.000 x sizeof(float)) and deal with pointers, often more efficient.

but allocating such a buffer can take a long time so don't do that in the main 'audio proceed' function.
try to do that in
- during the creation procedure
- the callback procedure

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 10 Mar 2009, 18:52

ok, thank you

and is there a function to print from an user module on the Usine console? (for debugging purpose...)

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

Unread post by senso » 10 Mar 2009, 19:05

Actually no way, except to create a text outlet and connect it to a 'trace' module
It's a good suggestion I'll try to add this fuction as soon as possible.
Also Usine contains around 350.000 lines of reusable code. Maybe I could start to find a way to have an access to those functions.
For example reading audio samples from the hard disk, midi tools, etc.

pansoul
Member
Posts: 39
Contact:

Unread post by pansoul » 19 Mar 2009, 13:57

hello
martignasse , in the CPPQuickStartEN.pdf and in french version too, you say :

"The last thing to do is to replace, in these two files, the world TemplateProject by
the name of your module (be sure to uncheck the Match case and Match whole
word options to replace all occurences)."

but i can't find the word "TemplateProject" in this two files, do you rather mean the word "TemplateModule" is to changed
with the project name ?

thanks

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

Unread post by martignasse » 19 Mar 2009, 17:50

pansoul wrote:but i can't find the word "TemplateProject" in this two files, do you rather mean the word "TemplateModule" is to changed with the project name ?
Yes, you are totally right it's "TemplateModule" that should be replaced by "MyModule" or what ever.

Excuse me for the typo, i'll correct this for the next release.
Martin FLEURENT - Usine Developer - SDK maintainer

pansoul
Member
Posts: 39
Contact:

Unread post by pansoul » 23 Mar 2009, 02:02

hello
correct me if i am wrong, in your example you use win api to code the graphical part of your draw pad.
i have read the two tutorial about c and c++ on le site du zero and i am not able to understand correctly your code.
is a tutorial like http://www.siteduzero.com/tutoriel-3-87 ... ndows.html pertinent for a good undertanding ?
if you are thinking to others ressources...
thanks
Vincent

pansoul
Member
Posts: 39
Contact:

Unread post by pansoul » 23 Mar 2009, 19:05

i try to add some an new output (data, midi or anything else) on a patch inspired by drawpad and prototype example.
compilation works but when a put my .usr file into usine, i can't connect it to others modules.
i suppose that i did a mistake but i don't find where
i add some line code in :
- get param info method (i add a new case)
-set event adress (new case too)
- i changed the number of params in get module info and try to change the value of pModuleInfo->ModuleType
anyone no what is to change to add output or have others sources codes available to see how they works ?

thanks
Vincent

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

Unread post by martignasse » 23 Mar 2009, 19:59

pansoul wrote:in your example you use win api to code the graphical part of your draw pad.
Partialy right, in fact, the 'simplest' way to code the graphical part is to use the GDI or the GDI+ (who are really little part of the Windows API), has they are used by Usine itself.

The difference between those is that GDI+ has OOP interface, and has more polished graphical result, but is slower than GDI, who is typical C interface.

The UserDrawPad example use the GDI library.

The link you provided seems to generic about the whole Windos API, here some specific resources for GDI and GDI+ :

MSDN for GDI+
MSDN for GDI
(added to the wiki)

You'll find a lot of tutorials with google for GDI+, less for GDI, don't hesitate to add them to the wiki.

as a note, you have to know that in theory, it's possible to draw the graphical part with DirextX or OpenGL, it's just that no one have made it for now. I even wanted to make test for vector graphic with SVG or OpenVG....but really no time for that theses days.

Hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by martignasse » 23 Mar 2009, 20:08

pansoul wrote:i try to add some an new output (data, midi or anything else) on a patch inspired by drawpad and prototype example.
compilation works but when a put my .usr file into usine, i can't connect it to others modules.
i suppose that i did a mistake but i don't find where
i add some line code in :
- get param info method (i add a new case)
-set event adress (new case too)
- i changed the number of params in get module info and try to change the value of pModuleInfo->ModuleType
anyone no what is to change to add output or have others sources codes available to see how they works ?

thanks
Vincent
Seems ok, but did you add the corresponding TEVT* pointer in the include file ?

Code: Select all

// DrawPad class
class TDrawPad : public TUserModule
{

public:

	TEVT*				pButtonClear;	// ClearButton Event pointer
	TEVT*				pPointsCount;	// PointsCount Event pointer
	TEVT*				pMyNewOutput;     // <----------------HERE
...
If it's not that, source code is needed to find what's wrong
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 27 Mar 2009, 18:23

Hi,

I've tried, but i didn't find how to create a text outlet. Can you help me?

thanks

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 11 Apr 2009, 18:28

Another question:

how can I get the Usine sample rate?

thanks

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

Unread post by martignasse » 11 Apr 2009, 23:24

Hi Gizzeta,

Sorry, seems like i forget you'r last question...
Gizzeta wrote:I've tried, but i didn't find how to create a text outlet. Can you help me?
Well, after testing, it seems like the text field param is always shown as inlet, whatever the IsInput/IsOutput values, which is anormal. I have to see with senso.
As a workaround for now, you can always extend the module in usine (the little white square in topleft) to access the outlet part.
Gizzeta wrote:Another question:

how can I get the Usine sample rate?
Something like should do the trick (not tested) :

Code: Select all

double sampleRate = pMasterInfo->VstTimeInfo->sampleRate;
Hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by senso » 12 Apr 2009, 20:32

Gizzeta wrote:I've tried, but i didn't find how to create a text outlet. Can you help me?
Well, after testing, it seems like the text field param is always shown as inlet, whatever the IsInput/IsOutput values, which is anormal. I have to see with senso.
it's an usine pb fixed now.
next release very very soon!

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

Unread post by martignasse » 12 Apr 2009, 21:00

ok, cool
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 22 Apr 2009, 02:04

martignasse wrote:Hi Gizzeta,
Something like should do the trick (not tested) :

Code: Select all

double sampleRate = pMasterInfo->VstTimeInfo->sampleRate;
thanks for your answers.
for the sampling rate I checked: it's not VstTimeInfo, but pTimeInfo.

Code: Select all

SampleRate = PointerToMyModule->pMasterInfo->pTimeInfo->sampleRate

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

Unread post by martignasse » 22 Apr 2009, 02:50

Gizzeta wrote:
martignasse wrote:Hi Gizzeta,
Something like should do the trick (not tested) :

Code: Select all

double sampleRate = pMasterInfo->VstTimeInfo->sampleRate;
thanks for your answers.
for the sampling rate I checked: it's not VstTimeInfo, but pTimeInfo.

Code: Select all

SampleRate = PointerToMyModule->pMasterInfo->pTimeInfo->sampleRate
....nearly good... ;)

Can you confirm if the textfield problem is solved with the new version 4.20 ?
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 22 Apr 2009, 13:41

martignasse wrote:Can you confirm if the textfield problem is solved with the new version 4.20 ?
It's ok for the text outlet, it appears normally.
But how can I pass my text to the outlet?
througt DATA?(but it is an array of floats, not char...)
or througt the UserData pointer to void?
Have I to set TFlowType to ftEvtText?
...?

thanks

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

Unread post by martignasse » 23 Apr 2009, 00:49

Gizzeta wrote:It's ok for the text outlet, it appears normally.
cool
Gizzeta wrote:But how can I pass my text to the outlet?
througt DATA?(but it is an array of floats, not char...)
or througt the UserData pointer to void?
Have I to set TFlowType to ftEvtText?
In fact, i don't know :(

Seems there is no exposed method to access the text variable by code... or we lack some infos.


Have to ask to senso.
Martin FLEURENT - Usine Developer - SDK maintainer

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

Unread post by martignasse » 27 Apr 2009, 00:06

Gizzeta wrote:But how can I pass my text to the outlet?
througt DATA?(but it is an array of floats, not char...)
or througt the UserData pointer to void?
Have I to set TFlowType to ftEvtText?
Ok so,

I have the solution (directly from the boss ;))

the text data is stored in the DATA array, one char per float ! :o

so the way you have to code your text is a bit tricky....you need to cast each char as float per DATA array element.

for example (tested OK), assuming 'PTextTest' is your textfiel param:

Code: Select all

	char test&#91;&#93; = "hello";
	for &#40;i = 0; i < 5; i++&#41; &#123;
		pPrototype->PTextTest->DATA&#91;i&#93; = &#40;float&#41;test&#91;i&#93;;
	&#125;
	pPrototype->PTextTest->len = 5;
I'll surely make an helper function for future release...

Hope it help

edit : I've updated the wiki with this precious info :)
here is the link, feedback are welcome.
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 30 Apr 2009, 11:43

It works fine, thanks!

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 01 May 2009, 13:42

hi,
need help again...

I create a module that fill a buffer with a waveform stored in an external file and read it as a loop (oscillator).

it works nice, but when I add a second instance of the same module (even if not connected) it affect the output of the first module (it sounds like a frequency modulation). WHY???

Normally all the variables and pointers are internals to every instance of the module(private)...or not?


Thanks for your help

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

Unread post by martignasse » 05 May 2009, 18:21

Gizzeta wrote:hi,
need help again...

I create a module that fill a buffer with a waveform stored in an external file and read it as a loop (oscillator).

it works nice, but when I add a second instance of the same module (even if not connected) it affect the output of the first module (it sounds like a frequency modulation). WHY???

Normally all the variables and pointers are internals to every instance of the module(private)...or not?


Thanks for your help
I opened a new thread for this question, for better visibility and because it's not directly SDK feedback, but more a technical question.

here it is
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 18 May 2009, 12:10

Hi,

is there a way to get the "name" you can give to the module (when you right-click on a module)?

thanks

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

Unread post by martignasse » 18 May 2009, 12:54

hi Gizzeta,
is there a way to get the "name" you can give to the module (when you right-click on a module)?
No, it's not exposed on SDK level.

For what use do you need this ?
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 18 May 2009, 13:11

I thaught about an "argument" for a module.
The "name" would be a good way to provide it.
just to know, but it's not really important.

thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests