Shreya’s Update for 4/30

This week, I focused mostly on testing the beat map generator. I had two main goals for the beat map at the beginning of this project. The first was to have the beat map generator take less than the length of the audio file to analyze the audio file and output a beat map generator. To test that, I ended up making about 50 maps and then computing the time it took to test it. I put the graph on our team’s slides. I think that goal is fine.
The second one with the synchronization has been trickier. It’s pretty simple to get the number of beats down to make the game playable for our audience (one piece of feedback we got), but I’m still not super sure what’s happening with the synchronization. I have this idea to only compute the most apparent beats instead of all of them to improve synchronization, but that’s something I will be testing. Unfortunately, I have a few papers and exams due, so I will probably dedicate Monday to working on this problem. This all needs to be done by Thursday for the TechSpark demo. I also have a final Thursday evening so this will likely be done between Monday and Thursday

Shreya’s Update for 4/23

This week, I was focused primarily on testing for the presentation and report for next week. I am running a script right now for the timing portions of my model about determining the average time it takes to run for certain lengths of times (one of my user requirements).

The second user requirement is harder to talk about. I have a few metrics that I I am considering which is comparison to a commonly known beat tracker without regarding false positives or negatives. This is because I included the melody tracking and the commonly used package does not. I was also considering submitting graphs of the areas in an audio file where the algorithm would place a beat to see if we can draw some comparisons for that. I have the wav files created, so having the intensity analysis graphs created should be pretty fast.

Lastly, I think we can incorporate the user feedback and the results we received from play testing.

I do actually have a bug currently in my code which suggests its outputting the wrong time stamps. I am working on trying to fix it, but I am unsure if I can get to it this week. I may have to look more into it next week and focus on the testing analysis for this weekend.

Shreya’s Update 4/16

Unfortunately, this week, I was pretty sick so I was absent from class.

However, I was able to make significant progress with the accuracy of the beat map creator. I ended up changing the energy calculation by making the window smaller than what it was before. I was calculating instantaneous energy in bins of 43 (recommended by the source I was using), but I ended up making the bin of length one instead. This also ended up being significantly faster. Currently, I am analyzing two frequency bands and splitting that into four buttons. I am analyzing the frequency bands separately and for a three and a half minute audio file, it takes about 112 seconds per frequency band to analyze. While that is slightly above my user requirement, tomorrow I plan to condense the algorithm into one loop so hopefully, it should take about 200 seconds total for a single audio file.

Also, as I mentioned last week, (George’s idea), I added a sound to indicate when my tracker found a beat. I have attached a few sound samples before. I have been creating a few additional beat maps as well for the testing phase of our game that we will be going through in a few weeks.

For the progress for the next week, I need to create a lot more files for testing as well as for verifying that my user requirements are met (or where they fall short). Furthermore, I need to create a main function to call everything instead of having to do it myself. This should only take a few hours because the code is pretty modular. Hopefully, I can have all of this done by Wednesday.

For scheduling, I should be on track. Everything is pretty much done, but I am working on some final touches.

NOTE: I’m having trouble uploading the files to the website because it says the maximum size of the files has been exceeded. I can show them later.

Shreya’s Update 4/10

This week, I was mostly focused on the Interim Demo. Last week, I had the idea of using the STFT to separate the audio file into frequency bins to analyze through the intensity analysis. I thought this would be more efficient due to the variability of the number of bins. However, I was having some trouble implementing it.

I spoke to Professor Sullivan regarding the approach, and he mentioned that it would be better to use bandpass filters and then run an intensity analysis on that. I ended up implementing that with scipy and then running the intensity analysis on the filtered wav files.
On Wednesday, I had an odd bug where there would be no outputs during long stretches of time during the audio file. I was able to fix that by scaling the array, and then analyzing it. That issue is fixed.

Timing wise, while the algorithm takes about six minutes to analyze a three minute audio file, I should be able to get this down to three minutes as per the user requirements through streamlining the code. I will not be doing this for this week because this will likely be a finishing touch after tuning and testing the algorithm.

Currently, the beatmap seems to have an offset correlating to a song. George suggested adding a noise to the audio file whenever my algorithm detects a beat, so I should have that done by Wednesday so I can better understand whether there is an offset- or what exactly is happening.
I am fine on schedule. We have had to change the Gantt Chart which reflects our scheduling differences. The updated Gantt will be on this week’s team update.

 

Shreya’s Update 4/2/2022

This week, I was working on getting the gameplay code installed on my computer. That worked around Wednesday, so I was able to begin visualizing the beat maps.
For the second half of the week, I started looking at melody tracking algorithms. I figured out how to map the frequency bands to the timing with a STFT (graph shown below).

I’m working on extracting the melody itself and getting the time stamps. According to this paper, the algorithm is to determine the frequency of the melody line (orange line on the bottom of the graph) and then extract the time stamps from those frequencies. I’m currently looking at using an external package to get these frequencies, but I should have a weak melody tracker by Monday.

For scheduling, I should be fine. I’m working on the automatic part of the beat tracker and the melody tracker simultaneously, so I’m pretty much on schedule.

Shreya’s Status Report for 3/26

For this week, I was working on testing and verifying the accuracy of the beat map. I mentioned before that I didn’t particularly trust the accuracy of the beat map. While looking at the beat tracking accuracy on the game itself, there was a slight offset and then some issues with the accuracy of the beat tracker. I think this is primarily due to the energy calculation I had instituted.
Originally, I was working with the equation that the scalar multiplier was equal to c = (-.0025714*energy) + 1.5142857

