[sc-users] amplitude in OnsetDS

thor th.list at gmail.com
Fri Jun 29 19:30:51 PDT 2007


Hi Dan

Thanks for your reply.

> It kind of depends what you mean. You said wanted the "amplitude" of
> the onset - if you want the signal's amplitude at the time of onset
> you can simply use some kind of amplitude measurement (e.g.
> Amplitude.kr) and grab the value when OnsetsDS fires.

Yes, this is what I tried, but I got values around 0.009 to 0.08 which
is far too low for the onset amp. I guess it was reading from a control
period before (or after?) the onset time. (This is what happens in the
code I posted)

> You might want
> to try strong the "odf" value into a new variable *before* the
> MedianTriggered line, and then using that for your trigger size.

It works, but as you say in your FFTPower helpfile, one has to find
an empirical value that fits. That doesn't suit me.



On to something else but related: I've been testing all kinds of files
with the OnsetDS and taking the thresh up to 5 in order to get fewer
onsets detected. I notise that the onset detection is irregular  
(sometimes
oscillating between two states - which is quite cool actually). Why  
is this?

Just curious.
thor

>
>
> 2007/6/29, thor <th.list at gmail.com>:
>>
>>
>> Hi Dan
>>
>> I'm testing your OnsetDS ugen better and I'm interested in getting  
>> the
>> amplitude of the onset in order to store in a list on the language  
>> side.
>>
>> Your OnsetDS only outputs 1s and 0s and I didn't have success with
>> using the Amplitude UGen for this.
>>
>> I had a look at the source and I'm wondering why you use Trig1
>> rather than Trig and send out the amplitude instead of a mere 1.
>>
>> But I didn't succeed as I wished and I'm too tired to go into this  
>> now.
>> Do you have any tips for this?
>>
>> thor
>>
>> I tried this in your class:
>>
>> onsets = if(odf > thresh, odf, 0);
>> onsets = Trig.kr(onsets, mingap);
>> onsets = Trig.kr(onsets, 0);
>>
>>
>>
>> a = List.new;
>> b = Buffer.alloc(s, 512);
>> c = Buffer.alloc(s, 512);
>> d = Buffer.read(s, "sounds/a11wlk01.wav"); //  Feel free to load a  
>> more
>> interesting clip!
>>
>> (
>> t = Main.elapsedTime;
>> x = {
>>  var sig, onsets, pips, amp;
>>  sig = PlayBuf.ar(1, d.bufnum, BufRateScale.kr(d.bufnum), loop: 0);
>>  amp = Amplitude.kr(sig);
>>  onsets = OnsetsDS.kr(sig, b.bufnum, c.bufnum, 0.7, \complex);
>>  pips = SinOsc.ar(880, 0, EnvGen.kr(Env.perc(0.001, 0.1, 0.2),  
>> onsets));
>>  SendTrig.kr(onsets, 860, amp);
>>  Out.ar(0, ((sig * 0.6) + pips).dup);
>> }.play;
>> )
>> a
>> x.free; // Free the synth
>> [b,c,d].do(_.free); // Free the buffers
>>
>> o =  OSCresponderNode(s.addr,'/tr',{ arg time,responder,msg;
>>  [time,responder,msg].postln;
>>  if(msg[2] == 860, {a.add([time-t, msg[3]])});
>> }).add;
>>
>> o.remove;
>>
>>
>> _______________________________________________
>> sc-users mailing list
>> sc-users at create.ucsb.edu
>> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>>
>>
>
>
> -- 
> http://www.mcld.co.uk
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users



More information about the sc-users mailing list