Kyma Forum
  Kyma Support
  random triggers in Timeline

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   random triggers in Timeline
Bill Meadows
Member
posted 21 March 2008 21:26         Edit/Delete Message   Reply w/Quote
I am using this construct:

1 randomTrigger: 0.5s

in a Sound and it works fine.

When I put the Sound in a Timeline, it works until the cursor gets to a "WaitUntil" Sound.

How can I create random triggers in a Timeline while it is stopped at a "WaitUntil" Sound?

IP: Logged

SSC
Administrator
posted 22 March 2008 12:22         Edit/Delete Message   Reply w/Quote
The randomTrigger: expression relies on !LocalTime which stops at a WaitUntil. Instead, you could use an expression that relies on !RealTime. For now, you could paste this code into the Gate or Trigger parameter field of your Sound:
code:

| cumDur uniformRand averageDur deltaDur |

averageDur := 0.5 s.
deltaDur := 0.5 * 0.5 s.

cumDur := EventVariable new.
cumDur initialValue: 0.

uniformRand := ((((!Random * (deltaDur s removeUnits)) + (averageDur s removeUnits)) vmax: 0.002) vmin: (2 * averageDur s removeUnits)).

^ (1
true: ((!RealTime ge: cumDur)
true: (
((cumDur eq: 0)
true: (cumDur <+ !RealTime) false: (nil)),
(cumDur <+ (cumDur + uniformRand)),
1)
false: (0))
false: ((cumDur <~ 0)))


I'll change the internal implementation of randomTrigger to use !RealTime so you won't have to use this verbose way of doing it in the future.

IP: Logged

Bill Meadows
Member
posted 22 March 2008 18:51         Edit/Delete Message   Reply w/Quote
That works - thanks.


IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c