Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Minim Issue. Cannot use Analysis (eg. BeatDetect) and Ugens (eg. MoogFilter) together in one script?

$
0
0

I seem to be having an issue trying to use both at once in a single .pde. From looking at examples, it seems that there are different methods of setting up and playing a soundfile for BeatDetect and MoogFilter. I cannot patch the sample that is set up in the BeatDetect Example file online: code.compartmental.net/minim/beatdetect_method_iskick.html so that it then runs into the MoogFilter.

I get an error if I try to put the file name "song" from that example in the filter. "song.patch( moog1 ).patch( out );"

Below I have set up and example of both methods. I listed and labelled the two separate methods of sample setup as "ugen" or "analysis", and "shared" for any code that they share. Could someone kindly point out how to make both work together? The issue lies in the final line of patching code.

import ddf.minim.*;

import ddf.minim.analysis.*; // analysis
import ddf.minim.ugens.*;    // ugens

Minim minim;  // shared

AudioPlayer song;     // analysis
BeatDetect beat;      // analysis


FilePlayer filePlayer1;          // ugens
AudioOutput out;                 // ugens
String fileName1 = "Gothik.mp3"; // ugens
MoogFilter  moog1;               // ugens

void setup()
{
  size(600, 600);
  minim = new Minim(this);                    // shared

  song = minim.loadFile("Gothik.mp3", 2048);  // analysis
  song.loop();                                // analysis
  beat = new BeatDetect();                    // analysis

  filePlayer1 = new FilePlayer( minim.loadFileStream(fileName1) );  // ugens
  out = minim.getLineOut();                                         // ugens
  moog1    = new MoogFilter( 1200, 0 );                             // ugens
  filePlayer1.patch( moog1 ).patch( out );                          // ugens   **ISSUE IS HERE**
}

I have no idea why there are two methods of setting up a sample to play and I'm getting a bit confused.

Many thanks


Viewing all articles
Browse latest Browse all 2896

Trending Articles