XYScope and FFT sketch - Assign audio input?

Hello all, I’m trying to figure out how to get this particular sketch to function properly, and I assume I’m doing something wrong as that’s generally the case. The code can be found here https://forum.processing.org/two/discussion/23617/fft-analysis-music-visualisation-on-oscilloscope
and it’s from 2017
Shoutout to @hamsterwoede for writing such an awesome sketch for the XYscope library!

Anyways, the problem I’m running into, is that I can’t figure out is how exactly I’m supposed to feed it audio? I assumed that it would go off of the system default, but I can’t get it to respond to any audio inputs I throw at it.

The sketch DOES feed into my oscilloscope, but what it shows is just the base “floor” with no movement

Any help on this would be greatly appreciated!

This may help:


1 Like

Thank you! I’m new to this stuff so it will take me a bit to comb through and make sense of, but this does look like fantastic resource! With the exception that I’m on a Mac and not windows, but it’s probably similar, and if it’s not, I’ll switch to my bootcamp partition to do this.

Thank you for the kind words and posting it here. The problem is probably with minim. Specifically this line: in = minim.getLineIn(Minim.STEREO, 2048 );

The minim library is supposed to automatically use the ‘default’ line in, but this can get borked in many ways. For instance if you have a device that has multitrack input.

First try the minim “Monitor input” example under basics in the Minim Library. If you get audio there, and not in this sketch, then I’m stumped :slight_smile: But it is a very basic sketch which is useful for testing.

Then I would suggest checking first in your Mac what your settings are in system settings> audio, and how your device is setup in Audio/Midi setup. Make sure the the audio settings has the right device connected, and that the device is set up as a stereo input (probably 44.1k) in Audio/Midi.

The tip by @glv should also work. But you’d probably have to rewrite some of the code to use the ‘standard’ processing audio library in stead of minim. I’m not sure if I used the the minim library then because it wasn’t possible with processing audio library then, or that I just didn’t try hard enough :wink:

Good luck with it!