Access atoms using SDK v. 8.0.3
Opened this issue · 0 comments
inspiralpatterns commented
I am experiencing troubles in re-using the code I wrote 6 years ago with the new SDK.
Particularly, I am not able to retrieve the value from the atom I pass in to the object at instantiation type.
The code looks like
DLShift(t_symbol * sym, long ac, t_atom * av) {
setupIO(1, 1);
/*init conditions*/
if (ac < 1) post ("syntax error: ratio required");
else {
if (av->a_type == A_LONG) m_ratio = atom_getlong(av);
else if (av->a_type == A_FLOAT) m_ratio = atom_getfloat(av);
else if (av->a_type == A_SYM) post ("not a number");
}
but every time I get something like ratio: 0.00
.
I tried to switch using something like:
if (av->a_type == A_LONG) m_ratio = av->a_w.w_long;
else if (av->a_type == A_FLOAT) m_ratio = a_w.w_float;
but nothing, same response as above.
Has anyone experienced any troubles in this?