Anything wrong with doing this? || Buffer Length
-
@Chazrox Did you even try 1 sample? You can't really see any useful information with just 1 sample. Even at the lowest sampling rate of 44.1kHz, I think that only equates to like 20~ microseconds in time (that number is probably wrong, but it's something like that).
But either way, setting the Buffer Length to to a float instead of an integer will either round the number to the closer integer or crash. It's not possible to go below the sample rate.
-
@HISEnberg I tried it. Its useful for what I want it for and it just looks like what Im trying to get out of it so im wondering if its safe.
-
@HISEnberg Ideally I would like it to just show 1 cycle of the wave but im not sure how to do that so im kind of settling for what I have as well. Do you know how I can achieve that? Im novice at this type of stuff. Appreciate the input!
the pic above looks like its showing 1 cycle but when its moving the visual feedback is moving to much. I want it to show the waveform edges to change but not "cycle" if that makes sense. I dont want the signal to look like its moving from right to left, but a still visual of the wave shape.
-
@Chazrox That doesn't look correct. You couldn't see a full cycle of the waveform if the buffer length is at 1 sample. You would only ever see a portion of it. Did you hit "Apply" after setting it to 1 sample?
-
@HISEnberg I did. Thats how it looks after pressing apply. As for as I know thats all I did.
-
@Chazrox it's hypothetically possible but realistically it is not doable. Essentially your buffer length would have to be resized to whatever the frequency is. A pure signal (like a sine wave ) is easier since the frequency is stagnant and doesn't have harmonics. But with white noise it would be impossible. Essentially the buffer length always has to be the same size or somewhat larger than the frequency.
This part is chatGPT:
period (samples) = sampleRate (Hz) ÷ frequency (Hz)
At 44 100 Hz sample rate, a 440 Hz sine wave has a period of 44 100 ÷ 440 ≈ 100 samples.
At 96 000 Hz, that same 440 Hz tone needs ≈ 218 samples.
If you set your buffer to, say, 50 samples, you’ll only ever “see” half of the 440 Hz cycle; set it to 10 samples, less than an eighth of the cycle; set it to 1 sample, and you just get a single point that jumps up and down—you can’t reconstruct any shape.
Me again:
You would have to account for the sample rate, and then account for the frequency of the signal. Then you would have to dynamically resize the buffer, which is possible. However, this example only really works for a sine wave, anything else it gets more complicated and then closer to impossible! -
@HISEnberg ahh. I see. Possible, but just a sh** ton of math haha. Thanks for that. That still helps me understand.
-
@Chazrox Ya it's very useful to know. I would just say set it super close if you want that type of waveform display (like 256 samples). It changes based on the sample rate though.
As an aside I don't know why you are seeing the full cycle, that isn't correct. Something is going wrong there. I tried playing a sine wave at ~8Hz , with a 1 sample buffer and it looks like this (44.1kHz sample rate).
-
@HISEnberg I just hit any note on my keyboard tbh so I cant even tell you. It just happened to look like that when I screenshotted it at the time.
edit**
I just tried again and the lower notes look more like your picture.
-
@Chazrox if you move the oscilloscope into the midi chain it will dynamically resize the cycle length to the frequency derived by the note number so you should see a more or less steady waveform.
-
@Christoph-Hart woah... Ok. Im gonna try that asap! Thanks!
-
@Christoph-Hart Wow...game changer!
Thank you sir!