Question on how "f" value is calculated in converting Morse Code to laser audio from this tutorial
This is not a good tutorial. The receiver works by assuming 14 dotLen time periods for each character. There is a loop that runs 14 times, with a 200ms delay between each iteration. If the laser is detected, then a is incremented, otherwise f is incremented. This means that the sum of a and f is always 14, and the case where a==0 means nothing was transmitted. The incomplete receiver code shows only 10 options for received characters and leaves out a==5 (which would be R or U), but does define 1 through 10 otherwise.

The receiver code does not differentiate between dots and dashes, it only counts the number of dotLen transitions where light is detected. This is not Morse Code.

The receiver code cannot distinguish between S (dot-dot-dot) and T (dash) because they both have 3 dotLen value. Same for A (dot-dash) vs. N (dash-dot).

If you want to understand decoding morse code, this is not a good tutorial to follow. It does not decode morse code, and I cannot see how it would work even with it's companion transmitter program.