Another (simpler, faster) implemention.
Multiply the output of the noise function (in this case multiply by 5 )
Subtract the floor (-5, -4,...,0, 1,2,3,4)
This creates 10 ranges 0..1
create a groove in the lower range and a constant 1 in the upper range.
A groove is created by step(1-step) squared and negated in this case smooth step 0..0.5 is used