Tumgik
Text
Storing uploaded scores and sending transpose data
The next step was to allow a user to send the desired transpose key/step from the frontend and have the backend get the correct score from it’s previously uploaded scores. I implemented a sessionID variable in the frontend, that would be a unique ID for each session. Each newly uploaded score is stored in a LinkedHashMap with this sessionID, and if another score is uploaded in the same session, the previous score is overwritten. Also, by overriding the removeEldestEntry method in the LinkedHashMap class, I could set the max size of the hashmap, and have it delete the eldest member if the max size is reached. I used the details at https://stackoverflow.com/questions/41184893/delete-oldest-objects-from-hashmap-to-reach-certain-size to remove the eldest member of the hashmap. 
0 notes
Text
HTTP Connection
Had some trouble setting up a connection between the frontend and backend of our application. I used the Axios rest API (https://alligator.io/react/axios-react/) to be able to send HTTP requests to a specified destination, and used spring boot’s setup to receive and return “Greetings from Euphony!” once it had received a HTTP request. 
The problem I had was with setting up Cross-Origin-Resource-Sharing, or CORS. It proved quite difficult to understand exactly what CORS was and why I was getting this error, but after some research I found that I needed to configure the backend, so that CORS was enabled. Now, after building again, I found that the connection was set up. 
0 notes
Text
Music XML Parsing
Firstly looked into parsing musicXML files myself using java’s built-in XML parsing libraries, however it became clear that this would be very time consuming. 
I then decided to check online if there already existed a musicXML parsing library, and luckily, it seems that there is! https://github.com/Audiveris/proxymusic
Proxymusic unmarshals (packages) a musicXML file into usable java objects that can then be queried, and it also turns out that this library is related to the previously mentioned Audiveris Optical Music Reader, so there is likely a lot of similarities between the two libraries. 
After reading up on Proxymusic and experimenting with it, I decided it would be a good addition to the project, making life a lot easier when trying to parse musicXML files. 
0 notes
Text
Beginning the Project Research
Main tasks were as follows:
Find a method to read an image file of sheet music.
Export the image file to a computer readable format.
Firstly, we researched about processing sheet music from an image file, namely JPG and PNG, and it turns out that this has been tried before, but was a very difficult challenge to overcome.
The type of software we were looking for was OMR (Optical Mark Recognition) software.
Audiveris:
Upon further research, we found the Git repository Audiveris, which was an open source OMR specifically designed for reading sheet music from an image file, and translating it into a MusicXML file. The Git repo can be found here: https://github.com/Audiveris/audiveris
At first glance, Audiveris seems to be a very promising solution. It comes equipped with a basic GUI, however, the documentation states that this should only really be used for developer testing, which is fine for us.
We need to be able to import methods from Audiveris and call them in our program.
MusicXML:
MusicXML will have to be understood in order to properly use Audiveris, ie. If we cannot work with MusicXML, then we should not be working with Audiveris.
Ideally, we would like to be able to read MusicXML in plain text.
1 note · View note