The invention relates to a programmable music play system based on the Raspberry Pi, and the system comprises an infrared ray output module, a camera module, a Raspberry Pi development board, a keyboard pattern projection module, a music output module and a power module. The camera module, the keyboard pattern projection module, the infrared ray output module, the music output module and the powermodule are respectively connected with the Raspberry Pi development board. The keyboard pattern projection module forms a keyboard pattern on a plane through projection, and the infrared ray output module carries out the irradiation of a projection region. The camera module receives an infrared image from the infrared ray output module, and transmits the infrared image to the Raspberry Pi development board. The Raspberry Pi development board carries out the image processing, and recognizes the control gesture or key operation of a user on the keyboard pattern, and controls the music output module to play corresponding music. Compared with the prior art, the system is programmable, is portable, greatly reduces the cost in learning the related knowledge of the music and musical instruments,and reduces the performing difficulty of the musical instruments.