[chuck-users] 2 questions

Adam Tindale adamtindale at hotmail.com
Wed Dec 14 19:25:21 EST 2005


The answer to the second question will help to answer the first, so I  
will start there.

Every UGen supports the .last method, which returns a float of the  
last sample computed by that UGen.

sinosc a => dac;

while(1::samp =>now)	
	a.last => float x;

This will grab the last sample and then make a new float x.

Once you have the data from an audio stream you can do whatever you  
want with it. So you could do this or something like it.

Event impulse;

if ( std.fabs(x) == 1. )

You can do analysis on the audio stream and come up with a set of  
conditions that define when you should throw your event.

I hope this helps.


On 14-Dec-05, at 12:54 PM, michael breitenbach wrote:

> hi,
> 1. is it possible to create a event from a audiosignal (for example  
> a pulse force a event)?
> 2. and is it possible to use a audiosignal as a float value in  
> chuck code - like a snapshot function?
> sinosc a => float x => dac;  // this doesn't work
> micha
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

More information about the chuck-users mailing list