Forums > MaxMSP

how many bang in a sec

September 11, 2008 | 7:43 pm

dear Reader,

I wanted to see how many bangs I get in a sec, so I made a small circuit.
Is there an object or an easier way to do the same?

best,
Krisztian

{
"patcher" : {
"fileversion" : 1,
"rect" : [ 1443.0, 127.0, 299.0, 263.0 ],
"bglocked" : 0,
"defrect" : [ 1443.0, 127.0, 299.0, 263.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"metadata" : [ ],
"boxes" : [ {
"box" : {
"maxclass" : "button",
"patching_rect" : [ 84.0, 212.0, 25.0, 25.0 ],
"numinlets" : 1,
"id" : "obj-13",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"presentation_rect" : [ 115.0, 286.0, 0.0, 0.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"patching_rect" : [ 26.0, 215.0, 43.5, 18.0 ],
"fontsize" : 12.0,
"numinlets" : 2,
"id" : "obj-12",
"numoutlets" : 1,
"outlettype" : [ "" ],
"fontname" : "Arial",
"presentation_rect" : [ 40.0, 267.0, 0.0, 0.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "smal cicuit to see how many datas I get in a sec",
"linecount" : 2,
"patching_rect" : [ 107.0, 74.0, 150.0, 34.0 ],
"fontsize" : 12.0,
"numinlets" : 1,
"id" : "obj-9",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"patching_rect" : [ 51.0, 189.0, 32.5, 18.0 ],
"fontsize" : 12.0,
"numinlets" : 2,
"id" : "obj-7",
"numoutlets" : 1,
"outlettype" : [ "" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "button",
"patching_rect" : [ 10.0, 81.0, 25.0, 25.0 ],
"numinlets" : 1,
"id" : "obj-4",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"presentation_rect" : [ 452.0, 190.0, 0.0, 0.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"patching_rect" : [ 10.0, 152.0, 25.0, 25.0 ],
"numinlets" : 1,
"id" : "obj-3",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"presentation_rect" : [ 481.0, 279.0, 0.0, 0.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 1000",
"linecount" : 2,
"patching_rect" : [ 10.0, 113.0, 42.0, 33.0 ],
"fontsize" : 11.595187,
"numinlets" : 2,
"id" : "obj-2",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter 0 0 1000",
"patching_rect" : [ 66.0, 122.0, 197.0, 20.0 ],
"fontsize" : 11.595187,
"numinlets" : 5,
"id" : "obj-55",
"numoutlets" : 4,
"outlettype" : [ "int", "", "", "int" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "number",
"patching_rect" : [ 66.0, 158.0, 50.0, 20.0 ],
"fontsize" : 11.595187,
"numinlets" : 1,
"id" : "obj-58",
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "button",
"patching_rect" : [ 67.0, 67.0, 25.0, 25.0 ],
"numinlets" : 1,
"id" : "obj-69",
"numoutlets" : 1,
"outlettype" : [ "bang" ]
}

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

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

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

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

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

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

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

}
, {
"patchline" : {
"source" : [ "obj-69", 0 ],
"destination" : [ "obj-55", 0 ],
"hidden" : 0,
"midpoints" : [ 76.5, 122.0, 75.5, 122.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-55", 0 ],
"destination" : [ "obj-58", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}

}


September 11, 2008 | 7:57 pm

hi Krisztian

Can’t open your patch cos I am on my PC for interenet use only .

not quiet following you though ????!!! how many bangs in a sec ? Well I guess it’s what ever you want it to be , there are not set rules for this .


September 11, 2008 | 8:26 pm

hi ongo,

I just want to check how many data I get per sec from an EEg device. I receive a raw data in a list from Quartz Composer, through OSC.
I would like to know how frequently I get the signal changes.

best,
Krisztian


September 11, 2008 | 9:02 pm

there are probably quite a few ways to do this, here’s another way…

j

– Pasted Max Patch, click to expand. –

September 11, 2008 | 9:19 pm

like it J
thanks


September 22, 2008 | 7:29 am

tedor schrieb:
> I wanted to see how many bangs I get in a sec, so I made a small circuit.
> Is there an object or an easier way to do the same?

It is a very good method, it has the advantage over tedors zl group,
that it recognizes also zero events…

I made a mod with exactly the same idea, but the way I would do it.
If the counter has no arguments, you can count more than a fixed number
of events…

The inlets and outlets will let you use it as abstraction. A parameter
would define the reporting interval (default 1000), which can also be
determined by the second inlet…
You can call it bas.persecond for example and start to create your own
collection of useful abstractions…

– Pasted Max Patch, click to expand. –


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


September 22, 2008 | 2:21 pm

Unless all you’re going to do is *count* the number
of bangs you can possibly get, this seems like a
sort of silly operation – any other sorts of processing
you do will have an effect of the bang rate, and
an otherwise interrupted bang count, while interesting
in the way that disputes on Byzantine theology may
be, doesn’t really buy you much. Are you flashing
LEDs and yanking faders? Are you calculating orbital
trajectories? Are you shipping stuff out on a network?
I’d expect a "maximum number of bangs" to be a very
different matter, provided you’re concerned about
doing *anything* else.

In general, I would advise anyone who’s asking those
sorts of questions to think seriously about writing
externals.


September 22, 2008 | 8:15 pm

_Is a good idea to let the 0 to be seen.
_
Writing externals; Xcode (C) still scares me a bit, but of course, after a few years of wiring and coding (SC).

best,


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