Minim — getLineIn

Hello Preeps!

Loving Minim. What a great library! I have no problem reading an mp3 or getting a simple getLineIn() input from the microphone on my mac. All those tests work and my sketch reacts accordingly. My issue now is how do I get live input from a PC without a microphone? Kind of critical bug now :expressionless: I thought getLineIn(Minim.STEREO) would solve this problem. Ie. it reads whatever’s happening on the active soundcard. Nothing’s going on. No input seemingly.

I’ve seen Jack or SoundFlower be mentioned in previous conversations for setting the input source but I still find this unclear with regards to minim. Would Jack be defining the active source for Minim.STEREO?

Just got a bit of context I’m working with a musician/artist who will be playing my sketch during a live performance. Just for context the sketch is funneled through Spout in to TouchDesigner. That all works. I can see in TouchDesigner the music’s all streaming in from whatever he’s playing on the various bits of hardware.

Any help MUCHLY appreciated!

If you’re interested some of the prototypes of the visuals here: https://www.instagram.com/n_a_n_co/

1 Like

i try that recorder on a win7 PC to record YouTube video sound
( no micro, also play audio jack http://jackaudio.org/downloads/ )


String outfile = "data/myrecording.wav";  // minim need you to create the /data/ dir manually
import ddf.minim.*;

Minim minim;
AudioInput in;
AudioRecorder recorder;

void setup() {
  size(512, 200, P3D);
  minim = new Minim(this);
  in = minim.getLineIn();
  recorder = minim.createRecorder(in, outfile);
  textFont(createFont("Arial", 12));
  println("use key: [r] [r] [s]");
}

void draw() {
  background(0); 
  stroke(255);
  for(int i = 0; i < in.bufferSize() - 1; i++)  {
    line(i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50);
    line(i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50);
  }
  
  if ( recorder.isRecording() )    text("Currently recording...", 5, 15);
  else                             text("Not recording.", 5, 15);
}

void keyReleased()
{
  if ( key == 'r' )   {
    if ( recorder.isRecording() ) recorder.endRecord();
    else                          recorder.beginRecord();
  }
  if ( key == 's' )  {
    recorder.save();
    println("Done saving: "+outfile);
  }
}

1 Like

Hey - thanks for that. Cool sketch! Saved out me whistling in to the microphone. Funny.

I tried with Jack but I couldn’t work out the settings. Works with SoundFlower on my mac pretty easily. Very cool. Thanks for the prod.

Any tips for setting it up with Jack? My Jack youtube quest begins…