[en] We present an experimental protocol that allows one to tune the packing fraction eta of a random pile of ferromagnetic spheres from a value close to the lower limit of random loose packing eta(RLP) similar or equal to 0.56 to the upper limit of random close packing eta(RCP) similar or equal to 0.64. This broad range of packing fraction values is obtained under normal gravity in air, by adjusting a magnetic cohesion between the grains during the formation of the pile. Attractive and repulsive magnetic interactions are found to affect stongly the internal structure and the stability of sphere packing. After the formation of the pile, the induced cohesion is decreased continuously along a linear decreasing ramp. The controlled collapse of the pile is found to generate various and reproducible values of the random packing fraction eta.