This work deals with grasping using an anthropomorphic hand. The main idea is to easily compute a grasp for a robotic hand in the context of a given task. This paper describes a method that does not require learning. Starting from works in the neuroscience field on human hand postural synergies, we introduce a two-level algorithm that uses a mathematical model of relationships between muscles and degrees-of-freedom of the hand and a set of five parameters to define synergies between muscles according to some grasp properties taken from an existing taxonomy of grasps. The two-level architecture presented in this paper aims to provide the flexibility needed for working with a real robotic hand. This algorithm is validated both in simulation using Gazebo and on the Shadow Robot Hand.