We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Minim - getLineIn and OSX
Page Index Toggle Pages: 1
Minim - getLineIn and OSX (Read 2042 times)
Minim - getLineIn and OSX
Nov 5th, 2009, 5:37am
 
Hey folks,

Have been playing around with the minim library, and encountered a problem about trying to use an external microphone with getLineIn. It seems that OSX 10.4 (maybe leopard etc do this too) defaults to built-in microphone when trying to access line-in in minim. I found an earlier post from May 09 about this issue which was left unresolved - I was wondering if anyone knows of a work around since then other than having to use Sonia?

Thanks in advance!

Here's the code (based on a minim lib example) I've been using:

Code:
import ddf.minim.*;
Minim minim;
AudioInput in;

void setup() {
 size(500, 500);

 smooth();
 
 minim = new Minim(this);
 
 minim = new Minim(this);
 minim.debugOn();
 
 in = minim.getLineIn(Minim.STEREO, 512);

}
void draw() {
 background(0);

 stroke(255);
 strokeWeight(1);
 noFill();

 for (int i = 0; i < width; i++){
   float r = (5+in.right.get(50)*150);
   float l = (5+in.left.get(i+1)*500);
   pushMatrix();
   translate(0, 300);
   ellipse(i*5, l, r, r);
   popMatrix();
 }
}

void stop()
{
minim.stop();
super.stop();
}
Re: Minim - getLineIn and OSX
Reply #1 - Nov 9th, 2009, 1:39pm
 
I use JackPilot to solve problem like this. With JackPilot, you can route any of your input signal, including an internal application like iTunes, to the applet. It is a bit tricky to fixed because you have to follow some steps in the order :
- Open JackPilot and launch it (which is not the same)
- Go on your system sound preferences and choose jackPilot as input and output
- Open both applications you want to connect together : Processing and any iTunes, for example, or the input you want to listen. Run Processing so the applet with your Minim code is execute normally.
- Go back on JackPilot and route the signal from the input you like to your Java applet. For this, you should have to look in the documentation of Jack, because the way you need to select and activate the link is not very clear the first time. Also, you can block the routing between Mic input (system) and the java applet, so it wont react to the sound getting in by the internal microphone.
Voilà.
Re: Minim - getLineIn and OSX
Reply #2 - Nov 10th, 2009, 7:50am
 
Thanks for the response! I've been using jackosx for another audio-vis app (Fluxus), but you have to connect the app to jack with a line of code. Is it the same case in Processing?

I can't seem to get jack to recognize the java applet, and there's no mention of it in the documentation.

Code:
  in = minim.getLineIn(Minim.STEREO, 512); 

Re: Minim - getLineIn and OSX
Reply #3 - Nov 17th, 2009, 9:41am
 
i'm running os x 10.5.9 and don't have this problem with minim line-ins.

i use soundflower to route itunes to processing.

set output to soundflower 2 ch and input to soundflower 2 ch in system preferences/sound.
use soundflowerbed to route audio to your speakers...

Re: Minim - getLineIn and OSX
Reply #4 - Nov 25th, 2009, 9:09am
 
I'm not very familiar with minim, but very familiar with Sonia. I don't know if it's similar to Sonia in the sense that you can pick up the audio of whatever is default for your computer (ie whatever your line in is under System Preferences>Sound), but I use Soundflower to route all of my sounds to the default. Takes care of line in, mics, midi's, you name it

http://cycling74.com/products/soundflower/
Page Index Toggle Pages: 1