Distinguish between signal and message first inlet?

sletz's icon

Writing an external, I understand that an object that process one audio input (so a "signal" type) and handles some control messages will have a single inlet that deals with both signal and messages right?

Assuming I would like an object with only control messages and no audio input, it will still have one single inlet. Is there any way to distinguish this from the first case?

sletz's icon

I'm actually looking at the maxpatch JSON format, containing for instance a simple noise~ object.

noise~ documention says that if has "no argument", but the object has a single input (which can actually be connected with a signal or control input), and the JSON code is:

{
    "box" : {
        "id" : "obj-1",
        "maxclass" : "newobj",
        "numinlets" : 1,
        "numoutlets" : 1,
        "outlettype" : [ "signal" ],
        "patching_rect" : [ 102.0, 89.0, 46.0, 22.0 ],
        "style" : "",
            "text" : "noise~"
    }
}
For what I see I can not distinguish this noise~ JSON code from an object that would process a single audio signal input and also have some control message (so using the same single input).

Roman Thilenius's icon


from outside it is always the same.

and as you might know, for most objects which do not take float/int for something else at a signal inlet, sending a number into a signal inlet of an external usually multiplies the signal if a signal is present.

but i would guess you can define it somewhere manually when developing externals, similar to "hot or cold".

sletz's icon

Loogking at the JSON format again: there is this "outlettype" : [ "signal" ], line that does give a type to each outlet, but there is no equivalent fo inputs, why that?