I noticed that sometimes a bang message gets converted to zero but not always. for example if I send a bang to a number object it dosn't change anything, but if I pass the bang through a pipe object first it changes the number to zero. Does anyone know why?
thanks Oded
Hallo, Oded Ben-Tal hat gesagt: // Oded Ben-Tal wrote:
I noticed that sometimes a bang message gets converted to zero but not always. for example if I send a bang to a number object it dosn't change anything, but if I pass the bang through a pipe object first it changes the number to zero. Does anyone know why?
[pipe] as default stores and delays float numbers. If you bang a [pipe] object it will kind of see it as if you'd send a 0. Funny things will happen if you send something different.
You can make a pipe expect symbols by using it as [pipe s 0]. You also can make pipe expect pointers, but unfortunatly you cannot make it expect variable length lists AFAIK.
See attached example patch.
Frank Barknecht _ ______footils.org_ __goto10.org__
Oded Ben-Tal wrote:
I noticed that sometimes a bang message gets converted to zero but not always. for example if I send a bang to a number object it dosn't change anything, but if I pass the bang through a pipe object first it changes the number to zero. Does anyone know why?
this is because [pipe] is similar to [pack]: you have to specify the type on object creation and the types are then fixed. e.g. [pipe f s 100] can only be used for lists consisting of one float number followed by one symbol, with a delay of 100ms. [pipe] is synonymous to [pipe f 0] (0ms delay of 1 floatingpoint number) banging the [pipe] object will therefore convert the "bang" to a default number "0". is you bang a [pipe s 0], you will get a default symbol "symbol".
if you want to delay bangs, use [delay], or [select] the number output by [pipe] into a bang.
mfg.asdr IOhannes