Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: MIDIfile save function and new requirement #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gregory-mc
Copy link

I added a function to save midifile that includes parts of play_midi_from_data( ) and write_to_midifile( ) I find this interesting when someone wants to sonify data with loops (76 items for example).

Captura

I also added a new requirement because numpy version 1.20 requires python 3.7.
I tried install sonify in a conda env with python 3.7 and I couldn't.

Comment on lines +170 to +174
if track_type not in ['single', 'multiple']:
raise ValueError('Track type must be single or multiple')

if track_type == 'single':
data = [data]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gregory-mc! Thank you SO much for the pull request! This functionality makes total sense! My only suggestion would be instead of copying and pasting a lot of the code from the write_to_midifile function, it might be nice to instead factor out the repeated bits so that any future change to how things work won't have to be made twice!

That being said, I'm also happy to merge as is and make the change later (if I can get to it!)

This was a fun hobby project, it's so cool to see other folks getting use out of it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants