absolute values vs relative values
staticattic
Posts: 200
I have a customer that wants an active bargraph to control volume, they want to slide with their finger. They are using Clearone 1212A's for their audio control. That part is easy. The problem I am having, the engineer that is setting up the room does not want to use absolute values when it comes to controlling the gain. Instead, he wants to give them a "midpoint" and give them 20 steps down and 10 steps up, increasing or decreasing by 1db. I created a LEVEL.EVENT and grabbed the LEVEL.VALUE for the bargraph. I need to know if the bargraph value is increasing or decreasing. If LEVEL.VALUE is getting higher, then continue increasing the volume by 1. If it is getting lower, then continue decreasing the volume by 1. I am currently comparing the old value against the new value, but that is causing funky results. Am I making this harder than it needs to be?
0
Comments
you could trap the value and do a comparison to the last known state.
something like.
if(level_real > level_temp)
{
//do something special
level_real = level_temp
}
if(level_real < level_temp)
{
//do something else special
level_real = level_temp
}
The amazing power of the 6-pack in action....
I was just reading an article the other day (sadly, I forget where, someplace on the Cloud) about how counter-productive it is for programmers to work too hard. It's essentially creative work, and the more hours you put into something in a single setting, the more likely you are to get caught up in cold logic ... which tends to create a tunnel vision that may prevent you from seeing a better solution. It's fine for troubleshooting, but creating a project or figuring out a "best way" to do something is far better approached when you are relaxed and fresh and thinking outside the lines that logic tends to lay down.
In my case, you assume my programming is creative.
Depends on what you mean by "too hard". I'm not sure programming requires the same kind of creativity as other pursuits (I don't consider myself a creative person at all), but certain tasks seem to require a kind of mental energy that I don't have all the time. Other things (documentation and drawings, especially) can be done at practically any time, including during the post-lunchtime brain freeze.