linkedin Billy Lam

Billy Lam

Optics Ph.D. graduated from the University of Rochester

Playing songs using matlab


First, the matlab code for reading the .midi file of the song is taken from Ken Schutte.


I wrote a recursive function in matlab that plays a series of notes of a song. The function also take in parameters that can adjusts the play speed, exponential decay time of each notes, amplitude of the higher harmonics, starting time etc.


I wrote this matlab code so I can listen to the melody and know what it should sound like when I learn to play the piece using guzheng.

Samples:

紅昭願

spd = 1.3, decay = 15 (e^(-15) in 3 s)


spd = 1.3, decay = 25 (e^(-25) in 3 s)


spd = 1.8, decay = 25 (e^(-25) in 3 s)








midi file from midishow


View entire guzheng score
Back to top