Volume attenuator

Hey all,
Sorry if there’s documentation on this but is there somewhere the mathematical order of operations is outlined? Does it follow C conventions? I was getting some unexpected results where, when attenuating a signal level, this here
ain = ainput*(iInputAtt + kInputAttRT)

In which (iInputAtt + kInputAttRT) would equal zero was still giving me an audible signal but this code:

kInputAttRT = iInputAtt + kInputAttRT
ain = ainput*kInputAttRT

Would yield me the expected inaudible signal, which lead me to believe there is something I’m unaware of as far as the order of operations in csound

Just asking so I’m aware and don’t create any unnecessary problems in the future
Much thanks!

i would expect both expressions to be the same.

are you sure that iInputAtt + kInputAttRT in
ain = ainput*(iInputAtt + kInputAttRT)
is really zero? perhaps you can try
printk 1, iInputAtt + kInputAttRT

Something seems wrong here. Can you post a minimal example that displays this behaviour? Maybe there is something else at fault here.

Thank you for the responses, your suspicions were correct. Last search and replace I did replaced something I didn’t intend and the kInputAttRT variable was being modified in a completely separate part of the code (facepalms). Thank you for the replies, user error, nothing to see here :stuck_out_tongue: