Rate-limiting led messages

Hi,

Is anyone of you rate-limiting the led messages you send in your apps to the serialosc server?

While working on a SuperCollider app (example code for documentation purposes) using an arc2 2012 edition and a monome 64 2012 edition all leds on the grid often stop working and black out. Restarting serialosc does not help. Reattaching the grid seems to be the only way to fix the problem.

The problem could have to do with the app sending too many messages (“/grid/led/level/map”) in too short time. I suspect this since the visually oriented app I work on lets the arc2 control all 64 grid leds with various brightness, each encoder “enc/delta” message practically gets transformed into a “/grid/led/level/map” and as you might know the optical arc2 encoders are very sensitive.

Another interesting observation is that I’ve only gotten the grid to error out while turning both encoders on the arc2. It never happens when I use one encoder solely.

I’ve tried searching for similar reported issues but cant find any. Does the fact that I need to reattach the grid imply that the monome firmware crash? If anyone else is doing rate-limiting, how do you go about? What rate is reasonable?

If anyone of you with an arc and vari-bright monome want to try my SuperCollider code out let me know and I’ll post the code.

/Anton

it sounds like your app is event-driven, ie. refresh happens on new key/encoder data. this indeed may lead to super-insanely-fast LED refreshing, which you actually can’t even visually distinguish.

a different approach (that used in the module firmwares, and MP js in max, for example) is timer-driven. basically “events” like key presses etc set a dirty flag if they do something that requires a visual update. then the refresh routine operates on a timer (30ms is plenty) and checks the dirty flag-- then does a refresh if needed. this way execution is much more predictable, and you’re saving a ton of cycles.

note that you can clog the OSC pipes, which is a totally different but related issue.

would be good to see the code to assess your methods.

1 Like

This sounds like it could also be a power issue. What kind of computer / USB ports are you going through? Using a hub?

@tehn i’ve noticed the same thing on the 2012 series, but with led/level/set messages. sometimes the first quadrant will completely crash, requiring re-pluggling the device.

for example. this crashes the first quadrant 100% of the time


----------begin_max5_patcher----------
846.3ocyX0tiiBBE82sOED+saqnsVceU1rYBpLVlAgt.1Oxj4ceQPmZmZsjl
oclzjZ8hfmy8b3Bz2lNwKiuGK8.+F7GvjIuMcxDSnl.SZuehWEZeNEIMOlWN
upByTd911T38JSbzyJr.jSI4uRXk.0ZLPwKKoXev+pQEBDSAffZYMhRO.xEH
4ZrDrinVCfKARbNmUH6F0MHU9Z8v7j.mqrnCFmNaoO.FlNKvGDkXtDFLK.72
1NwpqHLJVYvIrMHovfNd1K+JLoa3kpCTrIt2w9xqUccNnI36Sm17kui4kJrT
hJwmkWlWwY7J77RAoXNEWLWyePvXDMIngZvjElKV9FF1inVjpNrAa6gm2v4f
vAxAKbMG.ugbfUvGiaAF1.gwMWVF088koFQa09n0MHApBq8YOgYnLK7CbT8g
I2Slyv6zujyDeMXEbvxf.GxIV8Nd40k6LDqzcIGFeOIdlgQXQ2HtEIXZMxzl
DKHHJWlC+nUBd2VhjjQnD0g9JE+4mk31Lhw+2elMkm+JtPWCoTlK3TZec2Tw
QsVvqKW2Ot0gr97NXaX64MjUVwKNwSkwEEZp0KxkmuFk.sUjLl5vEiNe02Zr
8s+rmVdVpalNaqeodiI1HQYaI7tpMGGw9Fgngk8Eec98Mn7WAAMeFwvGFal8
GlrxX3iu45aQCvwf6pYuVo3rQnVzhPCaVtpyDbMqvHykGnHV52PML8J2E7Jv
wxHiv6VIM45R5I00uVIrUeCztl0YlcvJuvT0NN0Md6OF8GP0ct.d3W3LYAdC
lU.Na6K5RmX57lZ0iTRLzjVhhr6jIM4lmhOP1H5dZFpPJAYetRPu9J1gPiaG
ZYYiS3xziRjFc2b812OSNmVWwLgRGXycWNyH36NoWW12X.mFmrOer.ShnI9o
oOIuVj2QyV8AbLSTfkJBCoH55lGeF3oOzZRQAl0m8EDYSBo3x6F2U3zri2eR
3ooN5UwS3OL3r3wgmDWjq3GGdBb.OON2iKp0mf78FNPWfC7g.mUtlcBeHvI0
A3r5GkVk93JK6Pt4VmkaWBCsYyVrP1NjFfnWd+Et47bq7M2RX1aM64zSfaNa
p84MmsPexJ8Z+J8B+0B65o6is+AJdMGUTvpIsazP+lee5+AdDHGd
-----------end_max5_patcher-----------

Yeah it’s event.driven with super-insanely-fast LED refresing. I considered a timing based solution but as I’m writing documentation for SerialOSCClient I did not want to make code too complicated.

I’m a bit worried on the device crashing. It sounds like @elquinto is experiencing the same thing. I do not use Max/MSP anymore though so I cant try the patcher code above.

My code:

  • Drop new version of SerialOSCClient into the SuperCollider Extensions folder overwriting any previous sc file, and recompile SuperCollider class library. SerialOSCClient.sc (31.2 KB)

  • Plug in a grid and an encoder - this should work for all sizes.

  • Evaluate the code in this Gist:

Grid presses in first top left quadrant positions a dot that may be resized with encoder 1. Encoder 2 let user control transparency. Using both encoder 1 and 2 simultaneously mostly crashes the grid for me (both on Windows 10 and OSX Snow Leopard). There is no sound. I wrote this code when toying around with “/grid/led/level/map” and vari-brightness.