Bigger Shader Audio Buffer

Im making a phase locked oscilloscope with the new Scene stuff. Kind of like Bigwigs, so it doesn’t scroll so fast. I got it locked to a single cycle pretty stable, but it bugs out at lower notes - looks like right around G3 and below. Honestly Claude has done most of this and its suggesting the amount of samples the Shader node can load isin’t big enough to capture a full cycle at lower notes. The request is to see if maybe that could be exposed as a parameter on the node, or any other solutions to this.

I’ve attached the patch with the node as it is, and you can see the problem. If its any extra motivation to take a look its part of a UI module library ill share at some point.

Since im just a monkey in this situation the following is Claude’s suggested message which is a bit better at explaining the situation.

I feel like i should also mentioned i’ve roamed the earth for years looking for somthing like MNodes - all the existing nodal networks, and evening dedicating a year to software dev to make it myself. Then Mnodes appears and suddenly my prayers are answered - I’m all in on this project!

I've been building a triggered oscilloscope with the Shader node (MNodes 1.1.5) using the In A audio texture, and I've hit a limit I think comes from the waveform data rather than my code.

The scope finds a rising zero crossing in the waveform row of iChannel0, measures the period from successive crossings, and draws one locked cycle. Above roughly G3 (196 Hz) it works really well: the wave sits still and stable. Below that it falls apart. The trace ghosts and jumps between frames, and it gets worse the lower the note.

From testing, I suspect the waveform row only holds around 10 ms of audio. Locking needs at least one full cycle in the window, and ideally two to measure the period reliably. A G3 cycle is about 5.1 ms, so two cycles fill roughly 10 ms, which is right where it breaks down. Below about F2 (11.5 ms per cycle) not even one full cycle fits, so there is nothing a shader can lock to. The ~10 ms figure is my estimate from that breakpoint (it would also match a ShaderToy-style 512-sample row at 48 kHz). I couldn't find the actual length in the docs.

A few questions:

How many samples does the waveform row hold, and at what sample rate (full rate or downsampled)?

Are the samples consecutive, i.e. a straight run of the most recent audio?

Would it be possible to make the window longer? Something like 2048–4096 samples (about 40–90 ms) would cover cycles down to roughly 25–50 Hz and make a locked scope work across the whole musical range. Even an option for a longer row, or a separate longer texture, would do it.

As a bonus: the samples seem to have fairly coarse precision. Zoomed in to a single cycle, the rounding shows up as slight jitter in the trigger point and small kinks in the trace. Float precision for the waveform row would clean that up completely.

Its saying new users can’t upload attachments - anyway i could get that removed and ill follow up with the patch?

You were right: the Shader only gets a short piece of the sound, too short for low notes.

In the next update there’s a new one called iWave, with a much longer piece of the sound, enough for the lowest notes. Ask Claude to use iWave instead of iChannel0 and your scope should hold still all the way down. I’ll post here when it’s out.

And thanks for the kind words :slight_smile: