I am trying to mimic a knob on an audio mixing desk in TikZ. So far I have the following:

\begin{tikzpicture}
\draw[ultra thick] (0,0) circle [radius=0.5];
\foreach \angle/\label in
{
-45+0*270*0.25 / $0$,
-45+1*270*0.25 / $-20$,
-45+2*270*0.25 / $-40$,
-45+3*270*0.25 / $-60$,
-45+4*270*0.25 / $-\infty$
}
{
\draw +(\angle:0.25) -- +(\angle:0.5);
\draw (\angle:0.85) node {\label};
}
\draw[ultra thick] (0,0) -- +(45:0.5);
\end{tikzpicture}
Now I would like to support generic scales with arbitrary labels and number of ticks:
All that I should need to do is to pass TikZ a list of labels that I want on my knob. In the example above: {$0$, $-20$, $-40$, $-60$, $-\infty$}.
The code should then automatically draw the ticks and labels at equal distances between -45 and 225 degrees (i.e., the positions of $0$ and $-\infty$ in the example above). This will involve deriving the length of the passed list.
Ideally, I'd like to specify the knob's current position by reference to the scale on the labels (e.g., to -60), rather than by specifying the angle (45 degrees in the example above). This might be tricky:
- On the one hand, I need the labels to be independent of the angle (e.g., $\infty$ symbol above)
- On the other hand, I'd like to be able to set the knob to intermediate positions such as -70 (in relation to the label scale), in which case the code should automatically interpolate and derive the corresponding angle.
Any help would be most appreciated.



-\inftyand-60? – jub0bs Oct 13 '13 at 22:15