Hi,
i use this simple code for find the right pitch:

Code:

var rpm_pitch[2];
function rpm_min_1()
{
rpm_pitch[0] -= 1;
}
function rpm_min1()
{
rpm_pitch[0] += 1;
}
function rpm_max_1()
{
rpm_pitch[1] -= 1;
}
function rpm_max1()
{
rpm_pitch[1] += 1;
}

on_cul = rpm_min_1;
on_cur = rpm_min1;
on_cuu = rpm_max_1;
on_cud = rpm_max1;