how to set more then one LED active?

  • Hi,
    i´m using a "prepend /grid/led/set" object in a patch, where i send the button and it´s state, for example: "0 0 1"
    this works just fine, but how would i activate four buttons at the same time?

  • Many ways to do this ...
    For instance, a message "$1 $2 $3" in combination with [pack 0 0 0]. In many cases, [uzi] can be useful as well.

  • bitmasks:

  • thanks, chapelier fou and red, i´m new to max, would you mind giving me a small example?

    for instance, /grid/led/map, how would i pass the info which LEDs to activate?

    thank you!

  • ----
    For instance, a message "$1 $2 $3" in combination with [pack 0 0 0].

    but wouldn´t that lead to single message like 0 2 1 again?

  • "but wouldn´t that lead to single message like 0 2 1 again?"
    Yeah, which would light on column 0 row 2, isn't it what you're after ?
    If your looking for examples you should see the monome test example (serialosc-test, monitor what the matrixctrl outputs) .

  • not really, i´m after a good way to activate more then one button LED at the same time, i will try your [uzi] suggestion once i get home, i think this could work as i need it.


  • Uzi is just good for adjacent buttons.
    if you send "set 0 0 1" and "set 1 0 1" it will light on the 2 first buttons of the first row.

  • oh, i thought i could send send "set 0 0 1" and "set 0 1 1" and light up the first button of two rows as well, or any button for that matter.

    red wrote to use bitmasks but i find it hard to grasp how it works-

  • I am also curious to know how practically are people using bitmasks...

  • Check out this thread. Some pretty good explanations and discussions about bitmasks.

  • Ok, very interesting. So, the purpose is CPU efficiency.

  • this was a very interesting read, i´m now using bitmasks :)


  • Most apps only require small state changes, and not all that often. (one or two LEDs toggle on the beat, or when a button is pressed) For those apps, monome's protocols are fast enough that you'll get away with setting one LED at a time. And there are optimizations you can make in your code which help a lot (by just avoiding redundant messages; if the LED's already on, don't try to turn it on again).

    Scrolling a grid-sized window around a larger virtual grid ("soyuz", "plane", etc) is typically where you'd run into bottlenecks that bitmasks alleviate. "trails" is also animation heavy. When you're building something along those lines, it becomes important.

    For me, it's not about CPU efficiency so much as getting the data through your USB port fast enough...