Forums > MaxMSP

Peak

November 13, 2008 | 5:30 pm

Dear Reader,

I would like to get some help concerning the following issue.

I am having a changing flonum. The number moves like a wave (EEG). I would like to receive a bang when the wave reaches it’s peak point or even better if I could receive bangs while it is "riding the top of the wave". Please have a look on the attached picture, as it describes my wish more than my crappy English.

I had a look at objects like peak, peek~, peakamp~ but I could not use them for this purpose.

I guess I just need an object which sends out a bang whenever a changing number starts to decrease.

Any help appreciated!

All the best,
krisztian


November 13, 2008 | 6:45 pm

have a look at the change object helpfile.

justin


November 13, 2008 | 7:54 pm

thanks Justin!

is there a more forward way?

code:

{
"boxes" : [ {
"box" : {
"maxclass" : "newobj",
"text" : "onebang",
"numinlets" : 2,
"id" : "obj-7",
"fontname" : "Arial",
"numoutlets" : 2,
"patching_rect" : [ 302.0, 349.0, 57.0, 20.0 ],
"outlettype" : [ "bang", "bang" ],
"fontsize" : 12.0
}

}
, {
"box" : {
"maxclass" : "button",
"presentation_rect" : [ 354.0, 435.0, 0.0, 0.0 ],
"numinlets" : 1,
"id" : "obj-6",
"numoutlets" : 1,
"patching_rect" : [ 354.0, 435.0, 20.0, 20.0 ],
"outlettype" : [ "bang" ]
}

}
, {
"box" : {
"maxclass" : "number",
"presentation_rect" : [ 218.0, 79.0, 50.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-5",
"fontname" : "Arial",
"triscale" : 0.9,
"numoutlets" : 2,
"patching_rect" : [ 213.0, 96.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "button",
"numinlets" : 1,
"id" : "obj-14",
"numoutlets" : 1,
"patching_rect" : [ 265.0, 270.0, 20.0, 20.0 ],
"outlettype" : [ "bang" ]
}

}
, {
"box" : {
"maxclass" : "number",
"presentation_rect" : [ 81.0, 373.0, 50.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-15",
"fontname" : "Arial",
"triscale" : 0.9,
"numoutlets" : 2,
"patching_rect" : [ 213.0, 216.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "number",
"presentation_rect" : [ 81.0, 427.0, 50.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-16",
"fontname" : "Arial",
"triscale" : 0.9,
"numoutlets" : 2,
"patching_rect" : [ 213.0, 270.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "change 0 +",
"numinlets" : 1,
"id" : "obj-23",
"fontname" : "Arial",
"numoutlets" : 3,
"patching_rect" : [ 213.0, 241.0, 68.0, 20.0 ],
"outlettype" : [ "", "int", "int" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "button",
"numinlets" : 1,
"id" : "obj-3",
"numoutlets" : 1,
"patching_rect" : [ 469.0, 270.0, 20.0, 20.0 ],
"outlettype" : [ "bang" ]
}

}
, {
"box" : {
"maxclass" : "number",
"presentation_rect" : [ 15.0, 15.0, 50.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-27",
"fontname" : "Arial",
"triscale" : 0.9,
"numoutlets" : 2,
"patching_rect" : [ 417.0, 216.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "number",
"presentation_rect" : [ 15.0, 15.0, 50.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-28",
"fontname" : "Arial",
"triscale" : 0.9,
"numoutlets" : 2,
"patching_rect" : [ 417.0, 270.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"fontsize" : 11.595187
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "change 0 -",
"numinlets" : 1,
"id" : "obj-29",
"fontname" : "Arial",
"numoutlets" : 3,
"patching_rect" : [ 417.0, 241.0, 65.0, 20.0 ],
"outlettype" : [ "", "int", "int" ],
"fontsize" : 11.595187
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-7", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-6", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-27", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-3", 0 ],
"hidden" : 0,
"midpoints" : [ 426.5, 265.0, 478.5, 265.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-28", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-29", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-14", 0 ],
"hidden" : 0,
"midpoints" : [ 222.5, 265.0, 274.5, 265.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-16", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-15", 0 ],
"destination" : [ "obj-23", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}


November 13, 2008 | 8:15 pm

what’s wrong with what you have? seems pretty straight forward, and it works…

justin


November 13, 2008 | 8:31 pm

ok, you are right, I will not worry much about it than…
thank you,
best


Viewing 5 posts - 1 through 5 (of 5 total)