Computer music composition has been the dream of the computer music researcher. In this paper, we investigated the approach to discover the rules of music composition from given music objects, and automatically generate a new music object style similar to the given music objects. The proposed approach utilizes the data mining techniques to discover the rules of music composition characterized by the music properties, music structure, melody style and motif. A new music object is generated based on the discovered rules. To measure the effectiveness of proposed computer music composition approach, we adopted the method similar to the Turing test to test the discrimination between machine-generated and human-composed music. Experimental results showed that it is hard to discriminate. Another experiment showed that the style of generated music is similar to the given music objects.