Open hems opened 11 years ago
not sure what is going wrong here … @lossius : could you look at this ? I can do the c/c++ part if it is too complex.
I found where the trouble happens but I'm not sure of what to do to fix it. it seems to be related to how we use the Max sdk so I add @tap to this issue.
when I send the message (-0.5 5000) to j.ramp~ I can see that the passed values are not correct inside ramp_list : the endValue is 0 and the time is 6.9532229753399076E-310 !
maybe the way the ramp_list method is attached to j.ramp~ is bad ?
void ramp_list(t_ramp x, double endValue, double time); [...] class_addmethod(c, (method)ramp_list, "list", A_FLOAT, A_FLOAT, 0L); [...] void ramp_list(t_ramp x, double endValue, double time) { x->ramp->setAttributeValue("destinationValue", endValue); x->ramp->setAttributeValue("rampTime", time); }
trying to use A_GIMME to handle any list result in strange behavior where the number of received argument is not 2 but something like 435678932 ... something goes bad into the memory here. I assign to @tap as I'm not sure @lossius will be able to fix this.
You are correct that this call is trouble:
class_addmethod(c, (method)ramp_list, "list", A_FLOAT, A_FLOAT, 0L);
The list method must be A_GIMME.
The the prototype for ramp_list()
must have the correct signature (both in the prototype and the definition):
void ramp_list(t_ramp *x, t_symbol *message_name, long argc, t_atom *argv)
Is it possible that you forgot the t_symbol*
argument in the prototype?
I've resolved the problem and now the attribute are correctly passed to the internal TTRamp object. however it seems there is something bad into the C++ code as the value never change.
here is a very simple patcher to test :
----------begin_max5_patcher----------
448.3ocuT1rajBCCG+L7Tfx4YQNv.LcusOGqVUkAbmlQPBJIzcZqZe1KwA1R
+RcTUYuXRbbr+6eXk6iiX60mPKK4mI+NIJ593nHxk2Qzz9HVm3TcqvRgwr05
d7Q1lvQ8BW80R0gKMXsKjlrsovljKHKOG7eJJRgj+LcE0PmT0hNJcYSNkMTx
06O9iB1yApGbyQBSdstaaQJXl2wCwwdylyT8cn0JNfykvgmHUyfzQwllT..L
eVn1ta6wPewX+qEtRqbV4czA7rT3igAG3d.DXRYEsN6yfgO8JQWnK+kQJZYu
ESYuOl3qJl3iXBVALE3yJPo70jRJ7ui03MP5XpQz0+3GBHq7fxK1kq95Pqjr
U4eiPa2ruZcq1DJFjVxunD14++CdSdITsaqeUELdBeYcWP57uERi20Hp+7Gc
3AXrElsm8iN7uzqNT5YsR0qeBkTn2+K6IqdvTOOFLQ5jmEYCZcRkvI0pEwT7
hXtV1zfpkRqQZE6aQpWf2ksmqZxOC0r6+lZxVQ0D9wI56uAM1oTRBYbr6XXj
uZCsUpBaoWLXF7F4b7TMXBy3nnabNbvDlONUtkEtptAMpAIc6XekeH9If9Yq
jB
-----------end_max5_patcher-----------
you'll just need to put a break point into TTRamp::processVectorAccurateDown and TTRamp::processVectorAccurateUp to see how things goes during the ramping.
see in patcher below
furthermore, when j.ramp~ (+ oscilloscope) is copied from the help patcher to another patcher, it keeps the last signal !!!
see more on the original redmine issue http://redmine.jamoma.org/issues/1247