-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The monome protocol specifies that messages for LED rows, columns, and maps target a "quad", i.e. an 8x8 segment with an x/y offset. The webmonome API reflects this, but I'm wondering if we could add some higher level methods to make it easier to set LED states in one call.
For example, in mlr, a single LED tracks the sample's play position. In JavaScript we might track this with an array of 16 items:
let row = [0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]To convey is to a device, we have to split the array into two chunks of 8, then call gridLedRow twice with offsets:
let chunks = chunk(row, 8) // [[0,0,0,0,0,0,0,0],[0,0,0,0,0,1,0,0]]
chunks.forEach((chunk, i) => monome.gridLedRow(i * 8, rowNumber, chunk))I'm wondering if a nicer API might be:
monome.gridLedRow(rowNumber, row)(and perhaps rename the current methods to gridLedRowQuad, or something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels