I would like to know how to "draw sound" so i could achieve shapes like the ones in this video:


I have programming background ( as in: i can't read complex equations ) so please, is possible i would like to see explanation by "code" even if just pseudo-code, i don't mind seeing the "hardcore" equations, but at this stage i can't read them so they wouldn't be very helpful, although i would love to see the equation side by side with code ( and hopefully learn something from it ).

Thank you very much

( i'm new on stackexchange, so sorry if i'm on the wrong "department" )

  • 1
    $\begingroup$ They are plotting internal control values for the synth module on the oscilloscope, not the resulting soundwaves. It's a pretty cool module :) But I think you need to clarify which aspect of this you are interested in, if it's their chaos equations I guess this is mostly a math question for example. $\endgroup$
    – BjornW
    Commented Jan 18, 2015 at 11:20
  • $\begingroup$ I'm not interested in the chaos equation, i'm interested in how to plot this shapes. Another example of nice looking shapes on osciolloscopes youtube.com/watch?v=aX_k7s9ekiI $\endgroup$
    – kroe
    Commented Jan 18, 2015 at 13:10
  • $\begingroup$ probably on the second one the graphic isn't about the music then i would guess hence why i got confused? $\endgroup$
    – kroe
    Commented Jan 18, 2015 at 13:49
  • $\begingroup$ As a sidenote, have a look at this youtube.com/watch?v=aMli33ornEU where some maniac render a game of Quake using the normal stereo sound output of a PC connected to the X/Y inputs of an oscilloscope... :) $\endgroup$
    – BjornW
    Commented Jan 18, 2015 at 20:55

1 Answer 1


[this is not physics at all, but I'll answer it anyway here and you can migrate it to stackoverflow if desired]

You connect the left and right stereo audio outputs from the sound port on the PC to the X and Y inputs on the oscilloscope, and set the scope to XY mode. In this mode the electron beam is steered on the screen by the voltage on the X and Y inputs, which in turn are the digital->analog conversions of the sound data you play on the PC's soundcard.

So you need code on the PC that sends a stereo digital audio buffer to the soundcard and set it to repeat (or send the same block of audio continuously), and then put the X positions for the beam in the Left channel and the Y positions in the Right channel (or vice versa).

To draw a circle, you therefore calculate for example (for an 8-bit sound file) 127*cos(k*t) in the left channel buffer, and 127*sin(k*t) in the right channel buffer. t is the buffer index, say from 0 to 255, and k should map the buffer to a whole number of circles, so for a buffersize of 256 in total, k = 2*pi/256.

You play the buffer differently depending on the OS but for testing, just output the data to a raw file, and open it in a sound editing program, there you can see that the sin/cos waves look OK and you can play it on repeat while you test with the scope.

  • $\begingroup$ I do have the same module as the video, so generating the signals won't be a problem. What i don't completely understand is how the X/Y mode of the oscilloscope works. I believe it will receive a continum stream of values for 0..N, but does it keep a "trace" of the current sample size in order to have the completely shape in the screen? it seems like it does.. $\endgroup$
    – kroe
    Commented Jan 20, 2015 at 23:00
  • $\begingroup$ @kroe it works the same way the normal sweep does, so it doesn't keep any sample at all (normally). just like you have to have a repeating signal to see an ordinary stable waveform on the oscilloscope in the normal sweep mode, you need to repeat the signal infintely to keep a trace on the X/Y mode. think of the X and Y inputs controlling the electron beam's position, but the highlight fades out immediately, so you need to keep drawing the same shape fast enough for the image not to flicker. that is why I talk about a repeating buffer in the text above. $\endgroup$
    – BjornW
    Commented Jan 20, 2015 at 23:06
  • $\begingroup$ its the same as if you try to draw a shape with a laser pointer. you need to keep wiggling it around in the shape to keep seeing it. $\endgroup$
    – BjornW
    Commented Jan 20, 2015 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.