# Whats the amplitude of 1 samp duration?

0 votes
103 views
I noticed in the `LossyIntegratorAsExponentialSmoother` prototype there is a time based value in the Scale field.

`1 / !Tc s samp removeUnits`

If I wanted to figure out the 'amp' of 1 samp though, rather than a seconds Unit on the time constant, this expresssion evaluates to -1 .

So I wondered if I wanted to offset a read-index by 1 samp into an addWrap , what should that constant value be?
asked Dec 17, 2020
What Alan said. Another way to say it would be:
wavetableLengthInSamples inverse * 2
It's scaled by 2 because the time index is (-1,1]
Might I add that you may need to make use of the `removeUnits` CapyTalk if using these formulas in a constant or Scale field.

## 1 Answer

0 votes

I think I've understood your question, let me a try an answer...

Let's say your time index ramp has a duration of 5 seconds.
If you're at 48kHz sample rate that ramp will take 5 * 48000 samples to complete.

Over that duration the time index will go from -1 to +1,  a range of 2.

So the increment that's added on to the time index at every sample is ((1 / (5 * 48000)) * 2)

If you want to offset by one sample then add ((1 / (5 * 48000)) * 2) into the AddWrap. Or another way of writing that would be:

(!Duration s removeUnits * SignalProcessor halfSampleRate) inverse

Where !Duration represents the length of the time index ramp.

Here's another answer which I don't think answers your question but might be interesting to readers attracted by the post's title.

Some parameters in Kyma are "boiling hot" -  their text is on an orange background and you can insert a Capytalk expression or they'll also operate at sample rate if you paste in a Sound and remove the "L". For instance Oscillator's Frequency parameter is like this. If you do use a sample rate signal these boiling hot frequency parameters use Kyma's standard frequeny-encoded-as-signal scaling where a value of 0 means 0Hz, and a value of 1 represents half sample rate.

In Kyma there's no real difference between a frequency and a duration. One is just the inverse of the other. You can think of a 10 second duration as 0.1Hz. If you wanted to use a sample rate signal to specify a duration of 10 seconds in a boiling hot Frequency parameter, then the level of the signal you need is equivalent to this value:

SignalProcessor halfSampleRate inverse / 10

So a related question is, "What is the signal value that represents a duration of 1 sample?". The answer is there isn't one. It would be 2 but the highest signal value in the audio channel is 1 and that represents a frequency of half sample rate, which is the same as a duration of 2 samples.

answered Dec 18, 2020 by (Virtuoso) (14,670 points)
edited Dec 18, 2020