monome / crow

Crow speaks and listens and remembers bits of text. A scriptable USB-CV-II machine
GNU General Public License v3.0
167 stars 34 forks source link

'window' input mode behaving unexpectedly #494

Open dndrks opened 1 month ago

dndrks commented 1 month ago

repro script (confirmed both with self-patching output 1 to input 2 and sending from another module):

-- self-patch output 1 to input 2
function init()
  input[2].mode('window',{-2,1,2,4},0.1)
end

input[2].window = function(c,d)
  if d then
    print('hello')
  else
    print('goodbye')
  end
end

when we hit any of the window values (eg. 2V), there's a deluge of salutations/valedictions printed. i assumed that the hysteresis argument would buffer against this, but perhaps i'm misunderstanding its function? <333

xmacex commented 1 month ago

I tried the above script via druid, yes I get the same behavior. I put a little counter inside the handler before the if statement, and that is unstable. Many events are happening during physically plugging or unplugging the jack, something like 5-20 but once a few dozen. Not as many salutations/valedictions¹ get printed.

Newest crow firmware and druid 1.1.5 running on norns, I reset my norns before trying.

¹ I learned a word today.