Skip to content

This project was completed as an Honors Contract for CSE 355. It converts a MIDI file to a Nondeterministic Finite Automata.

Notifications You must be signed in to change notification settings

yangbranden/MIDI_to_NFA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Midi to NFA Visualizer

This project was completed as an Honors Contract/Extra Credit Project for CSE 355 (Introduction to Theoretical Computer Science).

Demonstration Video: https://youtu.be/Ye_T-lA8hKQ

hi so I know practically nothing about music theory, so mb if this is inaccurate in a bunch of ways lol

if you want to download and play around with this, make sure that you add the libfluidsynth.dll file into Windows/System32/ so that FluidSynth works properly.

an issue I came across was finding the correct rate to run the program at:

  • pygame uses clock.tick(#) to set framerate and run the main game loop at a specified rate (I store this framerate value in a variable called FPS)
  • each midi file is made up of messages (notes to play) and meta information, which includes things like tempo and ticks_per_beat (and time signature but idk what to do with that)
  • the array holding all of the values for the notes has an entry for every single tick (if you look at the output of the mido object, each 'message' plays a note for a certain 'time' value, which corresponds to number of ticks to wait until playing the note; i.e. previous note played for next note's time value)
  • I think the problem is that my computer can't handle an FPS of ticks_per_beat (often something like 480) so it lags and then the songs slow down
  • so the solution was to essentially "downsample," and remove some of the ticks (depending on the DOWNSAMPLE_RATE variable)
  • i still can't calculate FPS correctly though because I have absolutely no idea how time signature works or if it's even relevant and I also dunno how to calculate it using tempo and ticks_per_beat lol oh whale

References

Libraries

Downloads/Resources

Helpful Articles and Videos

About

This project was completed as an Honors Contract for CSE 355. It converts a MIDI file to a Nondeterministic Finite Automata.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages