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

My English blog is about music theory and music programming.

My Chinese blog is mainly about science-based learning skills.



R Package gm for Music Generation

Github | Complete Guide

R package gm provides an elegant language with which you can create music scores and audio files with ease. It works smoothly with R Markdown and can embed music in HTML and PDF files. It is useful for music education and algorithmic music composition.

Python Package ch0p1n for Automatic Composition

Github | Introduction

Python package ch0p1n provides a framework for manipulation of music motifs to generate music. The basic idea is that 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.

Music Album Night

Audio and Scores

The music album Night is written for solo piano. It describes images and subtle feelings related to night.

Also check my other music.

Book Data Science of Pink Floyd


The idea behind the book Data Science of Pink Floyd is to collect and analyze data about the band Pink Floyd with R data science tools.

The book is still in progress.


Contact me at renfeimao@gmail.com.

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