To create scope~ that displays only one cycle of the buffer
Hello,
Question1:
My buffer looks like the below image. It has 800 samples and the buffer size is 100. I am wondering how to display only one cycle of this buffer into scope~ .
Question2:
I have one more quick question. For the below buffer image, I actually did "jit.buffer~ myWave 100 1" to put 800 samples inside. The buffer length 100 was just my assumption to make enough space, but I would like to know how to set up the buffer size that fits exactly into 800 samples. Thank you.

you can adjust the scope´s size to whatever you want, in samples, see helpfile.
you might need to restart audio to make the waveform start the correct position.
buffer size can also be set in samples since more than 10 years - ms is default but you can change that to samples.
btw, typically you would rather use cycle~ or wave~ to loop, but it is not an obligation.
Thank you @ROMAN Sorry for confusion. I know how to adjust the scope size in the inspector window :) My question was how to calculate the scope~'s size so that the scope~ can only display one cycle of the waveshape, if so the shape of the signal in the scope will look like a static image (instead of moving from right to left). For my second question, the buffer "myWave" is not a sine wave, it came from the circle image I drew, so I use jit.buffer on purpose. My second question is also about how to calculate the sample size that the buffer window doesn't have an empty area like the image above. Again, sorry for making you confused. Thank you.
don´t worry, i was born confused.
i am pretty sure i saw it somewhere and when i saw it, i was quite suprised that scope allowed float values for the samples-per-pixel.
but when i try myself it of course does not do that. :/
so you can only match the display to frequencies which correspond to a duration of an integer sample count.
"4410" -> [samps2ms~] -> [!/~ 1000.] -> [cycle~]
in other words, you need a second copy of that same oscillator (cycle~, wave~, index~, whatever you use) and then you can find a frequency which matches into the allowed range of 2-8092 ( divided through the vertical size of your scope) without moving around.
in other words: displaying the buffer content using lcd, mgraphics, jit.buffer and so on probably makes more sense.
Thank you so much. @ROMAN I am afraid that I am not smart enough to understand the formula. I first thought does Max have the samps2ms~ object? Haha. I would be delighted if you could take a look at my max patch and show me how to apply your formula? You need to download the aif file to read the buffer. Thank you so much for your help.
would like to know how to set up the buffer size that fits exactly into 800 samples
a quick note first, though, your "tear2.aif" file actually has blank space in it(more than 800 samples), but if you were able to make the file exactly 800 samples of only the waveform you drew, then you could simply use "replace tear2.aif"(instead of "read tear2.aif") to fill the buffer with the exact amount contained within the file(see in the jit.buffer~ helpfile, it says that jit.buffer~ responds to the same messages as buffer~, so you can use messages like "replace", etc.)
however, since your file is not exactly 800 samples, instead you can first send jit.buffer~ the message: "sizeinsamps 800" to make it exactly 800 samples in size, and then use the "read tear2.aif" message as you did(in this case you don't use 'replace', because you want the buffer to stay the size you specified, while simply reading the file's content within that allotted size).
I first thought does Max have the samps2ms~ object?
it does, if you ever need it it's spelled "sampstoms~"....but even with this formula, scope~ is better for viewing a constantly changing waveform, rather than an exact static visual of one cycle stored in memory... this is why Roman was suggesting you use jit.lcd or jit.mgraphics to view your waveform.
with scope~, you can get close with settings like what i did here, but it's not an ideal solution because the drawing-parameters depend on its display-size in pixels... it's hard to translate samples to pixels accurately:

"it does, but it´s spelled differently", lol.
^hehe, i wasn't sure if they knew about it or not, just making sure :D
(and hope you don't mind, Roman, just stepped in to assist after checking out their recent patch, thought i'd give it a try)
Thank you @RAJA Right, I found out that my buffer has more than 800 samples because I created the aif file just from the same "jit.buffer" (just like the image below). BTW "sizeinsamps 800" perfectly works. I should use this when I create an aif file too.
Like you and @Roman suggested, I will try jit.lcd or jit.mgraphics to display the waveform. If this is a better way to display the waveform for my purpose, I better use them :) Thank you so much for your (both) help!!

i should clarify: jit.lcd and jit.mgraphics are more advanced, so they can offer special features to allow for more detailed waveform views. but the easiest for your purpose would probably be just viewing the buffer itself using the "waveform~" object. i think this is what Roman meant by mentioning viewing it by "jit.buffer~"(since "jit.buffer~" works similarly to "buffer~", you can use the "waveform~" object to view the contents of "jit.buffer~" too).
hope that makes more sense and helps 🍻