A "real" oscilloscope

I’ve been working on making a proper oscilloscope in Touch to look at audio and CV coming from my modular synth. Check it out:

github.com/kamindustries/td-scope

Note that you may need to change the settings of the Audio Device In CHOP to match ones for your machine. When in doubt, just swap it out for the Audio Oscillator next to it to verify the oscilloscope is working.

I tried to document most of it in the repo’s readme, but I’ll give you a quick rundown here too. It works in a conceptually similar way to a real oscilloscope in that it synchronizes its display based on a trigger- some point on the signal. You define what the trigger is: greater than or less than some value, or within a small range of some value. You also need to specify the slope sign, either positive or negative.

It works by picking through the audio buffer to find a sample that matches the trigger, then passing the index of that sample to a shader. The shader slides the vertices of a line around so that the samples with matching triggers line up on the x axis, and the Y axis displays the sample’s value.

It’s fairly accurate and more or less matches the output of dedicated software oscilloscopes like TrueRTA, but mine is more fun to look at :smiley:

It only works with one CHOP channel right now, but I’d like to add support for at least two. I’m not sure how I’ll handle the UI for two+ channels since I’ll probably want the option to use the same trigger as channel 1, or to use a unique trigger for each channel. For maximum performance, I may move script_get_trigger_id to a C++ CHOP in the future.

3 Likes

Nice share!

I logged an “isssue” on your repo. Might not be worth chasing that optimization, but I thought you might find it interesting.

Awesome, thanks for the tip Matthew. I “resolved” the “”“issue”“” :]

Modular! Hey I have one too. We should compare notes!

Awesome tool by the way. Thanks!