Csound Csound-dev Csound-tekno Search About

triggering

Date1998-02-04 12:53
FromMark Wilkes
Subjecttriggering
Hello all!

Question:

When a soundfile is being read, is there a way in Csound to cause  
another Csound instrument to be triggered once the soundfile's  
amplitude (or frequency for that matter) rises above or below a  
specified threshold?

If not, why not?

Date1998-02-04 19:12
FromHans Mikelson
SubjectRe: triggering
Hi,

At 12:53 PM 2/4/98 GMT, Mark Wilkes wrote:

>When a soundfile is being read, is there a way in Csound to cause  
>another Csound instrument to be triggered once the soundfile's  
>amplitude (or frequency for that matter) rises above or below a  
>specified threshold?

I can think of a couple of ways this might be accomplished.  Here's one way
that might work.  Have an instrument with two parts, something like

       instr    1
  .
  .
  .
asig1  oscil    iamp, ifqc, itable1
asig2  oscil    iamp2, ifqc2, itable2

krms   rms      asig1

if     (krms>imax) kgoto next1
       out         asig1
       kgoto       end1
next1:
       out         asig2
end1:
       endin

Good Luck,
Hans Mikelson