<div dir="ltr">Hi there,<br>There&#39;s a line in the midisine.c code at jack&#39;s example client directory.<br>In this code, Ian Esten has calculated note frequencies in the function below:<br><br>void calc_note_frqs(jack_default_audio_sample_t srate)<br>
{<br>&nbsp;&nbsp;&nbsp; int i;<br>&nbsp;&nbsp;&nbsp; for(i=0; i&lt;128; i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; note_frqs[i] = (2.0 * 440.0 / 32.0) * pow(2, (((jack_default_audio_sample_t)i - 9.0) / 12.0)) / srate;<br>&nbsp;&nbsp;&nbsp; }<br>}<br clear="all"><br>after that, a variable called ramp is used to form the sine wave samples in the function process:<br>
<br>ramp += note_frqs[note];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ramp = (ramp &gt; 1.0) ? ramp - 2.0 : ramp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; out[i] = note_on*sin(2*M_PI*ramp);<br><br>I actually understood what the code does. But can someone show me a place to read information about the equation:<br>
<br>note_frqs[i] = (2.0 * 440.0 / 32.0) * pow(2, (((jack_default_audio_sample_t)i - 9.0) / 12.0)) / srate;<br><br>I couldn&#39;t catch the relationship in the calculation above.<br>Thanks.<br><br><br><br><br><br>-- <br>Arda EDEN<br>
Cumhuriyet University<br>Faculty of Fine Arts<br>Department of Music Technology<br>Sivas/TURKEY<br>
</div>