# XYScope and FFT sketch - Assign audio input?

**URL:** https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400
**Category:** Libraries
**Created:** [October 7, 2020, 1:28am UTC](https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400 "2020-10-07T01:28:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![thagreatbelow](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@thagreatbelow](https://discourse.processing.org/u/thagreatbelow)
#### Post date: [October 7, 2020, 1:28am UTC](https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400/1 "2020-10-07T01:28:52Z")

</div>

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](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!

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [October 7, 2020, 1:50am UTC](https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400/2 "2020-10-07T01:50:09Z")

</div>

This may help:

> [@Getting live audio input](https://discourse.processing.org/t/getting-live-audio-input/23143):
>
> So I’m brand new to working with audio in any form, and I’m hoping you folks can point me in the right direction. A DJ friend of mine wants my processing sketch to react to his audio. He said he could plug his output into my laptop and that it would show up as an “External sound card driver.” I’m kind of at a loss to where I should go from here. The Sound library IO examples shows how to get live input from the microphone, but can anyone tell me how to get it from the sound card itself? And if…

`:)`

---

<div class="post-metadata">

### Author: ![thagreatbelow](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@thagreatbelow](https://discourse.processing.org/u/thagreatbelow)
#### Post date: [October 7, 2020, 2:19am UTC](https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400/3 "2020-10-07T02:19:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![hamsterwoede](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hamsterwoede](https://discourse.processing.org/u/hamsterwoede)
#### Post date: [October 7, 2020, 9:13am UTC](https://discourse.processing.org/t/xyscope-and-fft-sketch-assign-audio-input/24400/4 "2020-10-07T09:13:46Z")

</div>

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 🙂 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 😉

Good luck with it!
