Generate digital music with different timbre by analysing instruments' timbres and making use of midi
Add "matlab-midi-master" to Matlab path. It's a convinient toolbox for parsing midi file
Author of "matlab-midi-master": https://github.com/kts/matlab-midi. Thank you.
- Run guitarmusic.m in Guitar folder
note: If error happens like "index exceeds dimension", you may need to pay attention to line4'len=ceil((score(end,6)+100)*fs) 'and increase its value
This error is due to some problem happened in generating notes. - Run midimusic.m in Violin or Piano folder
Violin and piano timbres are generated by analysing their harmonic waves while guitar timbre is based on Karplus-Strong algorithm.
Run Melody.m in Melody folder. You can modify code inside to produce different timbre.
Music score is recorded in Melody.mat in the format of "Note do melody tbase"
Note: note means type of note; '16' means one-sixteenth note
do: do means pitch of whole melody such as C D E F G A B
melody: numbered musical notation
tbase: duration of a whole note
Example: Analysis_ViolinTimbre
Harmonic waves of different timbre are needed to be analysed to get ratio and envelope