Stethoscope cycle rate

Is it sensible to set Stethoscope().cycle_(s.options.hardwareBufferSize)


This is from the Stethoscope documentation for .cycle_(val)

Exactly how should one adjust the .cycle_ value for an x/y scope of a periodic signal such as SinOsc ar: [108, 120]


I’ve been setting .hardwareBufferSize_ & .cycle_ both to 4096… without a clue.

If you are scoping a periodic signal, setting cycle to match the signal’s period will keep the waveform locked in place.


How would one set .cycle_ to match the signal’s “period” ?

Is this a way of saying to set .cycle_ to match the periodic signal’s ’cycle rate’ ?

The signal’s period (in seconds) is the reciprocal of frequency. To get the period in frames, multiply this by the sample rate:

periodFrames = s.sampleRate / frequency

This is mostly correct. If the signal’s period is not an integer number of frames, it will drift somewhat because this number ultimately gets rounded (you can’t count a fractional number of frames).

~test = {\ * 0.1}.play;

~left = Stethoscope(s, 1, 0);

// try to lock the waveform in place:
~left.cycle_(s.sampleRate / 108);
~left.cycle.postln; // not an integer -> drifting

// ...if you use integer periods, it locks:
~test.set(\freq, s.sampleRate / 196);

And to be honest, I have no clue if hardwareBufferSize has any effect.