I didn't neglect the middle part kain. When rms is above 150 I took it as 255 because then that section get highlighted. When its below 50 I took it as 100 then that section was also highlighted/differentiated (I mean that section is distinguishable as a different section of the track due to being darker than the rest of the track) and the middle part I let it be without putting it to a category. With most of the tracks I tested rms value is around 50 and 150 so I guess It's reasonable.
                                   In electronic logic you consider anything above 2.7 v as logic 1 and anything below 0.8 v as logic 0. Think for a sec why 2.7-0.8 but not 3-1 which are round numbers. Answer is it doesn't really matter the exact value if you like you can use 3 - 1 and it won't make a big change in your output. Similarly why exactly 50 - 150 does not matter. By changing it the drawn output is almost the same.(I have tried some values) I choose this range because usually rms value lies in this range. Maybe my electronic analogy is not appropriate but this is what I tried to say using it. Thank you very much for the comments and advice kain. I'm glad you are interested in what I am trying to do.