Many kinds of music use ostinati , e.g. classical music , jazz , Boogie-Woogie , African music . They have a large role in improvised music such as in jazz and Baroque music . A `` favorite technique of contemporary jazz writers '' , ostinati are often used in modal and Latin jazz , traditional African music including Gnawa music and boogie-woogie .