Hello,
I have a variable, that gets set by an incoming osc message. If there is no incoming osc message for a certain time, I want to set it to 0. Is there a more elegant solution than the following code?
instr 1
    kvar init 0
    kcount init 1000
    nxtmsg:
    kk OSClisten gihandle, "/adress", "f", kvar
    if (kk == 0) goto ex
        print 0, kvar
        kcount = 1000
        kgoto nxtmsg
    ex:
  
    kcount = count - 1
    if (kcount == 0) then
          kvar = 0
    endif
    outletk "outlet", kvar
endin
        

      
    