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 › Detect sound, trigger sound
Page Index Toggle Pages: 1
Detect sound, trigger sound (Read 2194 times)
Detect sound, trigger sound
May 11th, 2010, 3:39am
 
Hi! I want to detect sound with minim.getLineIn() and trigger random sounds from a list if the detected sound is loud enough. Can I get some help with this?
Re: Detect sound, trigger sound
Reply #1 - May 11th, 2010, 5:59am
 
Current sollution (without random sample triggered):
 
for (int i = 0; i < 1; i++){
   float r = (1000*in.right.get(i));
   float l = (1000*in.left.get(i+1));
   float number = ((r*l)/2);
   //println(number);
   if ( number > 100) {
     q.trigger();
   //trigger AudioSample q
   }

It works for now, but I'm sure there are easier ways.
Re: Detect sound, trigger sound
Reply #2 - May 16th, 2010, 3:16am
 
Hey you could use the amplitude follower part of this dumb pitch detector

http://openprocessing.org/visuals/?visualID=9739

Smiley
Page Index Toggle Pages: 1