Plotting points of Musical Note frequencies linearly on a Graph

1.4k Views Asked by At

I am trying to plot the frequencies of musical notes on a graph so that they are equally spaced apart.

I have researched that the relationship between each note is $$f \times 2^\left( X / 12 \right)$$ Where $x$ is how many notes up and $f$ is the beginning note frequency.

The problem is, I am trying to plot these frequencies on a graph so that each note is equally spaced out.

The X axis is a time series and therefore (I believe) is linear, the Y axis is the frequencies.

I am coding this graph in Java so I am using a function to plot Y. I am not well educated so I have this problem in my head and it's difficult for me to explain the question using proper terms so I apolagise in advance if this question has already been answered.

Thanks in advance,

Jack

2

There are 2 best solutions below

0
On

Instead of plotting $$g(x)=f×2^{(x/12)}$$ you can plot $$\log_2(g)=\log_2(f)+\frac{x}{12}$$ which is now linear in $x$

Here I've used the common identities that $$\log_b(xy) = \log_b(x) + \log_b(y)$$ and $$\log_b(b^x) = x$$

0
On

The kind of paper you would use if plotting the frequencies with a pencil was called "semi-logarithmic": logarithmic scale on the $y$ axis, linear scale on the $x$ axis.

But for your graph drawn in Java, since you presumably know where in the scale each note is, just set $y$ equal to "number of notes up". That seems to be what you want. If you plot time along the $x$-axis, and your notes go up one step at a time at equal time intervals, the result will be points along a straight line.

If that line is too shallow or too steep, set $y$ equal to "$m$ times number of notes up", and find a constant value of $m$ that makes the line look right.

If you then put marks along the $y$ axis showing the value of $f\times 2^{y/(12m)}$ at each height on the $y$-axis, you will have created a kind of "semi-log paper" in software. For example, if $f = 440$ and $m = 10$, you could put a mark at $y=0$ and label it $440$ (because $440 \times 2^{0/120} = 440$), another mark at $y=120$ and label it $880$ (because $440 \times 2^{120/120} = 880$), another mark at $y=240$ and label it $1760$ (because $440 \times 2^{240/120} = 1760$), and so forth.