Problem with the FFT analyzer

27 views
Skip to first unread message

Jinggeng Lu

unread,
Jun 10, 2020, 6:40:43 PM6/10/20
to beadsproject
Hi all, I met a problem when I was doing my project. In my project, I have multiple music samples.
    for (int i = 0; i < listOfFiles.length; i++) {
                if (listOfFiles[i].isFile()) {

                      //here is where I created the sample players
                      player[i] = new SamplePlayer(ac, SampleManager.sample(listOfFiles[i].getAbsolutePath()));
                      selectedMusic[i] = true;
                      musicList[i] = new musicController(player[i],i);
                      
                }
     }
And I've also used an analyzer in my program to  get the frequency of the output
  sfs = new ShortFrameSegmenter(ac);
  sfs.addInput(ac.out);
  FFT fft = new FFT();
  sfs.addListener(fft);
  ps = new PowerSpectrum();
  fft.addListener(ps);
  ac.out.addDependent(sfs);
But the problem is that when I want to get the frequencies of different objects as I want to visualize the frequency of each sample player individually. 
Currently what I want to do is draw a ball for each music sample and the ball will move based on its music sample's frequency, but when there are some overlaps between different sounds, it seems that the movements of different balls will be affected by other music samples. Is there any method to append different analyzers to different music samples or Glide object etc?
Thank you very much!

Ollie Bown

unread,
Jun 10, 2020, 6:54:54 PM6/10/20
to beadsp...@googlegroups.com
Yes you should have one analysis chain for each sound to ensure the sounds don’t interfere. This might be too much CPU overhead. You’ll just have to see. You’d set the sfs input to each sample player individually.

sfs1.addInput(player1);
sfs2.addInput(player2); etc.
ac.out.addDependent(sfs1);
ac.out.addDependent(sfs2);

Is that answering your question?

Cheers,

Ollie

--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beadsproject/5494c5aa-e239-4a9f-951b-36c51c968638o%40googlegroups.com.

Jinggeng Lu

unread,
Jun 11, 2020, 7:40:58 PM6/11/20
to beadsproject

Thanks, Ollie, that helps
To unsubscribe from this group and stop receiving emails from it, send an email to beadsp...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages