Renfei Mao


I write code, compose music, and write code that composes music.

As a software developer, I am interested in music generation. My works have received much positive feedback from researchers and developers. As a music composer, my pursuit is to create music that precisely captures subtle or complex emotions.

My Blog

English | Chinese | RSS

My English blog is about music theory, composition, and programming.

My Chinese blog is mainly about education, psychology, and self-learning skills.


R Package gm for Music Score and Audio Generation

Github | Complete Guide

Easily generate music scores and audio files in HTML and PDF files. Useful for music education, musicological research, and algorithmic music composition.

Python Package ch0p1n for Automatic Composition

Github | Introduction

Manipulate music motifs to generate music. The key idea is that even structurally complex music can be generated from a small amount of core materials under some common operations such as repetition and elaboration. This package is only a prototype for now.

Classical Music Album Night

Audio and Scores

Images and subtle feelings related to night. Written for solo piano. Also check my other music.

Book Data Science of Pink Floyd


Collect and analyze any data about Pink Floyd. R data science tools are used. Still in progress.


Contact me at

If you find my works helpful, consider buy me a coffee.