This worked fine on the primarily instrumental audio file. However, with the popular pop songs, I was unable to use this algorithm because the shift in intensities is a lot more varied when looking at the beats. Through testing, I need to find a new variable function for c.
One issue we ran into was that it’s difficult to visualize the beatmaps without the game code itself. The code unfortunately does not work on Windows, so we are having some trouble testing it. That is also reflected on the new gantt chart in our team status report.
Unfortunately, this does put us a few days behind schedule and I may have to implement a simpler melody tracker to compensate, but that will be determined. I created a side testing platform with the Python standard audio processing data, but the visualizer is still more accurate. I can continue work on the scalar c function without it for now.
We are slightly behind schedule, but we should be able to complete the project in time.

Shreya’s Status Update 3/19/2022

This week and at the tail end of Spring Break, I continued work on the beat tracker. I was able to output a set of time stamps from the beat tracker from the given audio file. I also created the json that holds the information. 

Currently, the json assumes that everything will be on the same button. However, this is planned to change post-MVP.

On first glance, the tracker seems to have an alright accuracy. Compared to Librosa’s beat tracker, it is usually with a .2s timer. However, after further analysis of the Librosa beat tracker, I have noticed that their tracker stops about thirty seconds before the end of the audio file. I am unsure if we can use their beat tracker as an accurate count of beats.

The plan for tomorrow and the beginning of next week is to visualize the beat tracking to get a better sense of its accuracy to the song. It probably does need to be tuned and there are a few parameters I can change if it needs to be tuned.

So far, we seem to be mostly on track for having the project done. Fine tuning the beat tracker will need to be done next week with the visualization and then research on melody tracking will likely have to happen.

I feel a few days behind schedule because I don’t have final verification that the beat tracker works, but it should not be too difficult to catch back up

Shreya’s Update 2/26

Last week, I was having issues with determining the beat amplitude (general). I am continuing to use the amplitude threshold-based onset beat detection algorithm. One idea for this algorithm is to determine a subset of the audio file where beat detection is definitely occurring (done using the BPM). On the subset, the algorithm appears to be working alright. Unfortunately, I am still working on setting up the testing sequence, but on first glance, the time stamps from the subset of the audio file created by my script appear to match what I expected it to. One thing is I do believe it is overdetecting some beats, which is due to the nature of the sampling rate of the wav file. I need to figure out how to sort through these detections to get it into a user friendly pattern.

The next steps are to again verify the subset’s beat detection and then attempt to extend it throughout the entire instrumental file. Because this is the instrumental file, further testing will need to occur to understand the limits of the algorithm. We were asked a question during the presentation over what exactly the limits of the algorithm are, so testing for whether it can handle short clips, or long clips, etc will have to begin next week if the algorithm can handle the entire wav file.

Currently, I believe I am still on schedule because the instrumental piece is close to being done. I think we should be okay to reach our goals set on the gantt chart.

Shreya’s Update for 2/19

At the beginning of this week, I was beginning to experiment with the exporting of time stamps for an instrumental version. In order to determine the desired amplitudes for the beats, I visually determined (from the time-domain representation attached below), the correct peaks of the beats and then searched through the wav file for the timings related to the desired peaks at the time difference per beat determined by the BPM.

Because I hardcoded the desired amplitudes for beats (I used absolute peaks) last week, I was trying to determine an algorithm for getting the amplitude of beats in a particular song. That amplitude would be used to search for the time stamps in a different file. However, this has been slower going. Because I can’t rely on the beats being the highest amplitude and instead, it needs to be primarily based on the BPM. For this week, I have been getting more false positives than actual positives.
My deliverable for next week hopefully will be an accurate amplitude determination for beats (automatic, not hardcoded) integrated into a different file that exports time stamps. So far, I am on schedule for the project as a whole. I have several weeks to finish up an accurate beat tracker.

Shreya’s Status Report for 2/12

This week, I looked into various methods of implementing the beat tracker algorithm. I looked at the fft’s from a basic example of a simple beat as well as the fft of a more complicated, multi instrument song. I attached both here. It can be seen that the complicated song has more noise. A majority of algorithms do not depend on filtering out higher frequencies. Instead, they suggest looking at consistency. A popular method is to determine the spikes in frequency and consider that the beat. For this game, this should hopefully be sufficient. 

I put this in lower quality for the post, so it’s difficult to see. This is the basic fft for about three minutes. As it can be seen, there is very little noise and the spikes are relatively clean.

Here, we can see the fft for a complicated song (“Drive By” by Train). Again, because of the low quality of the post, the noise levels are difficult to see, but this is significantly noisier than the previous graph, something that will have to be considered in the future.

There are several challenges that can be considered when looking at this. The examples up above show the majority of the song. Although the noise is not as apparent in the full sections of the songs, the complicated example is far noisier. Taking out this noise would take too long and be too complex to consider. However, one idea I have is to have an input (user-generated) beat pulse and use that to detect the specific beat of the current song. This is hopefully only for the beginning stages, and should be gone later as the algorithm advances. This week, I worked on looking at the implementation with this on numpy. Even processing the data is very slow on my personal device, so I’m looking at using other processing tools that would work better with our user requirements.