This research study on the rhythm of Bei Guan music and Peking Opera music. This research Use three way of rhythm complexity analyses - off-beatness, Keith’s measure and Weighted Note-to-Beat Distance to find out the complexity of these two traditional music. Moreover, use these analyzed complexity data to do curve fitting, generate linear graph and polynomial. After find out rhythm’s similarities and characteristic, apply properties and polynomials to rhythm generator of algorithmic composition. In addition, use the Markov Chain Model to find out the probability of pitches in Bei Guan music and Peking Opera music. Finally this research builds up algorithmic composition of traditional music, and composes music with special style. Hope this research can help algorithmic composition to generate rhythm in different ways and reach the field of traditional music.