Need help with Minim library.

edited May 2017 in Arduino

Hello there guys,

I'm new to this forum and I really need help with something, currently I'm using Processing as a music visualizer that sends the bass, mid and high tones to my Arduino which will make something cool of it. Now I can only use songs that are downloaded and put into my 'Data' map on the processing save.

So now I was wondering you have the option: AudioInput in; in the minim library, how can I get this to work that it automatically uses my PC sounds like when I'm on YouTube or spotify, without using a mic or something, because when you you a mic the quality is going down A LOT.

And also, how do I edit my code so it will work with a mic? I really can't find anything about it since the Processing community on that side isn't really big!

Just a quick note to explain the code a bit: Gemiddelde is the volume of the sound, it will be mapped into the amount of Leds on both sides, which is 60. Low, mid and high are just the frequencies which Processing will send through the serial data, I believe Minim reads that from this line 'fft.forward(song.mix);' without that piece of line it won't read the frequencies, so when I'm using my desktop audio, how do I get this to working?

I hope everything is clear, thanks for any help!


  • edited May 2017


    look at the AudioInput example in the minim examples.

    you can't ffwd or pause live input so your keyPressed method will be pretty useless, but otherwise just use AudioInput instead of AudioPlayer everywhere and call getLineIn instead of loading the song.

    using the outgoing sound as input is more tricky though as it depends on your hardware and operating system. there's often a 'Stereo Mix' that you can chose as an input. macs need extra software iirc. and some systems just won't let you do it.

  • Alright thanks, so how do I use Stereo Mix so when I'm on YouTube processing will automatically analyse the frequencies and send them true? I'm on a Windows PC btw, so Mac is not needed :)!

  • I know about the get line, but how do I edit it into my code to get the frequencies: low, mid and high?

  • look at the AudioInput example in the minim examples.

  • AudioPlayer and AudioInput are both types of AudioSource so anything that takes an AudioSource can use either an AudioPlayer or an AudioInput.


    mix is a member of AudioSource so AudioInput has a mix too.

  • edited May 2017

    I did look at the AudioInput example but I don't know how to get the frequencies out of it. This piece of code:

    When I'm using my computer audio output how do I translate this piece of code to that audio output from my PC? I have really no idea, and I still don't know how to use my 'raw' PC audio output, for like youtube etc.!

    Thanks for the help so far!

  • Alright I'm getting closer, I found a way to have a virtual mic that directly outputs my computer sound, so now the volume is working!

    I only need to get a way of getting the high, mid and low frequencies.. could you help me out?

  • With the audioinput method.

  • Answer ✓

    post current code.

    and stop rejecting my answers if you want me to help 8)

  • Oh sorry I thought that when I press 'Yes' it will close the thread..

    Anyways thanks for the help but I got it working here is what I did:

    I downloaded RealTek Stereo drivers which creates a virtual input from your audio output. Then I created a AudioInput on that thing and that was just all, it worked! I only had to change the AudioInput in the code, thanks!

Sign In or Register to comment.