Welcome to %s forums

BrainModular Users Forum

Login Register

help with array input

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 02 Mar 2016, 00:41

Hi,

in my last module, I use an array input that is supposed to take 0 to 255 integers in a table that has a size of 256.

I did this :

// frequency
else if (ParamIndex == 1) {
pParamInfo->ParamType = ptArray;
pParamInfo->Caption = "wave shape";
pParamInfo->MinValue = 0;
pParamInfo->MaxValue = 256;
pParamInfo->DefaultValue = 127;
pParamInfo->Format = DEFAULT_FORMAT_INTEGER;
pParamInfo->IsInput = TRUE;
pParamInfo->IsOutput = FALSE;
pParamInfo->CallBackType = ctImmediate;
}

as well as setting the size of the event in the initialisation :
sdkSetEvtSize(shape, 256);

But, when I pull a wire out of the array input, I get an array of size 16 with 0 to 1 integers...

thanx for your help
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

sm_jamieson
Member
Posts: 551
Contact:

Unread post by sm_jamieson » 02 Mar 2016, 17:07

Which module are you selecting when you pull out the wire ?

I think the "pull out a wire" function only uses the information in the ParamInfo data, so it does not know about the sdkSetEvtSize() on the event.
Anyway arrays are variable size - the array get and set modules ask you how many parameters / faders you want since it does not know.

Regarding the min/max value - I would have thought that should be used with the "pull out a wire" function, but it might depend what option you are selected on the "pull out a wire" menu.

Simon.

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 02 Mar 2016, 22:36

I select "array display or set"
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 03 Mar 2016, 20:58

I solved my problem in making my module compatible with any size array from 1 to 1024 !
sonically, it is even more interesting !:)
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests