First time here? Check out the FAQ!
x

What's the purpose of ramp0?

0 votes
863 views
In the description of ramp: I read the following "see ramp0 for a ramp that doesn't stick at 1". In the description of ramp0 I read "Once it reaches 1, it stays at 1". Practically it stays at 1 - but how does that differ from ramp:?

Also I really like the idea of a ramp that goes back to 0 once it reached 1 for expressions in trigger fields where you want the Sound to be triggered initially but retriggered by using !Reset using an expression like "1 - !Reset". If ramp0 would work as expected I could use "1 - (!Reset ramp0: 1 ms)" so it gets retriggered when I change Reset from 0 to any positive value. In the expression "1 - !Reset" the retriggering happens when !Reset becomes a 1 and a 0 again. That may sound like niggling but if you want to use a TriggeredSoundToGlobalController to Reset you really need this - or is there a better (and easier) way to accomplish that? Maybe I'm thinking too complicated here? "!Reset initialValue: 1" doesn't seem to work in the trigger field of a MemoryWriter BTW

Thanks!
asked Jul 20, 2015 in Using Kyma by kymaguy (Virtuoso) (10,580 points)

2 Answers

0 votes
 
Best answer

ramp0:reset: rests at 0, linearly increases from 0 to 1 over the given duration when triggered, and stays at 1 until it gets reset.  So the form is:

<aTrigger> ramp0: <aDuration> s reset: <anotherTrigger>

answered Jul 20, 2015 by ssc (Savant) (128,200 points)
selected Jul 22, 2015 by kymaguy
I see, so I could use "1 - (!Reset ramp0: 10 ms reset: (!Reset turnOnAfter: 10 ms for: 1 ms))"? Pretty long expression for what I'm after but ok! Thanks!

Still I don't get the difference to ramp:... Besides the reset it's the very same thing, right?
Also ramp starts at 1, whereas ramp0 starts at 0.
not for me: If I use "1 ramp: 1 s" in a constant and use Info->Full Waveform for 1 s I get the very same waveform as when I use "1 ramp0: 1 s"... ?
Yes, because once ramp or ramp0 is triggered it goes to zero and starts climbing.  You have them triggered by a constant 1.  Try instead comparing them with an EventValue as the receiver, for example,
!Gate ramp: 1 s and
!Gate ramp0: 1 s
Oh, now it's clear! Thanks!
Here's an expression that makes it return to 0:

!Gate ramp0: !Dur s reset: ((!Gate ramp: !Dur s) eq: 1)
Thanks for ramp00 - Excellent addition to the already axcellent capyTalk language
0 votes

If you want an expression that starts out true (1) and that will return to 1 when you press a reset button, this should do the trick:

!Reset + (!localTime eq: 0)

Here's a TriggeredSoundToGlobalController that demonstrates how it can start at the ResetValue, then you can move the fader, and when you press Reset, it jumps back to its ResetValue.

answered Jul 20, 2015 by ssc (Savant) (128,200 points)
Nice one! I knew there would be a better way to do it! Thanks!
...