[Stk] Rate parameter (as in StopBlowing(StkFloat rate) )
Gary Scavone
gary at ccrma.Stanford.EDU
Tue Jun 2 11:46:49 PDT 2009
Hi Michael,
Its actually the amount that the envelope is decremented for each
sample. So, you need to account for the sample rate as well (like you
did in your first example). Thus, to make it go from 1.0 to 0.0 over
3 seconds, the rate would need to be:
1.0 / (3.0*Stk::sampleRate())
Note, however, that your envelope might not be at a value of 1.0 to
start with ... that is usually set in the NoteOn function based on the
key velocity.
Regards,
--gary
On 2-Jun-09, at 2:29 PM, Michael Chinen wrote:
> Hi,
>
> I'm having trouble getting a StopBlowing to provide a behavior that
> stops the air going into instrument over a period of time.
>
> Can someone explain what units rate (e.g. in Saxofony's StartBlowing
> or StopBlowing) is in? Looking at envelope it appears to be in
> change per tick - is this correct?
>
> For example, how would you decrease an instrument's input air to
> zero over three seconds?
>
> I've tried both
> StopBlowing(1.0/(3.0*mySampleRate))
> and
> StopBlowing(1.0/3.0)
>
> Thanks,
> Michael Chinen
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
More information about the Stk
mailing list