MartinMij / TDA-SQ

This project stores the MATLAB code used in the paper usical Stylistic Analysis: A Study of Intervallic Transition Graphs via Persistent Homology as well as complementary information.
3 stars 0 forks source link

The function 'stat' cannot be found in Matlab. #1

Open szHEJJ opened 1 year ago

szHEJJ commented 1 year ago

Hi! I am a college student, Jingjing, from China. I study topology theory which is used in the audio signal processing. I read your article about the music stylistic analysis. I like your idea and method, so I tried to run the code. But I ran into some bugs: The 'txt' file about the music piece cannot be found in Matlab, like 'quartet01-_1_edges_SP_distmat_intervals_0_right_format.txt'. This is my first time to ask a question on this website. I am not sure if you will reply to me, but I am looking forward to it! Kind regards.

MartinMij commented 1 year ago

Hi! Sorry for the delay in replying. I do not know wether I'm understanding properly your issue, but I guess that it has to do with the midi files. The script persistence.m computes the persistent homology of a string quartet given its midi file. I share with you the files corresponding to the minuets of the three authors. These correspond to the lists named as 'haydn', 'beethoven' and 'Mozart', so you should be able to run the function 'persistence' evaluating in the lists above, for instance persistence('haydn'), and obtain the barcodes stored in the txt files that you were referring to. I hope this answer your question and feel free to ask me in case there is something else that I can clarify. Best regards. Midi_files.zip

szHEJJ commented 1 year ago

Hi! It is so surprised to receive your reply! I am sorry for my delay in replying because these days I was busy with my new study life in UK. Yes, the file you uploaded is exactly what I need for the code! With this midi file, I ran the code and got the picture of three authors' comparative results successfully. I really appreciate your help! However, when I was running the code these days, I have two new questions as follows.

  1. Is it necessary to learn how to read the midi file? I do not understand part of the code in function ''ph'' about the ''nm1, nm2, nm3 and nm4'' which is related to the ''i1, i2, i3 and i4''.
  2. Is there any midi files for the other three functions ''pca_and_disp_Beethoven'', ''pca_and_disp_Beethoven'' and ''pca_and_disp_Beethoven'',or is there any way to find these authors' midi files easily? (I tried to find some midi files online on my own, but it turned out that the code could not read my midi file and failed to run out the result.) Again, it is very happy to receive your reply!

Best regards. Jingjing

MartinMij commented 1 year ago

Hi Jingjing,

Glad that the midi files have helped you.

Regarding to your further questions:

  1. To obtain a graph (which is needed to derive a simplicial complex and then apply persistent homology) is needed a score. An issue with the midi files that we have used is that they consist of four independent tracks, in this case corresponding to two violins, a viola and a cello. That is why I have extracted the four matrices nm1..., each one for each score. By the way, to have a well defined function pcdist2 (which computes the pitch class distributions), the score must be monophonic, that's the reason of the use of the function "extreme". In this link find the documentation of the Midi Toolbox.
  2. I would share with you all the midi files but I have lost of all them. If I'm recalling right, I've downloaded all of them from this webpage. Also you can find midi files in this page. I think that you have gotten errors with your midi files because they do not consist of four tracks (you could adapt the code to the number of tracks that you have) or they are not monophonic.

I hope the answer to be useful for you.

Best regards, Martín.

szHEJJ commented 1 year ago

Hi Martín!

Thank you for the replying! I browsed the website you shared and downloaded the midi file of Haydn and Mozart, but I still got two problems as follows:

  1. When I tried to run the function like ''persistence('allegrom')'', it failed and said that I used vietoris_rips_javaplexDM (line 55) incorrectly and 'Java exception occurred: java.lang.OutOfMemoryError: GC overhead limit exceeded'. This resulted that I couldn't run the function 'pca_and_disp_Haydn' and 'pca_and_disp_Mozart' successfully. But what confused me was that I have succeeded to run the ''persistence('adagioh') and ''persistence('allegroh') , which I thought they were all same as above. Is this because the number of the txt files in this whole file is so big that the function cannot work any more?
  2. I have found the other midi files in the function list on the website except Beethoven's, which should be named like 'quartet......'. I think maybe the owner of this website replaced the files of Beethoven with some of his symphony midi files. So, I am afraid that I cannot run the function 'pca_and_disp_Beethoven' successfully.

Considering this two question are not related to the logic of running the whole code, but some details on programming, so I think maybe this time I have to figure them out by myself. However, I still want to report them to you and let you know what I have done! I am not sure which part was wrong yet, so I decide to keep working on that and try my best to figure them out! Again, thank you very much for your help! It is very happy for me to get in touch with you!

Best regards, Jingjing.