SoftScope: A software based Oscilloscope / Vectorscope

SoftScope is an attempt to mimic the functionality of a two channel oscilloscope, where each channel is fed from an stereo audio source. The result, when used with the appropriate audio source, is a vector drawing machine:

Why?

Besides the obvious “why not?”, I decided to create an oscilloscope emulator after finding out about an Assembly 2007 submission called “Youscope“.

I was never able to get it to work correctly and decided to abandon the project.

A couple of days ago I stumbled upon a web site (OSCILLOSCOPEMUSIC.COM) featuring some of the most amazing “oscilloscope music” I’ve ever heard/seen. So I decided to re-take the project.

After re-working the whole rendering code and seeing some positive results I decided it was worth the effort to create a full-featured oscilloscope emulator.

How it works?

The program captures stereo audio data from an audio source (a microphone, the stereo mix virtual device or a wav file) and uses each channel to control a beam or ray that draws onto the program surface.

In order to mimic the way an oscilloscope works, the program controls the alpha (intensity) of the beam by calculating the distance between successive points. Longer jumps are kept hidden (low alpha values) while shorter ones are made visible (higher alpha values).

A simple glow effect is also achieved by drawing each line with a lower alpha value and using a wide brush to simulate a glowing effect.

This is the latest iteration of the rendering code:

Private Sub RenderLine(g As Graphics, p1 As Pixel, p2 As Pixel, Optional alphaMultiplier As Double = 1.0, Optional glowWidth As Single = 6.0, Optional rayWidth As Single = 1.0)
	p1.Alpha *= alphaMultiplier
	p1.Alpha -= (1.0 - rayBrightness) * 150 * Distance(p1, p2) / screenDiagonal * 255
	
	g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias<br>
	Using p As New Pen(Color.FromArgb(p1.Alpha / 1.5, rayGlowColor), glowWidth)
		g.DrawLine(p, p1, p2)
	End Using
	
	If rayWidth > 0 Then
		g.SmoothingMode = Drawing2D.SmoothingMode.None
		Using p As New Pen(Color.FromArgb(p1.Alpha, rayColor), rayWidth)
			g.DrawLine(p, p1, p2)
		End Using
	End If
End Sub

This code has changed considerably and this latest iteration, although not perfect, it’s by far, the fastest one.
Previous versions produced more accurate results, but were too slow for the (not-accelerated) GDI+ painting routines.

Several controls can be used to flip the generated figures, as some audio files have been encoded in different ways, expecting the oscilloscope channels to be configured in a certain manner.

The program can also work like a standard oscilloscope by setting the X axis input to standard. In this mode, the program takes control of the horizontal position of the beam, while the vertical position can be assigned to either the left or right channel of the audio source.

Two panels can also be activated to display the audio source wave form as well as the FFT.

Finally, SoftScope includes a playback feature which can be used to play any stereo uncompressed audio files (WAV), which provides the most optimal result.

SoftScope 1.0b (A software based Oscilloscope / Vectorscope)
SoftScope 1.0b in action

The source code is available at GitHub: https://github.com/morphx666/SoftScope

And the latest compiled version can be downloaded from the releases section at GitHub: https://github.com/morphx666/SoftScope/releases


For best results, try using one of these files and play it using SoftScope 1.0b (or newer):

If you enjoy SoftScope, you may want to visit Jerobeam Fenderson’s web site OSCILLOSCOPEMUSIC.COM.
There you will find the most amazing list of tracks, specifically designed to be enjoyed with a software based oscilloscope such as SoftScope.