AnsweredAssumed Answered

Changing SigmaStudio equalizer 'Boost' levels from MATLAB

Question asked by 5kØ on Feb 5, 2013
Latest reply on Nov 19, 2013 by Pierre_B

Hi!

I'm trying to set the 'Boost' values of a SigmaStudio Medium Size Eq in an existing project from MATLAB. For this purpose I've set up SigmaStudio as a MATLAB COM server.

MATLAB script:
cd
'C:\Program Files\Analog Devices\SigmaStudio 3.8';

SS = actxserver('Analog.SigmaStudioServer.SigmaStudioServer');

SSinterfaces = SS.interfaces;

sssvr = SS.invoke('ISigmaStudioServer')

sssvr.OPEN_PROJECT('C:\...\TEST.dspproj')

 

This works, but now I want to set the 'Boost' property of the equalizer:

sssvr.SET_OBJECT_PROPERTY('setControlValue','Mid EQ2', 0, 0, 'Boost', 6)

 

This returns the error: No method 'SET_OBJECT_PROPERTY' with matching signature found for class 'Interface.2942E58A_4461_410E_87B3_64152C81935F'.

I can however change the name of the equalizer using SET_OBJECT_PROPERTY, so it's not that the function is entirely unavailable.

sssvr.SET_OBJECT_PROPERTY('setName','Mid EQ2', 'LeftEQ')

 

Strangely enough, I get no errors when I provide only three inputs in combination with 'setControlValue' (but it doesn't do anything useful either).

sssvr.SET_OBJECT_PROPERTY('setControlValue','Mid EQ2', 0)

or for example

sssvr.SET_OBJECT_PROPERTY('growAlgorithm', 'Mid EQ2', 0)

 

Is the input of SET_OBJECT_PROPERTY somehow limited to 3 parameters, even if some of the OPcodes require more?

 

Anyways, I then thought I should try to initialize a SigmaStudio script from MATLAB to accomplish my goal. The following SigmaStudio script works:

// #LANGUAGE# C#

int Boost1;

Boost1=3;

sigmastudio.ObjectSetProperties("setControlValue","Mid EQ2", 0, 0, "Boost", Boost1);

 

However I need to set the variable Boost1 to a value calculated in MATLAB. I can of course write the calculated values to a text file containing only integers with MATLAB. But how do I read those into variables using the SigmaStudio Script Editor? I googled some C# scripts (I have no personal C# experience whatsoever) like

string fileContent = System.IO.File.ReadAllText("somefile.txt");

string[] integerStrings = fileContent.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

int[] integers = new int[integerStrings.Length];

for (int n = 0; n < integerStrings.Length; n++)

integers[n] = int.Parse(integerStrings[n]);

 

But the Script Editor throws me an 'Illegal syntax detected in Script' error, because 'The use of .NET Reflection is not allowed. Please rename any variables that resemble System.Reflection members.'

 

Now I'm flat out of ideas. Can anyone please help me get the integer values calculated in MATLAB into the Boost setting of the SigmaStudio Equalizer?

Outcomes