jamoma / JamomaMax

Implementation of Jamoma for Cycling'74 Max:
http://www.jamoma.org
41 stars 9 forks source link

j.ramp~ doesn't work outside of its help patcher #214

Open hems opened 11 years ago

hems commented 11 years ago

see in patcher below

furthermore, when j.ramp~ (+ oscilloscope) is copied from the help patcher to another patcher, it keeps the last signal !!!


----------begin_max5_patcher----------
452.3ocyT9sSCCBEF+51mBBWWIv5eVm24ygwXXs3jkVnAX5Ti9ra4ParSqIS
clrcwYkON8v24WnmWhivq06EVL5Rz0nnnWhih.IuPzv5HbKeeUC2BogsU5Nw
a3jvVxZPTud6E4iZpcsRUivA4u3CQ8N2nJcPsi6ptWp1bqQT4BtXQFglfVAQ
VJ0+WdNghtw+FuFG6CIGoWaEVKeiXzXNwd3PvTResIHFs+2LcxhQs6zJmh2J
fctxH4M+fdjMoHV4yPQXKHisdHS2SchPeiwna9dpvRW4IQ.NkL.NkmXpbAkj
ixmGIomeHIeBQJV8uPDJY4LrH67iEAJLD+arPIdruI+BJ1RL71t49tu7jfiz
eHNrxMJ+AL8oi.QEPbYJ.JpGQCuQktQaBYRIErUEzxDDL8gRRKnKKy7Osj1u
C6WwUwy07p43G6jN3jE5vL5X7.yBsKtQp97Lendd8C6.qdmoZD4CiFQe.sZg
0IUbmTqljS4A4burtVnl58ZokutQ.DfNKIOV2jdV4lryJ2TdDtI+W5lv0HdW
2CBicnjfQ5uxuM7YTQBrTpBKgocXi3A4X9gD3l9qwt96v6Lg4F6KKvw9y403
2IThyiF
-----------end_max5_patcher-----------

see more on the original redmine issue http://redmine.jamoma.org/issues/1247

theod commented 10 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.

theod commented 8 years ago

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 !

theod commented 8 years ago

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); }

theod commented 8 years ago

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.

tap commented 8 years ago

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?

theod commented 8 years ago

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.

theod commented 8 years ago

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-----------
theod commented 8 years ago

you'll just need to put a break point into TTRamp::processVectorAccurateDown and TTRamp::processVectorAccurateUp to see how things goes during the ramping.