trying to understand how poke/index/buffer works

Harry C's icon

reading the documentation is one thing, and actually trying to get them to work is another. And I'm having trouble with actually getting them to work.

The end goal is trying to read the data that I get from Arduino, and plotting it along the x (time) axis. Sounds pretty simple. so I was able to connect the Arduino to msp. I intended to save the data in what I understand to be buffer~/poke~, and then read it using index~. It didn't work. I'm getting a flat line, even the data read from Arduino is moving.

So I've decided to make it simple by producing a sine wave using a cycle~, and then save the measurement from there into poke~. I'm still getting nothing from index.

I'm pretty lost at this point. Clearly I'm not fully understanding how to use poke~ and index~ to plot the data.

What did I do wrong?

👽'tW∆s ∆lienz👽's icon

works for me:

did you give buffer~ a size?

Harry C's icon

ohhhh that totally makes sense. I thought the duration is automatically created.
what's the purpose of @samps in your screenshot?

👽'tW∆s ∆lienz👽's icon

samps is the size in samples(it's documented under the 'samps' tab of the buffer~ helpfile), otherwise, buffer~ can be sized by milliseconds with normal arguments