SC-HOA icon indicating copy to clipboard operation
SC-HOA copied to clipboard

inline warnings

Open telephon opened this issue 6 years ago • 3 comments

Please, as a developer, switch on inline warnings:

LanguageConfig.postInlineWarnings = true;

There are a lot of errors at library compile time like:

WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '/Volumes/data/sc/quarks/SC-HOA/classes/HOADec5_0.sc'
  line 8 char 46:

  			                    in2, in3, in4, decoded;
                                                
                                 #in1, // distribute the channels from the array
-----------------------------------

This comes from variables inside the if statement like:

case{order == 1}
                		{ var in1, // declare variables for the b-format array
			                    in2, in3, in4, decoded;
                               #in1, // distribute the channels from the array
			                     in2, in3, in4 = in;
			              ^ITU5001.ar(in1, // return the Ugen
				                                            in2, in3, in4,
				                                            gain: gain.ampdb, lf_hf: lf_hf, mute:mute, xover:xover );

		}
		   

This could point to an architectural problem that would be good to overcome (btw. ITU5001 doesn't exist).

telephon avatar Jun 20 '18 12:06 telephon

Thanks for the pointer to inline warnings I will switch it on but am not sure atm that we can optimize that. Re ITU5001: this class is deprecated and will disappear, There is a decoder helper class, which in combination with Faust and Matlab or Octave will generate decoders of irregular speaker setups.

Florian

www.grond.at

On Wed, Jun 20, 2018 at 2:50 PM, Julian Rohrhuber [email protected] wrote:

Please, as a developer, switch on inline warnings:

LanguageConfig.postInlineWarnings = true;

There are a lot of errors at library compile time like:

WARNING: FunctionDef contains variable declarations and so will not be inlined. in file '/Volumes/data/sc/quarks/SC-HOA/classes/HOADec5_0.sc' line 8 char 46:

  		                    in2, in3, in4, decoded;

                             #in1, // distribute the channels from the array

This comes from variables inside the if statement like:

case{order == 1} { var in1, // declare variables for the b-format array in2, in3, in4, decoded; #in1, // distribute the channels from the array in2, in3, in4 = in; ^ITU5001.ar(in1, // return the Ugen in2, in3, in4, gain: gain.ampdb, lf_hf: lf_hf, mute:mute, xover:xover );

  }
  

This could point to an architectural problem that would be good to overcome (btw. ITU5001 doesn't exist).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/florian-grond/SC-HOA/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVJxip9M3b-OL9my_YEaHg_yblRI6Yvks5t-kUugaJpZM4UvNay .

florian-grond avatar Jun 21 '18 11:06 florian-grond

The simplest quick thing would be this:

make for each UGen a method like

ITU5002  {

	*arFlattenInput { |in, gain, lf_hf, mute, xover|
		^this.ar(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9],  gain, lf_hf, mute, xover)
	}
	
}

and then just call that from the case distinction. No need for all these variables.

Often, in the plugins, we append the input channels to the end of the inputs. Then these things are asier to write. You could have a look at Select:

Select : PureUGen {
	*ar {
		arg which, array;
		^this.multiNewList(['audio', which] ++ array)
	}
}

telephon avatar Jun 21 '18 12:06 telephon

Thanks, will try when I find time to get back to it.

www.grond.at

On Thu, Jun 21, 2018 at 2:08 PM, Julian Rohrhuber [email protected] wrote:

The simplest quick thing would be this:

make for each UGen a method like

ITU5002 {

*arFlattenInput { |in, gain, lf_hf, mute, xover| ^this.ar(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9], gain, lf_hf, mute, xover) }

}

and then just call that from the case distinction. No need for all these variables.

Often, in the plugins, we append the input channels to the end of the inputs. Then these things are asier to write. You could have a look at Select:

Select : PureUGen { *ar { arg which, array; ^this.multiNewList(['audio', which] ++ array) } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florian-grond/SC-HOA/issues/9#issuecomment-399081136, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVJxqemgzfAW9rhhnui0ZJ0l8rIsP0oks5t-4ypgaJpZM4UvNay .

florian-grond avatar Jun 21 '18 15:06 florian-grond