I am not sure exactly what you mean by the 48. I only have 39 lights to work with. Am I missing something there? 
sorry... I messed up the numbers.... and for whatever reason I understood you had 49 lights...
I don't get the point on sending note 52 with the low E. I see 2 options
Option 1- Add a condition in the code, to do something like:
If midinote>76 then midinote=midinote-36
This way, you will have different midinotes in all the fret except when you reach the forth octave, and the midinotes start again at 40. You will havfe 36 different midinotes output.
Option 2 - Restrict output to one octave only. This way, all E in the fretboard will have the same note. But this means you will only have 12 different possible values.
Let me know your preference and I can implement the change. (I think easily)