[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Cannot get trigger argument to, like, trigger



On December 30, 2015 6:59:50 AM Nathan Ho <nathan@xxxxxxxxxxxx> wrote:

t_cutofftrig is indeed triggering -- try adding a t_cutofftrig.poll in
there. The problem is in your envelope generator.

I'm not entirely sure what's wrong with it, but if you add in a
zero-length attack it works:

     fenv = EnvGen.kr(Env.new([cutoff, cutoff + (cutoff * fenvamt),
cutoff], [0, fenvtime]), t_cutofftrig);

What is wrong with it is the most common misunderstanding of envelopes. You might think that an envelope segment consists of a beginning level, an ending level, a time and a curve spec, but that's not the case in fact.

An envelope segment is defined as an ending level, a time and a curve spec ONLY. A segment definition includes no specific beginning level. When EnvGen plays an envelope, every segment begins at the EnvGen's current level. Often, this is the previous segment's target level, but this doesn't hold true when an EnvGen is retriggered mid-segment, or its gate released.

EnvGen.kr(Env([start, end], [time]), trig)

What you expected, based on the faulty assumption, is that the trigger would make the EnvGen go back to "start" and proceed to "end." Instead, it goes from the EnvGen's current level -- end -- to end, for no change in value.

Nathan's solution is the correct one: Begin the envelope with a very short segment that goes to the desired "retrigger" value.

Why does "start" even exist in Env, then? Because the first segment must start somewhere. But there is no Env segment that targets the first "levels" value -- so this value is used once, at synth onset, and never used again.

This is actually documented in the Env help file, but it's easy to overlook (especially when people think, "eh, I know what an envelope is...").

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com





_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/