first try at implementing the percussion algorythm