Pot Values and Simulating Changing a pot value over time.

bretvh

Member
While I am awaiting my ST-Link card, I am wondering what the values the pots send to the code, if anyone has been able to get that info through a debugger? I'm on a Mac using CLion and am just kind guessing what the values are and tweaking from there. B10K pots. Just wanting to know what the range is, if it's interpreting as 1 - 10, 0.0 - 1, or what.

Also, I am having a struggle trying to wrap my brain around how the code looping works for the processing. Say, for example, I want to simulate turning down delay time when I hit the right footswitch, what is the best way to change that value throughout the loop? I have tried using an Envelope Filter, but it's half doing what I want. I thought about setting the min and max values as global variables outside of the loop, then changing them with each iteration until they hit the top or bottom value. But I feel like there has to be a more elegant way to handle it that I am not seeing. Any ideas?
 
Found the answer to the knob question on the Daisy Slack channel:

The Process function returns a normalized value in the range of 0-1 for the knobs.

The only exception to that is CV inputs (like on the Daisy Field) that are bi-polar, in which case it's -1 to +1
 
I made a delay that uses the right footswitch to change the feedback of a delay (code here), but modifying the delay time instead should work the same way. Let me know if you have questions about code, the very bottom of ProcessControls is where the feedback ramping happens.

You can also set the range a pot sweeps through:
Code:
cetainParam.Init(petal.knob[Terrarium::KNOB_1], 0.0, 1.0, Parameter::LINEAR);
Where you can change the start value (0.0) and end value (1.0) to whatever you want as well how the sweep between them is divided (LINEAR, LOGARITHMIC, etc).
 
Oooh! Thanks so much! That makes sense on the init function. I will check your code for sure!
 
Ok, so it looks like the fonepole function allows you to smoothly change the value of a variable as it loops over each sample? This is super helpful, I'm stoked to try it out. Thanks again!
 
Yep, the fonepole function is a simple One Pole Filter (lowpass).

You can use it to smooth, ramp, remove jitter, etc. I've even used it on audio.
 
Back
Top