Hi - unfortunately I can't wrap my brain around this one since my C skills are non-existant.
I had a previously modified math/wrap object that replaced the drop down with inputs. While trying to compile a patch with this object on the new firmware and app, I ran into some errors that made me check out the current version of the math/wrap object and it looks very different. What was a simple edit to the code before is now a puzzle to me.
The old math/wrap object had this section in the code:
<inlets>
<frac32buffer name="a" description="a"/>
</inlets>
<outlets>
<frac32buffer.positive name="b" description="quant(a)" SumBuffer="false"/>
</outlets>
<displays/>
<params/>
<attribs>
<spinner name="bits" MinValue="0" MaxValue="27" DefaultValue="7"/>
</attribs>
<code.srate><![CDATA[ %b%= (%a%<<%bits%) & ((1<<27)-1);
]]></code.srate>
I modified it to be:
<inlets>
<frac32buffer name="a" description="a"/>
<int32 name="bits" description="bits"/>
</inlets>
<outlets>
<frac32buffer.positive name="b" description="quant(a)" SumBuffer="false"/>
</outlets>
<displays/>
<params/>
<attribs/>
<code.srate><![CDATA[ %b%= (%a%<<%bits%) & ((1<<27)-1);
]]></code.srate>
the current version is like this:
<inlets>
<frac32buffer name="a" description="a"/>
</inlets>
<outlets>
<frac32buffer.positive name="b" description="quant(a)"/>
</outlets>
<displays/>
<params/>
<attribs>
<spinner name="bits" MinValue="0" MaxValue="27" DefaultValue="7"/>
</attribs>
<code.srate><![CDATA[ outlet_b= (inlet_a<<attr_bits) & ((1<<27)-1);
]]></code.srate>
I adjusted the way the inlets are called but had issues anyway.
<inlets>
<frac32buffer name="a" description="a"/>
<int32 name="bits" description="bits"/>
</inlets>
<outlets>
<frac32buffer.positive name="b" description="quant(a)"/>
</outlets>
<displays/>
<params/>
<attribs/>
<code.srate><![CDATA[ outlet_b= (inlet_a<<%bits%) & ((1<<27)-1);
]]></code.srate>
The errors I get are "expected primary-expression before '%' token" and " 'bits' was not declared in this scope" .
can you give me some clues that could help formulate the expressions correctly?