The things, for LED visualization of single musical instrument (piano), I skipped in the code one important part - expander. Basically, scaling procedure to fit input data in 8-bit array is nothing else than compression, and in order to get right values in the bins after processing complete, data have to be expanded back, using the exact values from amplification/shift variables.